maps4fs 1.8.249__tar.gz → 1.8.251__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. {maps4fs-1.8.249 → maps4fs-1.8.251}/PKG-INFO +3 -1
  2. {maps4fs-1.8.249 → maps4fs-1.8.251}/README.md +2 -0
  3. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/background.py +19 -0
  4. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/i3d.py +2 -0
  5. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/settings.py +1 -0
  6. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs.egg-info/PKG-INFO +3 -1
  7. {maps4fs-1.8.249 → maps4fs-1.8.251}/pyproject.toml +1 -1
  8. {maps4fs-1.8.249 → maps4fs-1.8.251}/LICENSE.md +0 -0
  9. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/__init__.py +0 -0
  10. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/__init__.py +0 -0
  11. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/__init__.py +0 -0
  12. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/base/__init__.py +0 -0
  13. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/base/component.py +0 -0
  14. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/base/component_image.py +0 -0
  15. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/base/component_mesh.py +0 -0
  16. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/base/component_xml.py +0 -0
  17. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/config.py +0 -0
  18. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/grle.py +0 -0
  19. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/layer.py +0 -0
  20. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/satellite.py +0 -0
  21. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/component/texture.py +0 -0
  22. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dem.py +0 -0
  23. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/__init__.py +0 -0
  24. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/arctic.py +0 -0
  25. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/baden.py +0 -0
  26. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/base/wcs.py +0 -0
  27. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/base/wms.py +0 -0
  28. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/bavaria.py +0 -0
  29. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/canada.py +0 -0
  30. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/czech.py +0 -0
  31. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/denmark.py +0 -0
  32. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/dtm.py +0 -0
  33. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/england.py +0 -0
  34. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/finland.py +0 -0
  35. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/flanders.py +0 -0
  36. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/france.py +0 -0
  37. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/hessen.py +0 -0
  38. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/italy.py +0 -0
  39. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/lithuania.py +0 -0
  40. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/mv.py +0 -0
  41. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/niedersachsen.py +0 -0
  42. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/norway.py +0 -0
  43. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/nrw.py +0 -0
  44. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/rema.py +0 -0
  45. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/sachsenanhalt.py +0 -0
  46. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/scotland.py +0 -0
  47. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/spain.py +0 -0
  48. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/srtm.py +0 -0
  49. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/switzerland.py +0 -0
  50. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/thuringia.py +0 -0
  51. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/usgs_wcs.py +0 -0
  52. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/dtm/utils.py +0 -0
  53. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/game.py +0 -0
  54. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/map.py +0 -0
  55. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/qgis.py +0 -0
  56. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/generator/statistics.py +0 -0
  57. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/logger.py +0 -0
  58. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/toolbox/__init__.py +0 -0
  59. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/toolbox/background.py +0 -0
  60. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/toolbox/custom_osm.py +0 -0
  61. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs/toolbox/dem.py +0 -0
  62. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs.egg-info/SOURCES.txt +0 -0
  63. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs.egg-info/dependency_links.txt +0 -0
  64. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs.egg-info/requires.txt +0 -0
  65. {maps4fs-1.8.249 → maps4fs-1.8.251}/maps4fs.egg-info/top_level.txt +0 -0
  66. {maps4fs-1.8.249 → maps4fs-1.8.251}/setup.cfg +0 -0
  67. {maps4fs-1.8.249 → maps4fs-1.8.251}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 1.8.249
3
+ Version: 1.8.251
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: MIT License
@@ -601,6 +601,8 @@ You can also apply some advanced settings to the map generation process.<br>
601
601
 
602
602
  - Generate water - if enabled, the water planes obj files will be generated. You can turn it off if you already have those files or don't need them. By default, it's set to True.
603
603
 
604
+ - Water blurriness - used to make the water surface smoother. The higher the value, the more flat surface of the water planes will be. However, too high values can lead to the water planes mesh not matching the terrain.
605
+
604
606
  - Resize factor - the factor by which the background terrain will be resized. It will be used as 1 / resize_factor while generating the models. Which means that the larger the value the more the terrain will be resized. The lowest value is 1, in this case background terrain will not be resized. Note, than low values will lead to long processing and enormous size of the obj files.
605
607
 
606
608
  - Remove center - if enabled, the playable region (map terrain) will be removed from the background terrain. By default, it's set to True.
@@ -570,6 +570,8 @@ You can also apply some advanced settings to the map generation process.<br>
570
570
 
571
571
  - Generate water - if enabled, the water planes obj files will be generated. You can turn it off if you already have those files or don't need them. By default, it's set to True.
572
572
 
573
+ - Water blurriness - used to make the water surface smoother. The higher the value, the more flat surface of the water planes will be. However, too high values can lead to the water planes mesh not matching the terrain.
574
+
573
575
  - Resize factor - the factor by which the background terrain will be resized. It will be used as 1 / resize_factor while generating the models. Which means that the larger the value the more the terrain will be resized. The lowest value is 1, in this case background terrain will not be resized. Note, than low values will lead to long processing and enormous size of the obj files.
574
576
 
575
577
  - Remove center - if enabled, the playable region (map terrain) will be removed from the background terrain. By default, it's set to True.
@@ -510,6 +510,18 @@ class Background(MeshComponent, ImageComponent):
510
510
  cv2.imwrite(self.output_path, dem_image)
511
511
  self.logger.debug("Water depth subtracted from DEM data: %s", self.output_path)
512
512
 
513
+ def _get_blur_power(self) -> int:
514
+ """Returns the blur power for the water resources to apply Gaussian blur.
515
+
516
+ Returns:
517
+ int: The blur power for the water resources.
518
+ """
519
+ blur_power = max(3, min(self.map.background_settings.water_blurriness, 99))
520
+ if blur_power % 2 == 0:
521
+ blur_power += 1
522
+
523
+ return blur_power
524
+
513
525
  def generate_water_resources_obj(self) -> None:
514
526
  """Generates 3D obj files based on water resources data."""
515
527
  if not os.path.isfile(self.water_resources_path):
@@ -533,6 +545,13 @@ class Background(MeshComponent, ImageComponent):
533
545
  # Single channeled 16 bit DEM image of terrain.
534
546
  background_dem = cv2.imread(self.not_substracted_path, cv2.IMREAD_UNCHANGED)
535
547
 
548
+ if self.map.background_settings.water_blurriness:
549
+ # Apply Gaussian blur to the background dem.
550
+ blur_power = self._get_blur_power()
551
+ background_dem = cv2.GaussianBlur(
552
+ background_dem, (blur_power, blur_power), sigmaX=blur_power, sigmaY=blur_power
553
+ )
554
+
536
555
  # Remove all the values from the background dem where the plane_water is 0.
537
556
  background_dem[plane_water == 0] = 0
538
557
 
@@ -453,6 +453,8 @@ class I3d(XMLComponent):
453
453
 
454
454
  if leaf_type == "mixed":
455
455
  trees_with_leaf_type = [tree for tree in tree_schema if tree.get("leaf_type")]
456
+ if not trees_with_leaf_type:
457
+ return choice(tree_schema)
456
458
  return choice(trees_with_leaf_type)
457
459
 
458
460
  trees_by_leaf_type = [tree for tree in tree_schema if tree.get("leaf_type") == leaf_type]
@@ -149,6 +149,7 @@ class BackgroundSettings(SettingsModel):
149
149
 
150
150
  generate_background: bool = False
151
151
  generate_water: bool = False
152
+ water_blurriness: int = 20
152
153
  resize_factor: int = 8
153
154
  remove_center: bool = True
154
155
  apply_decimation: bool = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 1.8.249
3
+ Version: 1.8.251
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: MIT License
@@ -601,6 +601,8 @@ You can also apply some advanced settings to the map generation process.<br>
601
601
 
602
602
  - Generate water - if enabled, the water planes obj files will be generated. You can turn it off if you already have those files or don't need them. By default, it's set to True.
603
603
 
604
+ - Water blurriness - used to make the water surface smoother. The higher the value, the more flat surface of the water planes will be. However, too high values can lead to the water planes mesh not matching the terrain.
605
+
604
606
  - Resize factor - the factor by which the background terrain will be resized. It will be used as 1 / resize_factor while generating the models. Which means that the larger the value the more the terrain will be resized. The lowest value is 1, in this case background terrain will not be resized. Note, than low values will lead to long processing and enormous size of the obj files.
605
607
 
606
608
  - Remove center - if enabled, the playable region (map terrain) will be removed from the background terrain. By default, it's set to True.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maps4fs"
7
- version = "1.8.249"
7
+ version = "1.8.251"
8
8
  description = "Generate map templates for Farming Simulator from real places."
9
9
  authors = [{name = "iwatkot", email = "iwatkot@gmail.com"}]
10
10
  license = {text = "MIT License"}
File without changes
File without changes
File without changes
File without changes