maps4fs 1.8.190__tar.gz → 1.8.191__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.190 → maps4fs-1.8.191}/PKG-INFO +1 -1
  2. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/__init__.py +1 -1
  3. maps4fs-1.8.191/maps4fs/generator/dtm/usgs_wcs.py +35 -0
  4. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs.egg-info/PKG-INFO +1 -1
  5. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs.egg-info/SOURCES.txt +1 -1
  6. {maps4fs-1.8.190 → maps4fs-1.8.191}/pyproject.toml +1 -1
  7. maps4fs-1.8.190/maps4fs/generator/dtm/usgs.py +0 -90
  8. {maps4fs-1.8.190 → maps4fs-1.8.191}/LICENSE.md +0 -0
  9. {maps4fs-1.8.190 → maps4fs-1.8.191}/README.md +0 -0
  10. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/__init__.py +0 -0
  11. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/__init__.py +0 -0
  12. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/background.py +0 -0
  13. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/base/__init__.py +0 -0
  14. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/base/component.py +0 -0
  15. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/base/component_image.py +0 -0
  16. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/base/component_mesh.py +0 -0
  17. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/base/component_xml.py +0 -0
  18. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/config.py +0 -0
  19. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/grle.py +0 -0
  20. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/i3d.py +0 -0
  21. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/layer.py +0 -0
  22. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/satellite.py +0 -0
  23. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/component/texture.py +0 -0
  24. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dem.py +0 -0
  25. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/__init__.py +0 -0
  26. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/arctic.py +0 -0
  27. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/baden.py +0 -0
  28. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/base/wcs.py +0 -0
  29. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/base/wms.py +0 -0
  30. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/bavaria.py +0 -0
  31. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/canada.py +0 -0
  32. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/czech.py +0 -0
  33. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/denmark.py +0 -0
  34. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/dtm.py +0 -0
  35. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/england.py +0 -0
  36. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/finland.py +0 -0
  37. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/flanders.py +0 -0
  38. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/france.py +0 -0
  39. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/hessen.py +0 -0
  40. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/italy.py +0 -0
  41. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/mv.py +0 -0
  42. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/niedersachsen.py +0 -0
  43. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/norway.py +0 -0
  44. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/nrw.py +0 -0
  45. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/rema.py +0 -0
  46. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/sachsenanhalt.py +0 -0
  47. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/scotland.py +0 -0
  48. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/spain.py +0 -0
  49. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/srtm.py +0 -0
  50. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/switzerland.py +0 -0
  51. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/dtm/utils.py +0 -0
  52. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/game.py +0 -0
  53. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/map.py +0 -0
  54. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/qgis.py +0 -0
  55. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/generator/settings.py +0 -0
  56. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/logger.py +0 -0
  57. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/toolbox/__init__.py +0 -0
  58. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/toolbox/background.py +0 -0
  59. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/toolbox/custom_osm.py +0 -0
  60. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs/toolbox/dem.py +0 -0
  61. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs.egg-info/dependency_links.txt +0 -0
  62. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs.egg-info/requires.txt +0 -0
  63. {maps4fs-1.8.190 → maps4fs-1.8.191}/maps4fs.egg-info/top_level.txt +0 -0
  64. {maps4fs-1.8.190 → maps4fs-1.8.191}/setup.cfg +0 -0
  65. {maps4fs-1.8.190 → maps4fs-1.8.191}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: maps4fs
3
- Version: 1.8.190
3
+ Version: 1.8.191
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
@@ -1,7 +1,7 @@
1
1
  # pylint: disable=missing-module-docstring
2
2
  from maps4fs.generator.dtm.dtm import DTMProvider
3
3
  from maps4fs.generator.dtm.srtm import SRTM30Provider, SRTM30ProviderSettings
4
- from maps4fs.generator.dtm.usgs import USGSProvider, USGSProviderSettings
4
+ from maps4fs.generator.dtm.usgs_wcs import USGSWCSProvider
5
5
  from maps4fs.generator.dtm.nrw import NRWProvider
6
6
  from maps4fs.generator.dtm.bavaria import BavariaProvider
7
7
  from maps4fs.generator.dtm.niedersachsen import NiedersachsenProvider
@@ -0,0 +1,35 @@
1
+ """This module contains provider of USGS data."""
2
+
3
+ from maps4fs.generator.dtm.base.wcs import WCSProvider
4
+ from maps4fs.generator.dtm.dtm import DTMProvider
5
+
6
+
7
+ class USGSWCSProvider(WCSProvider, DTMProvider):
8
+ """Provider of USGS data."""
9
+
10
+ _code = "usgs_wcs"
11
+ _name = "USGS"
12
+ _region = "USA"
13
+ _icon = "🇺🇸"
14
+ _resolution = "1-90"
15
+ _author = "[kbrandwijk](https://github.com/kbrandwijk)"
16
+ _is_community = True
17
+ _instructions = None
18
+ _is_base = False
19
+ _extents = (50.0, 17.0, -64.0, -162.0)
20
+
21
+ _url = "https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WCSServer"
22
+ _wcs_version = "1.0.0"
23
+ _source_crs = "EPSG:3857"
24
+ _tile_size = 1000
25
+ _is_multipart = False
26
+
27
+ def get_wcs_parameters(self, tile):
28
+ return {
29
+ "identifier": "DEP3Elevation",
30
+ "bbox": (tile[1], tile[0], tile[3], tile[2]),
31
+ "crs": "EPSG:3857",
32
+ "width": 1000,
33
+ "height": 1000,
34
+ "format": "GeoTIFF",
35
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: maps4fs
3
- Version: 1.8.190
3
+ Version: 1.8.191
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
@@ -51,7 +51,7 @@ maps4fs/generator/dtm/scotland.py
51
51
  maps4fs/generator/dtm/spain.py
52
52
  maps4fs/generator/dtm/srtm.py
53
53
  maps4fs/generator/dtm/switzerland.py
54
- maps4fs/generator/dtm/usgs.py
54
+ maps4fs/generator/dtm/usgs_wcs.py
55
55
  maps4fs/generator/dtm/utils.py
56
56
  maps4fs/generator/dtm/base/wcs.py
57
57
  maps4fs/generator/dtm/base/wms.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maps4fs"
7
- version = "1.8.190"
7
+ version = "1.8.191"
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"}
@@ -1,90 +0,0 @@
1
- """This module contains provider of USGS data."""
2
-
3
- import os
4
- from datetime import datetime
5
-
6
- import numpy as np
7
- import requests
8
-
9
- from maps4fs.generator.dtm.dtm import DTMProvider, DTMProviderSettings
10
-
11
-
12
- class USGSProviderSettings(DTMProviderSettings):
13
- """Settings for the USGS provider."""
14
-
15
- dataset: tuple | str = (
16
- "Digital Elevation Model (DEM) 1 meter",
17
- "Alaska IFSAR 5 meter DEM",
18
- "National Elevation Dataset (NED) 1/9 arc-second",
19
- "National Elevation Dataset (NED) 1/3 arc-second",
20
- "National Elevation Dataset (NED) 1 arc-second",
21
- "National Elevation Dataset (NED) Alaska 2 arc-second",
22
- "Original Product Resolution (OPR) Digital Elevation Model (DEM)",
23
- )
24
-
25
-
26
- class USGSProvider(DTMProvider):
27
- """Provider of USGS."""
28
-
29
- _code = "USGS"
30
- _name = "USGS"
31
- _region = "USA"
32
- _icon = "🇺🇸"
33
- _resolution = "variable"
34
- _data: np.ndarray | None = None
35
- _settings = USGSProviderSettings
36
- _author = "[ZenJakey](https://github.com/ZenJakey)"
37
- _contributors = "[kbrandwijk](https://github.com/kbrandwijk)"
38
- _is_community = True
39
- _instructions = None
40
- _extents = (50.0, 17.0, -64.0, -162.0)
41
-
42
- _url = "https://tnmaccess.nationalmap.gov/api/v1/products?prodFormats=GeoTIFF,IMG"
43
-
44
- def download_tiles(self):
45
- download_urls = self.get_download_urls()
46
- all_tif_files = self.download_tif_files(download_urls, self.shared_tiff_path)
47
- return all_tif_files
48
-
49
- def __init__(self, *args, **kwargs):
50
- super().__init__(*args, **kwargs)
51
- timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
52
- self.shared_tiff_path = os.path.join(self._tile_directory, "shared")
53
- os.makedirs(self.shared_tiff_path, exist_ok=True)
54
- self.output_path = os.path.join(self._tile_directory, f"timestamp_{timestamp}")
55
- os.makedirs(self.output_path, exist_ok=True)
56
-
57
- def get_download_urls(self) -> list[str]:
58
- """Get download URLs of the GeoTIFF files from the USGS API.
59
-
60
- Returns:
61
- list: List of download URLs.
62
- """
63
- assert self.url is not None
64
-
65
- urls = []
66
- try:
67
- # Make the GET request
68
- (north, south, east, west) = self.get_bbox()
69
- response = requests.get(
70
- self.url
71
- + f"&datasets={self.user_settings.dataset}" # type: ignore
72
- + f"&bbox={west},{north},{east},{south}",
73
- timeout=60,
74
- )
75
- self.logger.debug("Getting file locations from USGS...")
76
-
77
- # Check if the request was successful (HTTP status code 200)
78
- if response.status_code == 200:
79
- # Parse the JSON response
80
- json_data = response.json()
81
- items = json_data["items"]
82
- for item in items:
83
- urls.append(item["downloadURL"])
84
- # self.download_tif_files(urls)
85
- else:
86
- self.logger.error("Failed to get data. HTTP Status Code: %s", response.status_code)
87
- except requests.exceptions.RequestException as e:
88
- self.logger.error("Failed to get data. Error: %s", e)
89
- self.logger.debug("Received %s urls", len(urls))
90
- return urls
File without changes
File without changes
File without changes
File without changes