maps4fs 1.8.200__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.
- maps4fs/__init__.py +1 -1
- maps4fs/generator/dtm/lithuania.py +31 -16
- {maps4fs-1.8.200.dist-info → maps4fs-1.8.201.dist-info}/METADATA +1 -1
- {maps4fs-1.8.200.dist-info → maps4fs-1.8.201.dist-info}/RECORD +7 -7
- {maps4fs-1.8.200.dist-info → maps4fs-1.8.201.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.8.200.dist-info → maps4fs-1.8.201.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.200.dist-info → maps4fs-1.8.201.dist-info}/top_level.txt +0 -0
maps4fs/__init__.py
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
"""This module contains provider of Lithuania data."""
|
2
2
|
|
3
3
|
from typing import List
|
4
|
+
|
4
5
|
import requests
|
6
|
+
|
5
7
|
from maps4fs.generator.dtm.dtm import DTMProvider
|
6
8
|
from maps4fs.generator.dtm.utils import tile_bbox
|
7
9
|
|
10
|
+
|
8
11
|
class LithuaniaProvider(DTMProvider):
|
12
|
+
"""Provider of Lithuania data."""
|
13
|
+
|
9
14
|
_code = "lithuania"
|
10
15
|
_name = "Lithuania"
|
11
16
|
_region = "LT"
|
@@ -14,36 +19,46 @@ class LithuaniaProvider(DTMProvider):
|
|
14
19
|
_author = "[Tox3](https://github.com/Tox3)"
|
15
20
|
_is_community = True
|
16
21
|
_is_base = False
|
17
|
-
_extents = (
|
22
|
+
_extents = (
|
23
|
+
56.4501789128452, # type: ignore
|
24
|
+
53.8901567283941,
|
25
|
+
26.8198345671209,
|
26
|
+
20.9312456789123,
|
27
|
+
)
|
18
28
|
_max_tile_size = 4096
|
19
|
-
_url =
|
29
|
+
_url = (
|
30
|
+
"https://utility.arcgis.com/usrsvcs/servers/fef66dec83c14b0295180ecafa662aa0/"
|
31
|
+
"rest/services/DTM_LT2020/ImageServer/exportImage"
|
32
|
+
)
|
20
33
|
|
21
34
|
def download_tiles(self) -> List[str]:
|
22
35
|
"""Download DTM tiles for Lithuania."""
|
23
36
|
bbox = self.get_bbox()
|
24
37
|
grid_size = max(1, self.size // self._max_tile_size)
|
25
38
|
tile_size = (self.size / grid_size) / 111000 # Convert to degrees
|
26
|
-
|
39
|
+
|
27
40
|
raw_tiles = tile_bbox(bbox, tile_size)
|
28
41
|
# Fix coordinate swapping from utils.tile_bbox
|
29
42
|
tiles = [(t[1], t[3], t[0], t[2]) for t in raw_tiles] # Reorder N,S,E,W correctly
|
30
|
-
|
43
|
+
|
31
44
|
download_urls = []
|
32
45
|
for i, (north, south, east, west) in enumerate(tiles):
|
33
46
|
params = {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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}",
|
41
54
|
}
|
42
|
-
|
43
|
-
response = requests.get(
|
55
|
+
|
56
|
+
response = requests.get(
|
57
|
+
self.url, params=params, verify=False, timeout=60 # type: ignore
|
58
|
+
)
|
44
59
|
data = response.json()
|
45
|
-
if
|
60
|
+
if "href" not in data:
|
46
61
|
raise RuntimeError(f"No image URL in response for tile {i}")
|
47
|
-
download_urls.append(data[
|
62
|
+
download_urls.append(data["href"])
|
48
63
|
|
49
|
-
return self.download_tif_files(download_urls, self._tile_directory)
|
64
|
+
return self.download_tif_files(download_urls, self._tile_directory)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
maps4fs/__init__.py,sha256=
|
1
|
+
maps4fs/__init__.py,sha256=EGvLVoRpSt4jITswsGbe1ISVmGAZAMQJcBmTwtyuVxI,335
|
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
|
@@ -33,7 +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=
|
36
|
+
maps4fs/generator/dtm/lithuania.py,sha256=JVp90PU9vYDCTDzh5Xf-g3Hn-MmGIbkIAc8f-X6QQ0M,2101
|
37
37
|
maps4fs/generator/dtm/mv.py,sha256=mpJhu2eDPDdI2J3xaegL6x58WWiiwPVFDOuSLEp_b5I,1364
|
38
38
|
maps4fs/generator/dtm/niedersachsen.py,sha256=XP1As-XMKS3Xmx0Mz1_8kxEQqGoGF3KKlrIpm_5VGYo,1275
|
39
39
|
maps4fs/generator/dtm/norway.py,sha256=PzYFJOx3Y6tuhir2Hy8BDSoI9FzQu01__dEzWrQXM1g,1285
|
@@ -52,8 +52,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
|
|
52
52
|
maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
|
53
53
|
maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
|
54
54
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
55
|
-
maps4fs-1.8.
|
56
|
-
maps4fs-1.8.
|
57
|
-
maps4fs-1.8.
|
58
|
-
maps4fs-1.8.
|
59
|
-
maps4fs-1.8.
|
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,,
|
File without changes
|
File without changes
|
File without changes
|