maps4fs 0.8.9__py3-none-any.whl → 0.9.1__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.
@@ -50,7 +50,8 @@ class Background(Component):
50
50
  tile_code=path_step.code,
51
51
  auto_process=False,
52
52
  blur_radius=self.kwargs.get("blur_radius"),
53
- multiplier=1,
53
+ multiplier=self.kwargs.get("multiplier", 1),
54
+ plateau=self.kwargs.get("plateau", 0),
54
55
  )
55
56
 
56
57
  # Update the origin for the next tile.
@@ -167,14 +167,6 @@ class Texture(Component):
167
167
  self.logger.debug("Map minimum coordinates (XxY): %s x %s.", self.minimum_x, self.minimum_y)
168
168
  self.logger.debug("Map maximum coordinates (XxY): %s x %s.", self.maximum_x, self.maximum_y)
169
169
 
170
- self.height = abs(north - south)
171
- self.width = abs(east - west)
172
- self.logger.info("Map dimensions (HxW): %s x %s.", self.height, self.width)
173
-
174
- self.height_coef = self.height / self.map_height
175
- self.width_coef = self.width / self.map_width
176
- self.logger.debug("Map coefficients (HxW): %s x %s.", self.height_coef, self.width_coef)
177
-
178
170
  def info_sequence(self) -> dict[str, Any]:
179
171
  """Returns the JSON representation of the generation info for textures."""
180
172
  useful_attributes = [
@@ -186,10 +178,6 @@ class Texture(Component):
186
178
  "minimum_y",
187
179
  "maximum_x",
188
180
  "maximum_y",
189
- "height",
190
- "width",
191
- "height_coef",
192
- "width_coef",
193
181
  ]
194
182
  return {attr: getattr(self, attr, None) for attr in useful_attributes}
195
183
 
@@ -321,8 +309,7 @@ class Texture(Component):
321
309
  Returns:
322
310
  int: Relative X coordinate in map image.
323
311
  """
324
- raw_x = x - self.minimum_x
325
- return int(raw_x * self.height_coef)
312
+ return int(self.map_width * (x - self.minimum_x) / (self.maximum_x - self.minimum_x))
326
313
 
327
314
  def get_relative_y(self, y: float) -> int:
328
315
  """Converts UTM Y coordinate to relative Y coordinate in map image.
@@ -333,8 +320,7 @@ class Texture(Component):
333
320
  Returns:
334
321
  int: Relative Y coordinate in map image.
335
322
  """
336
- raw_y = y - self.minimum_y
337
- return self.height - int(raw_y * self.width_coef)
323
+ return int(self.map_height * (1 - (y - self.minimum_y) / (self.maximum_y - self.minimum_y)))
338
324
 
339
325
  # pylint: disable=W0613
340
326
  def _to_np(self, geometry: shapely.geometry.polygon.Polygon, *args) -> np.ndarray:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maps4fs
3
- Version: 0.8.9
3
+ Version: 0.9.1
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
@@ -266,10 +266,6 @@ Example of the `Texture` component:
266
266
  "minimum_y": 5013940.540089059,
267
267
  "maximum_x": 441233.5397821935,
268
268
  "maximum_y": 5016006.074349126,
269
- "height": 2065.5342600671574,
270
- "width": 2072.295804702677,
271
- "height_coef": 1.0085616504234167,
272
- "width_coef": 1.011863185889979
273
269
  },
274
270
  ```
275
271
 
@@ -282,12 +278,7 @@ And here's the list of the fields:
282
278
  - `"minimum_x"` - the minimum x coordinate of the map (UTM projection),<br>
283
279
  - `"minimum_y"` - the minimum y coordinate of the map (UTM projection),<br>
284
280
  - `"maximum_x"` - the maximum x coordinate of the map (UTM projection),<br>
285
- - `"maximum_y"` - the maximum y coordinate of the map (UTM projection),<br>
286
- - `"height"` - the height of the map in meters (it won't be equal to the parameters above since the Earth is not flat, sorry flat-earthers),<br>
287
- - `"width"` - the width of the map in meters (same as above),<br>
288
- - `"height_coef"` - since we need a texture of exact size, the height of the map is multiplied by this coefficient,<br>
289
- - `"width_coef"` - same as above but for the width,<br>
290
- - `"tile_name"` - the name of the SRTM tile which was used to generate the height map, e.g. "N52E013"<br>
281
+ - `"maximum_y"` - the maximum y coordinate of the map (UTM projection),
291
282
 
292
283
  ### Background
293
284
 
@@ -1,7 +1,7 @@
1
1
  maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
2
2
  maps4fs/logger.py,sha256=CneeHxQywjNUJXqQrUUSeiDxu95FfrfyK_Si1v0gMZ8,1477
3
3
  maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
4
- maps4fs/generator/background.py,sha256=YZbTSijKgNQOvpWJHqCJNHeoV5GxUjp79b8PoQwRQH0,10778
4
+ maps4fs/generator/background.py,sha256=ThYwjk7XJuqMDf9ITh22clvE5wVq_b1lSRH4Ha8REC8,10864
5
5
  maps4fs/generator/component.py,sha256=g3IBC8ul9zmcG9tHvyPJIg8hxBHFR8kB8Smw9yMW3qA,7864
6
6
  maps4fs/generator/config.py,sha256=JkRexT_ZclRa_x0w6ojgG-Tsu4NoshFTUGycRFdfrVk,3463
7
7
  maps4fs/generator/dem.py,sha256=p7THncPUdYWtNR2HrTXe0bCuJ8psUV8rRpYPJkzL2gA,15220
@@ -9,10 +9,10 @@ maps4fs/generator/game.py,sha256=94HjPNOyy6XSSOnBp-uxrkBglKyC-X3ULIrrucfdlKw,682
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
- maps4fs/generator/texture.py,sha256=0gkohGmamZbmqc9VpPqt8pli_x9w9SnUh2JjYGaiI3I,18170
12
+ maps4fs/generator/texture.py,sha256=CwaXZfAG4e3D3YR7yVR2MC677EHpbUWTboCS3G6jkhk,17723
13
13
  maps4fs/generator/tile.py,sha256=3vmfjQiPiiUZKPuIo5tg2rOKkgcP1NRVkMGK-Vo10-A,2138
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,,
14
+ maps4fs-0.9.1.dist-info/LICENSE.md,sha256=-JY0v7p3dwXze61EbYiK7YEJ2aKrjaFZ8y2xYEOrmRY,1068
15
+ maps4fs-0.9.1.dist-info/METADATA,sha256=XTu4AwG_x6F8n_7ooxJMRCBXv7RwuR2Jf5Po8i1zRGs,23393
16
+ maps4fs-0.9.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
17
+ maps4fs-0.9.1.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
18
+ maps4fs-0.9.1.dist-info/RECORD,,