maps4fs 1.8.198__py3-none-any.whl → 1.8.200__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.
Potentially problematic release.
This version of maps4fs might be problematic. Click here for more details.
- maps4fs/__init__.py +1 -1
- maps4fs/generator/dtm/__init__.py +1 -0
- maps4fs/generator/dtm/dtm.py +11 -1
- maps4fs/generator/dtm/lithuania.py +49 -0
- {maps4fs-1.8.198.dist-info → maps4fs-1.8.200.dist-info}/METADATA +3 -1
- {maps4fs-1.8.198.dist-info → maps4fs-1.8.200.dist-info}/RECORD +9 -8
- {maps4fs-1.8.198.dist-info → maps4fs-1.8.200.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.8.198.dist-info → maps4fs-1.8.200.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.198.dist-info → maps4fs-1.8.200.dist-info}/top_level.txt +0 -0
maps4fs/__init__.py
CHANGED
@@ -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
|
maps4fs/generator/dtm/dtm.py
CHANGED
@@ -249,10 +249,16 @@ class DTMProvider(ABC):
|
|
249
249
|
return None
|
250
250
|
|
251
251
|
@classmethod
|
252
|
-
def get_valid_provider_descriptions(
|
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.
|
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
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
maps4fs/__init__.py,sha256=
|
1
|
+
maps4fs/__init__.py,sha256=T91OJi-Bx5gJXuc1Z5Zb-_nb1iRynp8kH-XeHsfimnw,334
|
2
2
|
maps4fs/logger.py,sha256=HQrDyj72mUjVYo25aR_-_SxVn2rfFjDCNbj-JKJdSnE,1488
|
3
3
|
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
4
|
maps4fs/generator/dem.py,sha256=qHYkVtph5NXo2fRfRoYwKGzpnx-6-TIRg1rNg0EmtDU,11740
|
@@ -19,20 +19,21 @@ 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=
|
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
|
26
26
|
maps4fs/generator/dtm/canada.py,sha256=XJ_za2LDV9PEV7hmjPnzdwPbpr6ezAR73-HDVaTuKPk,1290
|
27
27
|
maps4fs/generator/dtm/czech.py,sha256=sT0gwbtEnizVNcZeL7kyDdwmKvB3w8m6UgJR7ZTk1to,1058
|
28
28
|
maps4fs/generator/dtm/denmark.py,sha256=JFuBRrCJTMXe_vdO3gRCwsnZ3nZOp_Y6671Kq8aXRGM,1591
|
29
|
-
maps4fs/generator/dtm/dtm.py,sha256=
|
29
|
+
maps4fs/generator/dtm/dtm.py,sha256=FOOI9_vl0KoF3EfLaLm2mvFWeOrjH2_d61VNM2NIjEg,17852
|
30
30
|
maps4fs/generator/dtm/england.py,sha256=3URUm7uLH_RYXcQdDW3Vt09GWKAE8RAy1ZFJB94kXOA,1124
|
31
31
|
maps4fs/generator/dtm/finland.py,sha256=VpXpvCgzbyKA6VGSa7ikSzE4B-cLfR1_2zOHvS8delc,1870
|
32
32
|
maps4fs/generator/dtm/flanders.py,sha256=LltmowbS84_DaBHAS9XYoJPMunX6sWGy6zaVACHj5Ro,1039
|
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=H_QT84E4ekJnPWzTWqTWqe8mQQerOqJRGPQqHxVZGKw,1957
|
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.
|
55
|
-
maps4fs-1.8.
|
56
|
-
maps4fs-1.8.
|
57
|
-
maps4fs-1.8.
|
58
|
-
maps4fs-1.8.
|
55
|
+
maps4fs-1.8.200.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
56
|
+
maps4fs-1.8.200.dist-info/METADATA,sha256=X94vCi9302l9DEltA8FHKwHEpcD_AMlrp9aLsHFHYqI,44999
|
57
|
+
maps4fs-1.8.200.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
58
|
+
maps4fs-1.8.200.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
59
|
+
maps4fs-1.8.200.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|