maps4fs 0.8.9__tar.gz → 0.9.1__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 (24) hide show
  1. {maps4fs-0.8.9 → maps4fs-0.9.1}/PKG-INFO +2 -11
  2. {maps4fs-0.8.9 → maps4fs-0.9.1}/README.md +1 -10
  3. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/background.py +2 -1
  4. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/texture.py +2 -16
  5. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs.egg-info/PKG-INFO +2 -11
  6. {maps4fs-0.8.9 → maps4fs-0.9.1}/pyproject.toml +1 -1
  7. {maps4fs-0.8.9 → maps4fs-0.9.1}/LICENSE.md +0 -0
  8. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/__init__.py +0 -0
  9. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/__init__.py +0 -0
  10. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/component.py +0 -0
  11. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/config.py +0 -0
  12. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/dem.py +0 -0
  13. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/game.py +0 -0
  14. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/i3d.py +0 -0
  15. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/map.py +0 -0
  16. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/path_steps.py +0 -0
  17. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/generator/tile.py +0 -0
  18. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs/logger.py +0 -0
  19. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs.egg-info/SOURCES.txt +0 -0
  20. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs.egg-info/dependency_links.txt +0 -0
  21. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs.egg-info/requires.txt +0 -0
  22. {maps4fs-0.8.9 → maps4fs-0.9.1}/maps4fs.egg-info/top_level.txt +0 -0
  23. {maps4fs-0.8.9 → maps4fs-0.9.1}/setup.cfg +0 -0
  24. {maps4fs-0.8.9 → maps4fs-0.9.1}/tests/test_generator.py +0 -0
@@ -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
 
@@ -242,10 +242,6 @@ Example of the `Texture` component:
242
242
  "minimum_y": 5013940.540089059,
243
243
  "maximum_x": 441233.5397821935,
244
244
  "maximum_y": 5016006.074349126,
245
- "height": 2065.5342600671574,
246
- "width": 2072.295804702677,
247
- "height_coef": 1.0085616504234167,
248
- "width_coef": 1.011863185889979
249
245
  },
250
246
  ```
251
247
 
@@ -258,12 +254,7 @@ And here's the list of the fields:
258
254
  - `"minimum_x"` - the minimum x coordinate of the map (UTM projection),<br>
259
255
  - `"minimum_y"` - the minimum y coordinate of the map (UTM projection),<br>
260
256
  - `"maximum_x"` - the maximum x coordinate of the map (UTM projection),<br>
261
- - `"maximum_y"` - the maximum y coordinate of the map (UTM projection),<br>
262
- - `"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>
263
- - `"width"` - the width of the map in meters (same as above),<br>
264
- - `"height_coef"` - since we need a texture of exact size, the height of the map is multiplied by this coefficient,<br>
265
- - `"width_coef"` - same as above but for the width,<br>
266
- - `"tile_name"` - the name of the SRTM tile which was used to generate the height map, e.g. "N52E013"<br>
257
+ - `"maximum_y"` - the maximum y coordinate of the map (UTM projection),
267
258
 
268
259
  ### Background
269
260
 
@@ -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
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maps4fs"
7
- version = "0.8.9"
7
+ version = "0.9.1"
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
File without changes