maps4fs 0.8.8__py3-none-any.whl → 0.8.9__py3-none-any.whl

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.
maps4fs/generator/dem.py CHANGED
@@ -17,7 +17,7 @@ DEFAULT_MULTIPLIER = 1
17
17
  DEFAULT_BLUR_RADIUS = 35
18
18
 
19
19
 
20
- # pylint: disable=R0903
20
+ # pylint: disable=R0903, R0902
21
21
  class DEM(Component):
22
22
  """Component for processing Digital Elevation Model data.
23
23
 
@@ -51,6 +51,7 @@ class DEM(Component):
51
51
  )
52
52
 
53
53
  self.auto_process = self.kwargs.get("auto_process", False)
54
+ self.plateau = self.kwargs.get("plateau", False)
54
55
 
55
56
  @property
56
57
  def dem_path(self) -> str:
@@ -159,6 +160,22 @@ class DEM(Component):
159
160
  resampled_data.max(),
160
161
  )
161
162
 
163
+ if self.plateau:
164
+ # Plateau is a flat area with a constant height.
165
+ # So we just add this value to each pixel of the DEM.
166
+ # And also need to ensure that there will be no values with height greater than
167
+ # it's allowed in 16-bit unsigned integer.
168
+
169
+ resampled_data += self.plateau
170
+ resampled_data = np.clip(resampled_data, 0, 65535)
171
+
172
+ self.logger.debug(
173
+ "Plateau with height %s was added to DEM data. Min: %s, max: %s.",
174
+ self.plateau,
175
+ resampled_data.min(),
176
+ resampled_data.max(),
177
+ )
178
+
162
179
  cv2.imwrite(self._dem_path, resampled_data)
163
180
  self.logger.debug("DEM data was saved to %s.", self._dem_path)
164
181
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maps4fs
3
- Version: 0.8.8
3
+ Version: 0.8.9
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
@@ -419,6 +419,8 @@ Here's the list of the advanced settings:
419
419
 
420
420
  - DEM Blur radius: the radius of the Gaussian blur filter applied to the DEM map. By default, it's set to 21. This filter just makes the DEM map smoother, so the height transitions will be more natural. You can set it to 1 to disable the filter, but it will result as a Minecraft-like map.
421
421
 
422
+ - DEM Plateau height: this value will be added to each pixel of the DEM image, making it "higher". It's useful when you want to add some negative heights on the map, which appears to be in a "low" place. By default, it's set to 0.
423
+
422
424
  ## Resources
423
425
  In this section you'll find a list of the resources that you need to create a map for the Farming Simulator.<br>
424
426
  To create a basic map, you only need the Giants Editor. But if you want to create a background terrain - the world around the map, so it won't look like it's floating in the void - you also need Blender and the Blender Exporter Plugins. To create realistic textures for the background terrain, the QGIS is required to obtain high-resolution satellite images.<br>
@@ -4,15 +4,15 @@ maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk
4
4
  maps4fs/generator/background.py,sha256=YZbTSijKgNQOvpWJHqCJNHeoV5GxUjp79b8PoQwRQH0,10778
5
5
  maps4fs/generator/component.py,sha256=g3IBC8ul9zmcG9tHvyPJIg8hxBHFR8kB8Smw9yMW3qA,7864
6
6
  maps4fs/generator/config.py,sha256=JkRexT_ZclRa_x0w6ojgG-Tsu4NoshFTUGycRFdfrVk,3463
7
- maps4fs/generator/dem.py,sha256=FsYcaf0IQSYykKdbkHxAN5-Rc_PZZEBJfdZA2Z-b8AU,14514
7
+ maps4fs/generator/dem.py,sha256=p7THncPUdYWtNR2HrTXe0bCuJ8psUV8rRpYPJkzL2gA,15220
8
8
  maps4fs/generator/game.py,sha256=94HjPNOyy6XSSOnBp-uxrkBglKyC-X3ULIrrucfdlKw,6825
9
9
  maps4fs/generator/i3d.py,sha256=UuQiQRusPQ2f6PvGKxJ_UZeXsx3uG15efmy8Ysnm3F8,3597
10
10
  maps4fs/generator/map.py,sha256=BS8ylTCRlHRmbImg73wnHMpBB2ODckVyVZq5KJhCMfM,4236
11
11
  maps4fs/generator/path_steps.py,sha256=rKslIiG9mriCVL9_0i8Oet2p0DITrpBWi0pECpvuyUM,2707
12
12
  maps4fs/generator/texture.py,sha256=0gkohGmamZbmqc9VpPqt8pli_x9w9SnUh2JjYGaiI3I,18170
13
13
  maps4fs/generator/tile.py,sha256=3vmfjQiPiiUZKPuIo5tg2rOKkgcP1NRVkMGK-Vo10-A,2138
14
- maps4fs-0.8.8.dist-info/LICENSE.md,sha256=-JY0v7p3dwXze61EbYiK7YEJ2aKrjaFZ8y2xYEOrmRY,1068
15
- maps4fs-0.8.8.dist-info/METADATA,sha256=X4Itc4SeeLiMW-2OIysHfKnpLM0MfqAIb1JduUK2Mq0,23799
16
- maps4fs-0.8.8.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
17
- maps4fs-0.8.8.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
18
- maps4fs-0.8.8.dist-info/RECORD,,
14
+ maps4fs-0.8.9.dist-info/LICENSE.md,sha256=-JY0v7p3dwXze61EbYiK7YEJ2aKrjaFZ8y2xYEOrmRY,1068
15
+ maps4fs-0.8.9.dist-info/METADATA,sha256=99ENTzW6vG2TNZDrnN4fBNQtUTYmMzfaFyn93BAZJjY,24031
16
+ maps4fs-0.8.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
17
+ maps4fs-0.8.9.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
18
+ maps4fs-0.8.9.dist-info/RECORD,,