maps4fs 1.8.199__py3-none-any.whl → 1.8.201__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.
@@ -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
@@ -0,0 +1,64 @@
1
+ """This module contains provider of Lithuania data."""
2
+
3
+ from typing import List
4
+
5
+ import requests
6
+
7
+ from maps4fs.generator.dtm.dtm import DTMProvider
8
+ from maps4fs.generator.dtm.utils import tile_bbox
9
+
10
+
11
+ class LithuaniaProvider(DTMProvider):
12
+ """Provider of Lithuania data."""
13
+
14
+ _code = "lithuania"
15
+ _name = "Lithuania"
16
+ _region = "LT"
17
+ _icon = "🇱🇹"
18
+ _resolution = 1.0
19
+ _author = "[Tox3](https://github.com/Tox3)"
20
+ _is_community = True
21
+ _is_base = False
22
+ _extents = (
23
+ 56.4501789128452, # type: ignore
24
+ 53.8901567283941,
25
+ 26.8198345671209,
26
+ 20.9312456789123,
27
+ )
28
+ _max_tile_size = 4096
29
+ _url = (
30
+ "https://utility.arcgis.com/usrsvcs/servers/fef66dec83c14b0295180ecafa662aa0/"
31
+ "rest/services/DTM_LT2020/ImageServer/exportImage"
32
+ )
33
+
34
+ def download_tiles(self) -> List[str]:
35
+ """Download DTM tiles for Lithuania."""
36
+ bbox = self.get_bbox()
37
+ grid_size = max(1, self.size // self._max_tile_size)
38
+ tile_size = (self.size / grid_size) / 111000 # Convert to degrees
39
+
40
+ raw_tiles = tile_bbox(bbox, tile_size)
41
+ # Fix coordinate swapping from utils.tile_bbox
42
+ tiles = [(t[1], t[3], t[0], t[2]) for t in raw_tiles] # Reorder N,S,E,W correctly
43
+
44
+ download_urls = []
45
+ for i, (north, south, east, west) in enumerate(tiles):
46
+ params = {
47
+ "f": "json",
48
+ "bbox": f"{west},{south},{east},{north}",
49
+ "bboxSR": "4326",
50
+ "imageSR": "3346",
51
+ "format": "tiff",
52
+ "pixelType": "F32",
53
+ "size": f"{self._max_tile_size},{self._max_tile_size}",
54
+ }
55
+
56
+ response = requests.get(
57
+ self.url, params=params, verify=False, timeout=60 # type: ignore
58
+ )
59
+ data = response.json()
60
+ if "href" not in data:
61
+ raise RuntimeError(f"No image URL in response for tile {i}")
62
+ download_urls.append(data["href"])
63
+
64
+ 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.199
3
+ Version: 1.8.201
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
 
@@ -19,7 +19,7 @@ maps4fs/generator/component/base/component.py,sha256=apGuQ7TcwqL0neJZiciNLGO22wZ
19
19
  maps4fs/generator/component/base/component_image.py,sha256=2QnJ9xm0D54v4whg7bc1s-kwRVjZHhOo1OR5jHr1Qp0,4786
20
20
  maps4fs/generator/component/base/component_mesh.py,sha256=zx6TElBBMxo-D5AxqAYemtvkl2k4hHThf0OH7LgNRMY,9159
21
21
  maps4fs/generator/component/base/component_xml.py,sha256=6OO1dKoceO1ACk7-k1oGtnkfNud8ZN3u3ZNjdNMpTqw,3967
22
- maps4fs/generator/dtm/__init__.py,sha256=hzKESJm2QhIQnPKxTYCFohpvRWOmLfXZfEnrMbntp1s,1392
22
+ maps4fs/generator/dtm/__init__.py,sha256=VIWcZiMZ0UtnJl7rQL-PVHDivXbZVwrBWumjhTTnnKY,1454
23
23
  maps4fs/generator/dtm/arctic.py,sha256=LSivLLjtd6TJUaPYvgSYQ4KalMTaY58zFvwivSh45uM,2587
24
24
  maps4fs/generator/dtm/baden.py,sha256=PQTMEPm9hrO3nKbv_DXA9oNYnGK_0ei41Q_DhtethX0,1041
25
25
  maps4fs/generator/dtm/bavaria.py,sha256=nH2wTxiIdQgKotauTqD-zztwFgfZzIdym2sjmSqfujM,4295
@@ -33,6 +33,7 @@ maps4fs/generator/dtm/flanders.py,sha256=LltmowbS84_DaBHAS9XYoJPMunX6sWGy6zaVACH
33
33
  maps4fs/generator/dtm/france.py,sha256=nk7MBJujBWJJzzy_pE5WsdyBCH16OQ5bnz4MsK-MVIQ,2654
34
34
  maps4fs/generator/dtm/hessen.py,sha256=DtKBGvahM9fHq5h07M2n6N5X1G5CLDau4HMEe_2LqvY,966
35
35
  maps4fs/generator/dtm/italy.py,sha256=mMzFtaxQYLF2rEeqX8k9R_LEmTWACFjPXRDY7wjv2Pk,1224
36
+ maps4fs/generator/dtm/lithuania.py,sha256=JVp90PU9vYDCTDzh5Xf-g3Hn-MmGIbkIAc8f-X6QQ0M,2101
36
37
  maps4fs/generator/dtm/mv.py,sha256=mpJhu2eDPDdI2J3xaegL6x58WWiiwPVFDOuSLEp_b5I,1364
37
38
  maps4fs/generator/dtm/niedersachsen.py,sha256=XP1As-XMKS3Xmx0Mz1_8kxEQqGoGF3KKlrIpm_5VGYo,1275
38
39
  maps4fs/generator/dtm/norway.py,sha256=PzYFJOx3Y6tuhir2Hy8BDSoI9FzQu01__dEzWrQXM1g,1285
@@ -51,8 +52,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
51
52
  maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
52
53
  maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
53
54
  maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
54
- maps4fs-1.8.199.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
55
- maps4fs-1.8.199.dist-info/METADATA,sha256=C6odRfeNlXWxxVObXCeR4W0aJ_DNHjnhsOySqQJ7M2E,44904
56
- maps4fs-1.8.199.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
57
- maps4fs-1.8.199.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
58
- maps4fs-1.8.199.dist-info/RECORD,,
55
+ maps4fs-1.8.201.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
56
+ maps4fs-1.8.201.dist-info/METADATA,sha256=qRzWyJ96VRWOaGy_OTNBiCn1RwRuvdSKKduKQbnB17c,44999
57
+ maps4fs-1.8.201.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
58
+ maps4fs-1.8.201.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
59
+ maps4fs-1.8.201.dist-info/RECORD,,