maps4fs 1.8.175__py3-none-any.whl → 1.8.177__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 -0
- maps4fs/generator/component/i3d.py +3 -7
- maps4fs/generator/dtm/denmark.py +47 -0
- maps4fs/generator/dtm/dtm.py +6 -2
- maps4fs/generator/map.py +11 -14
- maps4fs/logger.py +1 -1
- {maps4fs-1.8.175.dist-info → maps4fs-1.8.177.dist-info}/METADATA +22 -8
- {maps4fs-1.8.175.dist-info → maps4fs-1.8.177.dist-info}/RECORD +11 -10
- {maps4fs-1.8.175.dist-info → maps4fs-1.8.177.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.8.175.dist-info → maps4fs-1.8.177.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.175.dist-info → maps4fs-1.8.177.dist-info}/top_level.txt +0 -0
maps4fs/__init__.py
CHANGED
@@ -15,6 +15,7 @@ from maps4fs.generator.dtm.flanders import FlandersProvider
|
|
15
15
|
from maps4fs.generator.dtm.spain import SpainProvider
|
16
16
|
from maps4fs.generator.dtm.france import FranceProvider
|
17
17
|
from maps4fs.generator.dtm.norway import NorwayProvider
|
18
|
+
from maps4fs.generator.dtm.denmark import DenmarkProvider
|
18
19
|
from maps4fs.generator.game import Game
|
19
20
|
from maps4fs.generator.map import Map
|
20
21
|
from maps4fs.generator.settings import (
|
@@ -15,8 +15,6 @@ from tqdm import tqdm
|
|
15
15
|
from maps4fs.generator.component.base.component_xml import XMLComponent
|
16
16
|
from maps4fs.generator.settings import Parameters
|
17
17
|
|
18
|
-
MAP_SIZE_LIMIT_FOR_DISPLACEMENT_LAYER = 4096
|
19
|
-
DISPLACEMENT_LAYER_SIZE_FOR_BIG_MAPS = 32768
|
20
18
|
NODE_ID_STARTING_VALUE = 2000
|
21
19
|
SPLINES_NODE_ID_STARTING_VALUE = 5000
|
22
20
|
TREE_NODE_ID_STARTING_VALUE = 10000
|
@@ -103,11 +101,9 @@ class I3d(XMLComponent):
|
|
103
101
|
|
104
102
|
self.get_and_update_element(root, sun_element_path, data)
|
105
103
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
self.get_and_update_element(root, displacement_layer_path, data)
|
104
|
+
displacement_layer_path = ".//Scene/TerrainTransformGroup/Layers/DisplacementLayer"
|
105
|
+
data = {"size": str(int(self.map_size * 8))}
|
106
|
+
self.get_and_update_element(root, displacement_layer_path, data)
|
111
107
|
|
112
108
|
self.save_tree(tree)
|
113
109
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"""This module contains provider of Denmark data."""
|
2
|
+
|
3
|
+
from maps4fs.generator.dtm.base.wcs import WCSProvider
|
4
|
+
from maps4fs.generator.dtm.dtm import DTMProvider, DTMProviderSettings
|
5
|
+
|
6
|
+
|
7
|
+
class DenmarkProviderSettings(DTMProviderSettings):
|
8
|
+
"""Settings for the Denmark provider."""
|
9
|
+
|
10
|
+
token: str = ""
|
11
|
+
|
12
|
+
|
13
|
+
class DenmarkProvider(WCSProvider, DTMProvider):
|
14
|
+
"""Provider of Denmark data."""
|
15
|
+
|
16
|
+
_code = "denmark"
|
17
|
+
_name = "Denmark"
|
18
|
+
_region = "DK"
|
19
|
+
_icon = "🇩🇰"
|
20
|
+
_resolution = 0.4
|
21
|
+
_author = "[kbrandwijk](https://github.com/kbrandwijk)"
|
22
|
+
_is_community = True
|
23
|
+
_is_base = False
|
24
|
+
_settings = DenmarkProviderSettings
|
25
|
+
_extents = (57.7690657013977, 54.4354651516217, 15.5979112056959, 8.00830949937517)
|
26
|
+
|
27
|
+
_instructions = (
|
28
|
+
"ℹ️ This provider requires an access token. See [here](https://confluence"
|
29
|
+
".sdfi.dk/display/MYD/How+to+create+a+user) for more information on "
|
30
|
+
"how to create one, then enter it below in the settings field for token."
|
31
|
+
)
|
32
|
+
|
33
|
+
_url = "https://api.dataforsyningen.dk/dhm_wcs_DAF"
|
34
|
+
_wcs_version = "1.0.0"
|
35
|
+
_source_crs = "EPSG:25832"
|
36
|
+
_tile_size = 1000
|
37
|
+
|
38
|
+
def get_wcs_parameters(self, tile):
|
39
|
+
return {
|
40
|
+
"identifier": "dhm_terraen",
|
41
|
+
"bbox": (tile[1], tile[0], tile[3], tile[2]),
|
42
|
+
"crs": "EPSG:25832",
|
43
|
+
"width": 2500,
|
44
|
+
"height": 2500,
|
45
|
+
"format": "GTiff",
|
46
|
+
"token": self.user_settings.token,
|
47
|
+
}
|
maps4fs/generator/dtm/dtm.py
CHANGED
@@ -12,14 +12,13 @@ from zipfile import ZipFile
|
|
12
12
|
import numpy as np
|
13
13
|
import osmnx as ox # type: ignore
|
14
14
|
import rasterio # type: ignore
|
15
|
+
import requests
|
15
16
|
from pydantic import BaseModel
|
16
17
|
from rasterio.enums import Resampling
|
17
18
|
from rasterio.merge import merge
|
18
19
|
from rasterio.warp import calculate_default_transform, reproject
|
19
|
-
import requests
|
20
20
|
from tqdm import tqdm
|
21
21
|
|
22
|
-
|
23
22
|
from maps4fs.logger import Logger
|
24
23
|
|
25
24
|
if TYPE_CHECKING:
|
@@ -79,6 +78,11 @@ class DTMProvider(ABC):
|
|
79
78
|
|
80
79
|
self._data_info: dict[str, int | str | float] | None = None
|
81
80
|
|
81
|
+
@classmethod
|
82
|
+
def name(cls) -> str | None:
|
83
|
+
"""Name of the provider."""
|
84
|
+
return cls._name
|
85
|
+
|
82
86
|
@property
|
83
87
|
def data_info(self) -> dict[str, int | str | float] | None:
|
84
88
|
"""Information about the DTM data.
|
maps4fs/generator/map.py
CHANGED
@@ -77,10 +77,12 @@ class Map:
|
|
77
77
|
self.coordinates = coordinates
|
78
78
|
self.map_directory = map_directory
|
79
79
|
|
80
|
-
|
80
|
+
log_entry = ""
|
81
|
+
log_entry += f"Game was set to {game.code}. "
|
82
|
+
log_entry += f"DTM provider was set to {dtm_provider.name()}. "
|
81
83
|
|
82
84
|
self.custom_osm = custom_osm
|
83
|
-
|
85
|
+
log_entry += f"Custom OSM file: {custom_osm}. "
|
84
86
|
|
85
87
|
# Make a copy of a custom osm file to the map directory, so it will be
|
86
88
|
# included in the output archive.
|
@@ -90,30 +92,26 @@ class Map:
|
|
90
92
|
self.logger.debug("Custom OSM file copied to %s", copy_path)
|
91
93
|
|
92
94
|
self.dem_settings = dem_settings
|
93
|
-
|
95
|
+
log_entry += f"DEM settings: {dem_settings}. "
|
94
96
|
if self.dem_settings.water_depth > 0:
|
95
97
|
# Make sure that the plateau value is >= water_depth
|
96
98
|
self.dem_settings.plateau = max(
|
97
99
|
self.dem_settings.plateau, self.dem_settings.water_depth
|
98
100
|
)
|
99
|
-
self.logger.info(
|
100
|
-
"Plateau value was set to %s to be >= water_depth value %s",
|
101
|
-
self.dem_settings.plateau,
|
102
|
-
self.dem_settings.water_depth,
|
103
|
-
)
|
104
101
|
|
105
102
|
self.background_settings = background_settings
|
106
|
-
|
103
|
+
log_entry += f"Background settings: {background_settings}. "
|
107
104
|
self.grle_settings = grle_settings
|
108
|
-
|
105
|
+
log_entry += f"GRLE settings: {grle_settings}. "
|
109
106
|
self.i3d_settings = i3d_settings
|
110
|
-
|
107
|
+
log_entry += f"I3D settings: {i3d_settings}. "
|
111
108
|
self.texture_settings = texture_settings
|
112
|
-
|
109
|
+
log_entry += f"Texture settings: {texture_settings}. "
|
113
110
|
self.spline_settings = spline_settings
|
114
|
-
|
111
|
+
log_entry += f"Spline settings: {spline_settings}. "
|
115
112
|
self.satellite_settings = satellite_settings
|
116
113
|
|
114
|
+
self.logger.info(log_entry)
|
117
115
|
os.makedirs(self.map_directory, exist_ok=True)
|
118
116
|
self.logger.debug("Map directory created: %s", self.map_directory)
|
119
117
|
|
@@ -148,7 +146,6 @@ class Map:
|
|
148
146
|
|
149
147
|
self.tree_custom_schema = kwargs.get("tree_custom_schema", None)
|
150
148
|
if self.tree_custom_schema:
|
151
|
-
self.logger.info("Custom tree schema contains %s trees", len(self.tree_custom_schema))
|
152
149
|
save_path = os.path.join(self.map_directory, "tree_custom_schema.json")
|
153
150
|
with open(save_path, "w", encoding="utf-8") as file:
|
154
151
|
json.dump(self.tree_custom_schema, file, indent=4)
|
maps4fs/logger.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.177
|
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
|
@@ -682,13 +682,27 @@ The generator supports adding the own DTM providers, please refer to the [DTM Pr
|
|
682
682
|
|
683
683
|
### Supported DTM providers
|
684
684
|
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
685
|
+

|
686
|
+
|
687
|
+
In addition to SRTM 30m, which provides global coverage, the map above highlights all countries and/or regions where higher resolution coverage is provided by one of the DTM providers.
|
688
|
+
|
689
|
+
| Provider Name | Resolution | Developer |
|
690
|
+
| ------------------------------- | ------------ | ------------------------------------------- |
|
691
|
+
| 🌎 SRTM30 | 30 meters | [iwatkot](https://github.com/iwatkot) |
|
692
|
+
| 🇺🇸 USGS | 1-90 meters | [ZenJakey](https://github.com/ZenJakey) |
|
693
|
+
| 🏴 England | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
694
|
+
| 🏴 Scotland | 0.25-1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
695
|
+
| 🇩🇪 Hessen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
696
|
+
| 🇩🇪 Niedersachsen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
697
|
+
| 🇩🇪 Bayern, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
|
698
|
+
| 🇩🇪 Nordrhein-Westfalen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
699
|
+
| 🇨🇦 Canada | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
700
|
+
| 🇧🇪 Flanders, Belgium | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
701
|
+
| 🇫🇷 France | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
702
|
+
| 🇮🇹 Italy | 10 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
703
|
+
| 🇳🇴 Norway | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
704
|
+
| 🇪🇸 Spain | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
705
|
+
| 🇫🇮 Finland | 2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
|
692
706
|
|
693
707
|
## Special thanks
|
694
708
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
maps4fs/__init__.py,sha256=
|
2
|
-
maps4fs/logger.py,sha256=
|
1
|
+
maps4fs/__init__.py,sha256=Jq1Zp0vSkv-beVXfebt_0ELxlrV3ZJX4cT4oaCFda_0,1365
|
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=oLN02bWNax73HzFsseRBOV47Azl_1L7qdrzuxHh4i_c,11886
|
5
5
|
maps4fs/generator/game.py,sha256=FFAyckuTW6Ix5aRACXOj2eiA72xd3OMCcOARrMhS164,11025
|
6
|
-
maps4fs/generator/map.py,sha256=
|
6
|
+
maps4fs/generator/map.py,sha256=N3lSIEmGQXSrOYXochHEib5djmxL5szFM2crT31Nwog,11312
|
7
7
|
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
8
8
|
maps4fs/generator/settings.py,sha256=cFlN-gK8QcySqyPtcGm-2fLnxQnlmC3Y9kQufJxwI3Y,6270
|
9
9
|
maps4fs/generator/texture.py,sha256=_IfqIuxH4934VJXKtdABHa6ToPWk3T0xknvlu-rZ5Uc,36570
|
@@ -11,7 +11,7 @@ maps4fs/generator/component/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2
|
|
11
11
|
maps4fs/generator/component/background.py,sha256=cBBp-ULrJzuNG9wfE_MaxzAn_mR24neqtL7WjxXEb3I,18749
|
12
12
|
maps4fs/generator/component/config.py,sha256=RitKgFDZPzjA1fi8GcEi1na75qqaueUvpcITHjBvCXc,3674
|
13
13
|
maps4fs/generator/component/grle.py,sha256=aKMjVJNuKHJJ2gsXaH00bz10kWaIbbZXU_JbP-ZAGw4,18990
|
14
|
-
maps4fs/generator/component/i3d.py,sha256=
|
14
|
+
maps4fs/generator/component/i3d.py,sha256=z2ZkflA5E8FrHcGleXSVKZRWvkqclz_Yh_qxJI86enE,19685
|
15
15
|
maps4fs/generator/component/satellite.py,sha256=oZBHjP_QY0ik1-Vk7JqMS__zIG8ffw2voeozB7-HUQc,4946
|
16
16
|
maps4fs/generator/component/base/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
17
17
|
maps4fs/generator/component/base/component.py,sha256=apGuQ7TcwqL0neJZiciNLGO22wZwYyqoDZM7aI1RHw8,21273
|
@@ -21,7 +21,8 @@ maps4fs/generator/component/base/component_xml.py,sha256=6OO1dKoceO1ACk7-k1oGtnk
|
|
21
21
|
maps4fs/generator/dtm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
maps4fs/generator/dtm/bavaria.py,sha256=7njrEvSCYAC8ZVyvS-_84iXHhWA0oHKrEqSzxdnZuGs,4293
|
23
23
|
maps4fs/generator/dtm/canada.py,sha256=lYONwm6aNX5cjVggR3AiZZF9dlCDAWg0M8RMaObog8s,1288
|
24
|
-
maps4fs/generator/dtm/
|
24
|
+
maps4fs/generator/dtm/denmark.py,sha256=GMB9PPxXth6V1v3XuURVWVabJf4xlr158bKfeIIisek,1476
|
25
|
+
maps4fs/generator/dtm/dtm.py,sha256=vZh3Z5grfQy0gvo-xAgXwkWExk1kW1pGVw2nk54hN-8,16983
|
25
26
|
maps4fs/generator/dtm/england.py,sha256=YyCYwnNUJuBeeMNUozfKIj_yNjHpGeuH1Mz0NiAJL-U,1122
|
26
27
|
maps4fs/generator/dtm/finland.py,sha256=Chi3-3sanLIYpipjtPpTu9tqnL3DYcnygSDCPm1s24c,1753
|
27
28
|
maps4fs/generator/dtm/flanders.py,sha256=81pKkrM40SeOe1LSlcsTNXSmUNpofC4D454DG6WFSyA,1037
|
@@ -42,8 +43,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
|
|
42
43
|
maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
|
43
44
|
maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
|
44
45
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
45
|
-
maps4fs-1.8.
|
46
|
-
maps4fs-1.8.
|
47
|
-
maps4fs-1.8.
|
48
|
-
maps4fs-1.8.
|
49
|
-
maps4fs-1.8.
|
46
|
+
maps4fs-1.8.177.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
47
|
+
maps4fs-1.8.177.dist-info/METADATA,sha256=WtSUt8A9aunNM9Guy-u76Nbi1eVnlBXBl7YzKBRSmAA,44023
|
48
|
+
maps4fs-1.8.177.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
49
|
+
maps4fs-1.8.177.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
50
|
+
maps4fs-1.8.177.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|