maps4fs 1.8.198__tar.gz → 1.8.200__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 (65) hide show
  1. {maps4fs-1.8.198 → maps4fs-1.8.200}/PKG-INFO +3 -1
  2. {maps4fs-1.8.198 → maps4fs-1.8.200}/README.md +2 -0
  3. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/__init__.py +1 -1
  4. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/__init__.py +1 -0
  5. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/dtm.py +11 -1
  6. maps4fs-1.8.200/maps4fs/generator/dtm/lithuania.py +49 -0
  7. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs.egg-info/PKG-INFO +3 -1
  8. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs.egg-info/SOURCES.txt +1 -0
  9. {maps4fs-1.8.198 → maps4fs-1.8.200}/pyproject.toml +1 -1
  10. {maps4fs-1.8.198 → maps4fs-1.8.200}/LICENSE.md +0 -0
  11. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/__init__.py +0 -0
  12. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/__init__.py +0 -0
  13. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/background.py +0 -0
  14. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/base/__init__.py +0 -0
  15. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/base/component.py +0 -0
  16. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/base/component_image.py +0 -0
  17. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/base/component_mesh.py +0 -0
  18. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/base/component_xml.py +0 -0
  19. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/config.py +0 -0
  20. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/grle.py +0 -0
  21. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/i3d.py +0 -0
  22. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/layer.py +0 -0
  23. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/satellite.py +0 -0
  24. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/component/texture.py +0 -0
  25. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dem.py +0 -0
  26. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/arctic.py +0 -0
  27. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/baden.py +0 -0
  28. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/base/wcs.py +0 -0
  29. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/base/wms.py +0 -0
  30. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/bavaria.py +0 -0
  31. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/canada.py +0 -0
  32. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/czech.py +0 -0
  33. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/denmark.py +0 -0
  34. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/england.py +0 -0
  35. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/finland.py +0 -0
  36. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/flanders.py +0 -0
  37. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/france.py +0 -0
  38. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/hessen.py +0 -0
  39. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/italy.py +0 -0
  40. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/mv.py +0 -0
  41. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/niedersachsen.py +0 -0
  42. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/norway.py +0 -0
  43. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/nrw.py +0 -0
  44. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/rema.py +0 -0
  45. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/sachsenanhalt.py +0 -0
  46. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/scotland.py +0 -0
  47. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/spain.py +0 -0
  48. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/srtm.py +0 -0
  49. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/switzerland.py +0 -0
  50. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/usgs_wcs.py +0 -0
  51. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/dtm/utils.py +0 -0
  52. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/game.py +0 -0
  53. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/map.py +0 -0
  54. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/qgis.py +0 -0
  55. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/generator/settings.py +0 -0
  56. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/logger.py +0 -0
  57. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/toolbox/__init__.py +0 -0
  58. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/toolbox/background.py +0 -0
  59. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/toolbox/custom_osm.py +0 -0
  60. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs/toolbox/dem.py +0 -0
  61. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs.egg-info/dependency_links.txt +0 -0
  62. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs.egg-info/requires.txt +0 -0
  63. {maps4fs-1.8.198 → maps4fs-1.8.200}/maps4fs.egg-info/top_level.txt +0 -0
  64. {maps4fs-1.8.198 → maps4fs-1.8.200}/setup.cfg +0 -0
  65. {maps4fs-1.8.198 → maps4fs-1.8.200}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: maps4fs
3
- Version: 1.8.198
3
+ Version: 1.8.200
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
@@ -714,6 +714,8 @@ In addition to SRTM 30m, which provides global coverage, the map above highlight
714
714
  | 🇩🇰 Denmark | 0.4 meter | [kbrandwijk](https://github.com/kbrandwijk) |
715
715
  | 🇨🇭 Switzerland | 0.5-2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
716
716
  | 🇨🇿 Czech Republic | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
717
+ | 🇱🇹 Lithuania | 1 meter | [Tox3](https://github.com/Tox3) |
718
+
717
719
 
718
720
  ## Special thanks
719
721
 
@@ -684,6 +684,8 @@ In addition to SRTM 30m, which provides global coverage, the map above highlight
684
684
  | 🇩🇰 Denmark | 0.4 meter | [kbrandwijk](https://github.com/kbrandwijk) |
685
685
  | 🇨🇭 Switzerland | 0.5-2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
686
686
  | 🇨🇿 Czech Republic | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
687
+ | 🇱🇹 Lithuania | 1 meter | [Tox3](https://github.com/Tox3) |
688
+
687
689
 
688
690
  ## Special thanks
689
691
 
@@ -5,4 +5,4 @@ import maps4fs.generator.settings as settings
5
5
  from maps4fs.generator.dtm.dtm import DTMProvider
6
6
  from maps4fs.generator.game import Game
7
7
  from maps4fs.generator.map import Map
8
- from maps4fs.logger import Logger
8
+ from maps4fs.logger import Logger
@@ -11,6 +11,7 @@ from maps4fs.generator.dtm.flanders import FlandersProvider
11
11
  from maps4fs.generator.dtm.france import FranceProvider
12
12
  from maps4fs.generator.dtm.hessen import HessenProvider
13
13
  from maps4fs.generator.dtm.italy import ItalyProvider
14
+ from maps4fs.generator.dtm.lithuania import LithuaniaProvider
14
15
  from maps4fs.generator.dtm.mv import MecklenburgVorpommernProvider
15
16
  from maps4fs.generator.dtm.niedersachsen import NiedersachsenProvider
16
17
  from maps4fs.generator.dtm.norway import NorwayProvider
@@ -249,10 +249,16 @@ class DTMProvider(ABC):
249
249
  return None
250
250
 
251
251
  @classmethod
252
- def get_valid_provider_descriptions(cls, lat_lon: tuple[float, float]) -> dict[str, str]:
252
+ def get_valid_provider_descriptions(
253
+ cls, lat_lon: tuple[float, float], default_code: str = "srtm30"
254
+ ) -> dict[str, str]:
253
255
  """Get descriptions of all providers, where keys are provider codes and
254
256
  values are provider descriptions.
255
257
 
258
+ Arguments:
259
+ lat_lon (tuple): Latitude and longitude of the center point.
260
+ default_code (str): Default provider code.
261
+
256
262
  Returns:
257
263
  dict: Provider descriptions.
258
264
  """
@@ -262,6 +268,10 @@ class DTMProvider(ABC):
262
268
  code = provider.code()
263
269
  if code is not None:
264
270
  providers[code] = provider.description()
271
+
272
+ # Sort the dictionary, to make sure that the default provider is the first one.
273
+ providers = dict(sorted(providers.items(), key=lambda item: item[0] != default_code))
274
+
265
275
  return providers
266
276
 
267
277
  @classmethod
@@ -0,0 +1,49 @@
1
+ """This module contains provider of Lithuania data."""
2
+
3
+ from typing import List
4
+ import requests
5
+ from maps4fs.generator.dtm.dtm import DTMProvider
6
+ from maps4fs.generator.dtm.utils import tile_bbox
7
+
8
+ class LithuaniaProvider(DTMProvider):
9
+ _code = "lithuania"
10
+ _name = "Lithuania"
11
+ _region = "LT"
12
+ _icon = "🇱🇹"
13
+ _resolution = 1.0
14
+ _author = "[Tox3](https://github.com/Tox3)"
15
+ _is_community = True
16
+ _is_base = False
17
+ _extents = (56.4501789128452, 53.8901567283941, 26.8198345671209, 20.9312456789123)
18
+ _max_tile_size = 4096
19
+ _url = "https://utility.arcgis.com/usrsvcs/servers/fef66dec83c14b0295180ecafa662aa0/rest/services/DTM_LT2020/ImageServer/exportImage"
20
+
21
+ def download_tiles(self) -> List[str]:
22
+ """Download DTM tiles for Lithuania."""
23
+ bbox = self.get_bbox()
24
+ grid_size = max(1, self.size // self._max_tile_size)
25
+ tile_size = (self.size / grid_size) / 111000 # Convert to degrees
26
+
27
+ raw_tiles = tile_bbox(bbox, tile_size)
28
+ # Fix coordinate swapping from utils.tile_bbox
29
+ tiles = [(t[1], t[3], t[0], t[2]) for t in raw_tiles] # Reorder N,S,E,W correctly
30
+
31
+ download_urls = []
32
+ for i, (north, south, east, west) in enumerate(tiles):
33
+ params = {
34
+ 'f': 'json',
35
+ 'bbox': f"{west},{south},{east},{north}",
36
+ 'bboxSR': '4326',
37
+ 'imageSR': '3346',
38
+ 'format': 'tiff',
39
+ 'pixelType': 'F32',
40
+ 'size': f"{self._max_tile_size},{self._max_tile_size}"
41
+ }
42
+
43
+ response = requests.get(self.url, params=params, verify=False, timeout=60)
44
+ data = response.json()
45
+ if 'href' not in data:
46
+ raise RuntimeError(f"No image URL in response for tile {i}")
47
+ download_urls.append(data['href'])
48
+
49
+ return self.download_tif_files(download_urls, self._tile_directory)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: maps4fs
3
- Version: 1.8.198
3
+ Version: 1.8.200
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
@@ -714,6 +714,8 @@ In addition to SRTM 30m, which provides global coverage, the map above highlight
714
714
  | 🇩🇰 Denmark | 0.4 meter | [kbrandwijk](https://github.com/kbrandwijk) |
715
715
  | 🇨🇭 Switzerland | 0.5-2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
716
716
  | 🇨🇿 Czech Republic | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
717
+ | 🇱🇹 Lithuania | 1 meter | [Tox3](https://github.com/Tox3) |
718
+
717
719
 
718
720
  ## Special thanks
719
721
 
@@ -41,6 +41,7 @@ maps4fs/generator/dtm/flanders.py
41
41
  maps4fs/generator/dtm/france.py
42
42
  maps4fs/generator/dtm/hessen.py
43
43
  maps4fs/generator/dtm/italy.py
44
+ maps4fs/generator/dtm/lithuania.py
44
45
  maps4fs/generator/dtm/mv.py
45
46
  maps4fs/generator/dtm/niedersachsen.py
46
47
  maps4fs/generator/dtm/norway.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maps4fs"
7
- version = "1.8.198"
7
+ version = "1.8.200"
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