maps4fs 1.8.176__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/generator/component/i3d.py +3 -7
- maps4fs/generator/dtm/dtm.py +6 -2
- maps4fs/generator/map.py +11 -14
- maps4fs/logger.py +1 -1
- {maps4fs-1.8.176.dist-info → maps4fs-1.8.177.dist-info}/METADATA +1 -1
- {maps4fs-1.8.176.dist-info → maps4fs-1.8.177.dist-info}/RECORD +9 -9
- {maps4fs-1.8.176.dist-info → maps4fs-1.8.177.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.8.176.dist-info → maps4fs-1.8.177.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.176.dist-info → maps4fs-1.8.177.dist-info}/top_level.txt +0 -0
@@ -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
|
|
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,9 +1,9 @@
|
|
1
1
|
maps4fs/__init__.py,sha256=Jq1Zp0vSkv-beVXfebt_0ELxlrV3ZJX4cT4oaCFda_0,1365
|
2
|
-
maps4fs/logger.py,sha256=
|
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
|
@@ -22,7 +22,7 @@ maps4fs/generator/dtm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
22
22
|
maps4fs/generator/dtm/bavaria.py,sha256=7njrEvSCYAC8ZVyvS-_84iXHhWA0oHKrEqSzxdnZuGs,4293
|
23
23
|
maps4fs/generator/dtm/canada.py,sha256=lYONwm6aNX5cjVggR3AiZZF9dlCDAWg0M8RMaObog8s,1288
|
24
24
|
maps4fs/generator/dtm/denmark.py,sha256=GMB9PPxXth6V1v3XuURVWVabJf4xlr158bKfeIIisek,1476
|
25
|
-
maps4fs/generator/dtm/dtm.py,sha256=
|
25
|
+
maps4fs/generator/dtm/dtm.py,sha256=vZh3Z5grfQy0gvo-xAgXwkWExk1kW1pGVw2nk54hN-8,16983
|
26
26
|
maps4fs/generator/dtm/england.py,sha256=YyCYwnNUJuBeeMNUozfKIj_yNjHpGeuH1Mz0NiAJL-U,1122
|
27
27
|
maps4fs/generator/dtm/finland.py,sha256=Chi3-3sanLIYpipjtPpTu9tqnL3DYcnygSDCPm1s24c,1753
|
28
28
|
maps4fs/generator/dtm/flanders.py,sha256=81pKkrM40SeOe1LSlcsTNXSmUNpofC4D454DG6WFSyA,1037
|
@@ -43,8 +43,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
|
|
43
43
|
maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
|
44
44
|
maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
|
45
45
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
46
|
-
maps4fs-1.8.
|
47
|
-
maps4fs-1.8.
|
48
|
-
maps4fs-1.8.
|
49
|
-
maps4fs-1.8.
|
50
|
-
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
|