maps4fs 0.9.95__py3-none-any.whl → 0.9.97__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/background.py +1 -1
- maps4fs/generator/component.py +6 -6
- maps4fs/generator/config.py +1 -1
- maps4fs/generator/dem.py +5 -5
- maps4fs/generator/game.py +17 -1
- maps4fs/generator/grle.py +84 -0
- maps4fs/generator/i3d.py +1 -1
- maps4fs/generator/map.py +2 -2
- maps4fs/generator/qgis.py +5 -5
- maps4fs/generator/texture.py +13 -13
- maps4fs/toolbox/dem.py +3 -3
- {maps4fs-0.9.95.dist-info → maps4fs-0.9.97.dist-info}/METADATA +1 -1
- maps4fs-0.9.97.dist-info/RECORD +22 -0
- maps4fs-0.9.95.dist-info/RECORD +0 -21
- {maps4fs-0.9.95.dist-info → maps4fs-0.9.97.dist-info}/LICENSE.md +0 -0
- {maps4fs-0.9.95.dist-info → maps4fs-0.9.97.dist-info}/WHEEL +0 -0
- {maps4fs-0.9.95.dist-info → maps4fs-0.9.97.dist-info}/top_level.txt +0 -0
maps4fs/generator/background.py
CHANGED
@@ -27,7 +27,7 @@ FULL_SIMPLIFY_FACTOR = 20
|
|
27
27
|
class Background(Component):
|
28
28
|
"""Component for creating 3D obj files based on DEM data around the map.
|
29
29
|
|
30
|
-
|
30
|
+
Arguments:
|
31
31
|
coordinates (tuple[float, float]): The latitude and longitude of the center of the map.
|
32
32
|
map_height (int): The height of the map in pixels.
|
33
33
|
map_width (int): The width of the map in pixels.
|
maps4fs/generator/component.py
CHANGED
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
|
20
20
|
class Component:
|
21
21
|
"""Base class for all map generation components.
|
22
22
|
|
23
|
-
|
23
|
+
Arguments:
|
24
24
|
game (Game): The game instance for which the map is generated.
|
25
25
|
coordinates (tuple[float, float]): The latitude and longitude of the center of the map.
|
26
26
|
map_height (int): The height of the map in pixels.
|
@@ -123,7 +123,7 @@ class Component:
|
|
123
123
|
"""Updates the generation info with the provided data.
|
124
124
|
If the generation info file does not exist, it will be created.
|
125
125
|
|
126
|
-
|
126
|
+
Arguments:
|
127
127
|
data (dict[Any, Any]): The data to update the generation info with.
|
128
128
|
"""
|
129
129
|
if os.path.isfile(self.generation_info_path):
|
@@ -158,7 +158,7 @@ class Component:
|
|
158
158
|
width of the map.
|
159
159
|
If coordinates and distance are not provided, the instance variables are used.
|
160
160
|
|
161
|
-
|
161
|
+
Arguments:
|
162
162
|
coordinates (tuple[float, float], optional): The latitude and longitude of the center of
|
163
163
|
the map. Defaults to None.
|
164
164
|
height_distance (int, optional): The distance from the center of the map to the edge of
|
@@ -219,7 +219,7 @@ class Component:
|
|
219
219
|
"""Converts the bounding box to EPSG:3857.
|
220
220
|
If the bounding box is not provided, the instance variable is used.
|
221
221
|
|
222
|
-
|
222
|
+
Arguments:
|
223
223
|
bbox (tuple[float, float, float, float], optional): The bounding box to convert.
|
224
224
|
add_margin (bool, optional): Whether to add a margin to the bounding box.
|
225
225
|
|
@@ -247,7 +247,7 @@ class Component:
|
|
247
247
|
"""Converts the bounding box to EPSG:3857 string.
|
248
248
|
If the bounding box is not provided, the instance variable is used.
|
249
249
|
|
250
|
-
|
250
|
+
Arguments:
|
251
251
|
bbox (tuple[float, float, float, float], optional): The bounding box to convert.
|
252
252
|
add_margin (bool, optional): Whether to add a margin to the bounding box.
|
253
253
|
|
@@ -265,7 +265,7 @@ class Component:
|
|
265
265
|
bounding box coordinates in EPSG:3857.
|
266
266
|
For filenames, the class name is used as a prefix.
|
267
267
|
|
268
|
-
|
268
|
+
Arguments:
|
269
269
|
qgis_layers (list[tuple[str, float, float, float, float]]): The list of layers to
|
270
270
|
create scripts for.
|
271
271
|
"""
|
maps4fs/generator/config.py
CHANGED
@@ -12,7 +12,7 @@ from maps4fs.generator.component import Component
|
|
12
12
|
class Config(Component):
|
13
13
|
"""Component for map settings and configuration.
|
14
14
|
|
15
|
-
|
15
|
+
Arguments:
|
16
16
|
coordinates (tuple[float, float]): The latitude and longitude of the center of the map.
|
17
17
|
map_height (int): The height of the map in pixels.
|
18
18
|
map_width (int): The width of the map in pixels.
|
maps4fs/generator/dem.py
CHANGED
@@ -23,7 +23,7 @@ DEFAULT_PLATEAU = 0
|
|
23
23
|
class DEM(Component):
|
24
24
|
"""Component for processing Digital Elevation Model data.
|
25
25
|
|
26
|
-
|
26
|
+
Arguments:
|
27
27
|
coordinates (tuple[float, float]): The latitude and longitude of the center of the map.
|
28
28
|
map_height (int): The height of the map in pixels.
|
29
29
|
map_width (int): The width of the map in pixels.
|
@@ -231,7 +231,7 @@ class DEM(Component):
|
|
231
231
|
def make_copy(self, dem_name: str) -> None:
|
232
232
|
"""Copies DEM data to additional DEM file.
|
233
233
|
|
234
|
-
|
234
|
+
Arguments:
|
235
235
|
dem_name (str): Name of the additional DEM file.
|
236
236
|
"""
|
237
237
|
dem_directory = os.path.dirname(self._dem_path)
|
@@ -244,7 +244,7 @@ class DEM(Component):
|
|
244
244
|
def _tile_info(self, lat: float, lon: float) -> tuple[str, str]:
|
245
245
|
"""Returns latitude band and tile name for SRTM tile from coordinates.
|
246
246
|
|
247
|
-
|
247
|
+
Arguments:
|
248
248
|
lat (float): Latitude.
|
249
249
|
lon (float): Longitude.
|
250
250
|
|
@@ -392,7 +392,7 @@ class DEM(Component):
|
|
392
392
|
"""Calculate scaling factor for DEM data normalization.
|
393
393
|
NOTE: Needs reconsideration for the implementation.
|
394
394
|
|
395
|
-
|
395
|
+
Arguments:
|
396
396
|
maximum_deviation (int): Maximum deviation in DEM data.
|
397
397
|
|
398
398
|
Returns:
|
@@ -404,7 +404,7 @@ class DEM(Component):
|
|
404
404
|
|
405
405
|
def _normalize_dem(self, data: np.ndarray) -> np.ndarray:
|
406
406
|
"""Normalize DEM data to 16-bit unsigned integer using max height from settings.
|
407
|
-
|
407
|
+
Arguments:
|
408
408
|
data (np.ndarray): DEM data from SRTM file after cropping.
|
409
409
|
Returns:
|
410
410
|
np.ndarray: Normalized DEM data.
|
maps4fs/generator/game.py
CHANGED
@@ -9,6 +9,7 @@ import os
|
|
9
9
|
from maps4fs.generator.background import Background
|
10
10
|
from maps4fs.generator.config import Config
|
11
11
|
from maps4fs.generator.dem import DEM
|
12
|
+
from maps4fs.generator.grle import GRLE
|
12
13
|
from maps4fs.generator.i3d import I3d
|
13
14
|
from maps4fs.generator.texture import Texture
|
14
15
|
|
@@ -35,8 +36,9 @@ class Game:
|
|
35
36
|
_additional_dem_name: str | None = None
|
36
37
|
_map_template_path: str | None = None
|
37
38
|
_texture_schema: str | None = None
|
39
|
+
_grle_schema: str | None = None
|
38
40
|
|
39
|
-
components = [Config, Texture, DEM, I3d, Background]
|
41
|
+
components = [Config, Texture, GRLE, DEM, I3d, Background]
|
40
42
|
|
41
43
|
def __init__(self, map_template_path: str | None = None):
|
42
44
|
if map_template_path:
|
@@ -94,6 +96,19 @@ class Game:
|
|
94
96
|
raise ValueError("Texture layers schema path not set.")
|
95
97
|
return self._texture_schema
|
96
98
|
|
99
|
+
@property
|
100
|
+
def grle_schema(self) -> str:
|
101
|
+
"""Returns the path to the GRLE layers schema file.
|
102
|
+
|
103
|
+
Raises:
|
104
|
+
ValueError: If the GRLE layers schema path is not set.
|
105
|
+
|
106
|
+
Returns:
|
107
|
+
str: The path to the GRLE layers schema file."""
|
108
|
+
if not self._grle_schema:
|
109
|
+
raise ValueError("GRLE layers schema path not set.")
|
110
|
+
return self._grle_schema
|
111
|
+
|
97
112
|
def dem_file_path(self, map_directory: str) -> str:
|
98
113
|
"""Returns the path to the DEM file.
|
99
114
|
|
@@ -171,6 +186,7 @@ class FS25(Game):
|
|
171
186
|
_additional_dem_name = "unprocessedHeightMap.png"
|
172
187
|
_map_template_path = os.path.join(working_directory, "data", "fs25-map-template.zip")
|
173
188
|
_texture_schema = os.path.join(working_directory, "data", "fs25-texture-schema.json")
|
189
|
+
_grle_schema = os.path.join(working_directory, "data", "fs25-grle-schema.json")
|
174
190
|
|
175
191
|
def dem_file_path(self, map_directory: str) -> str:
|
176
192
|
"""Returns the path to the DEM file.
|
@@ -0,0 +1,84 @@
|
|
1
|
+
"""This module contains the GRLE class for generating InfoLayer PNG files based on GRLE schema."""
|
2
|
+
|
3
|
+
import json
|
4
|
+
import os
|
5
|
+
|
6
|
+
import cv2
|
7
|
+
import numpy as np
|
8
|
+
|
9
|
+
from maps4fs.generator.component import Component
|
10
|
+
|
11
|
+
|
12
|
+
# pylint: disable=W0223
|
13
|
+
class GRLE(Component):
|
14
|
+
"""Component for to generate InfoLayer PNG files based on GRLE schema.
|
15
|
+
|
16
|
+
Arguments:
|
17
|
+
coordinates (tuple[float, float]): The latitude and longitude of the center of the map.
|
18
|
+
map_height (int): The height of the map in pixels.
|
19
|
+
map_width (int): The width of the map in pixels.
|
20
|
+
map_directory (str): The directory where the map files are stored.
|
21
|
+
logger (Any, optional): The logger to use. Must have at least three basic methods: debug,
|
22
|
+
info, warning. If not provided, default logging will be used.
|
23
|
+
"""
|
24
|
+
|
25
|
+
_grle_schema: dict[str, float | int | str] | None = None
|
26
|
+
|
27
|
+
def preprocess(self) -> None:
|
28
|
+
"""Gets the path to the map I3D file from the game instance and saves it to the instance
|
29
|
+
attribute. If the game does not support I3D files, the attribute is set to None."""
|
30
|
+
try:
|
31
|
+
grle_schema_path = self.game.grle_schema
|
32
|
+
except ValueError:
|
33
|
+
self.logger.info("GRLE schema processing is not implemented for this game.")
|
34
|
+
return
|
35
|
+
|
36
|
+
try:
|
37
|
+
with open(grle_schema_path, "r", encoding="utf-8") as file:
|
38
|
+
self._grle_schema = json.load(file)
|
39
|
+
self.logger.debug("GRLE schema loaded from: %s.", grle_schema_path)
|
40
|
+
except (json.JSONDecodeError, FileNotFoundError) as error:
|
41
|
+
self.logger.error("Error loading GRLE schema from %s: %s.", grle_schema_path, error)
|
42
|
+
self._grle_schema = None
|
43
|
+
|
44
|
+
def process(self) -> None:
|
45
|
+
"""Generates InfoLayer PNG files based on the GRLE schema."""
|
46
|
+
if not self._grle_schema:
|
47
|
+
self.logger.info("GRLE schema is not obtained, skipping the processing.")
|
48
|
+
return
|
49
|
+
|
50
|
+
for info_layer in self._grle_schema:
|
51
|
+
if isinstance(info_layer, dict):
|
52
|
+
file_path = os.path.join(
|
53
|
+
self.game.weights_dir_path(self.map_directory), info_layer["name"]
|
54
|
+
)
|
55
|
+
|
56
|
+
height = int(self.map_height * info_layer["height_multiplier"])
|
57
|
+
width = int(self.map_width * info_layer["width_multiplier"])
|
58
|
+
data_type = info_layer["data_type"]
|
59
|
+
|
60
|
+
self.logger.debug(
|
61
|
+
"Creating InfoLayer PNG file %s with dimensions %sx%s, %s channels, "
|
62
|
+
"and data type %s.",
|
63
|
+
file_path,
|
64
|
+
height,
|
65
|
+
width,
|
66
|
+
data_type,
|
67
|
+
)
|
68
|
+
|
69
|
+
# Create the InfoLayer PNG file with zeros.
|
70
|
+
info_layer_data = np.zeros((height, width), dtype=data_type)
|
71
|
+
print(info_layer_data.shape)
|
72
|
+
cv2.imwrite(file_path, info_layer_data) # pylint: disable=no-member
|
73
|
+
self.logger.info("InfoLayer PNG file %s created.", file_path)
|
74
|
+
else:
|
75
|
+
self.logger.warning("Invalid InfoLayer schema: %s.", info_layer)
|
76
|
+
|
77
|
+
def previews(self) -> list[str]:
|
78
|
+
"""Returns a list of paths to the preview images (empty list).
|
79
|
+
The component does not generate any preview images so it returns an empty list.
|
80
|
+
|
81
|
+
Returns:
|
82
|
+
list[str]: An empty list.
|
83
|
+
"""
|
84
|
+
return []
|
maps4fs/generator/i3d.py
CHANGED
@@ -16,7 +16,7 @@ DEFAULT_MAX_LOD_OCCLUDER_DISTANCE = 10000
|
|
16
16
|
class I3d(Component):
|
17
17
|
"""Component for map i3d file settings and configuration.
|
18
18
|
|
19
|
-
|
19
|
+
Arguments:
|
20
20
|
coordinates (tuple[float, float]): The latitude and longitude of the center of the map.
|
21
21
|
map_height (int): The height of the map in pixels.
|
22
22
|
map_width (int): The width of the map in pixels.
|
maps4fs/generator/map.py
CHANGED
@@ -15,7 +15,7 @@ from maps4fs.logger import Logger
|
|
15
15
|
class Map:
|
16
16
|
"""Class used to generate map using all components.
|
17
17
|
|
18
|
-
|
18
|
+
Arguments:
|
19
19
|
game (Type[Game]): Game for which the map is generated.
|
20
20
|
coordinates (tuple[float, float]): Coordinates of the center of the map.
|
21
21
|
height (int): Height of the map in pixels.
|
@@ -119,7 +119,7 @@ class Map:
|
|
119
119
|
def pack(self, archive_path: str, remove_source: bool = True) -> str:
|
120
120
|
"""Pack map directory to zip archive.
|
121
121
|
|
122
|
-
|
122
|
+
Arguments:
|
123
123
|
archive_path (str): Path to the archive.
|
124
124
|
remove_source (bool, optional): Remove source directory after packing.
|
125
125
|
|
maps4fs/generator/qgis.py
CHANGED
@@ -115,7 +115,7 @@ for layer in layers:
|
|
115
115
|
def _get_template(layers: list[tuple[str, float, float, float, float]], template: str) -> str:
|
116
116
|
"""Returns a template for creating layers in QGIS.
|
117
117
|
|
118
|
-
|
118
|
+
Arguments:
|
119
119
|
layers (list[tuple[str, float, float, float, float]]): A list of tuples containing the
|
120
120
|
layer name and the bounding box coordinates.
|
121
121
|
template (str): The template for creating layers in QGIS.
|
@@ -136,7 +136,7 @@ def _get_template(layers: list[tuple[str, float, float, float, float]], template
|
|
136
136
|
def get_bbox_template(layers: list[tuple[str, float, float, float, float]]) -> str:
|
137
137
|
"""Returns a template for creating bounding box layers in QGIS.
|
138
138
|
|
139
|
-
|
139
|
+
Arguments:
|
140
140
|
layers (list[tuple[str, float, float, float, float]]): A list of tuples containing the
|
141
141
|
layer name and the bounding box coordinates.
|
142
142
|
|
@@ -149,7 +149,7 @@ def get_bbox_template(layers: list[tuple[str, float, float, float, float]]) -> s
|
|
149
149
|
def get_point_template(layers: list[tuple[str, float, float, float, float]]) -> str:
|
150
150
|
"""Returns a template for creating point layers in QGIS.
|
151
151
|
|
152
|
-
|
152
|
+
Arguments:
|
153
153
|
layers (list[tuple[str, float, float, float, float]]): A list of tuples containing the
|
154
154
|
layer name and the bounding box coordinates.
|
155
155
|
|
@@ -162,7 +162,7 @@ def get_point_template(layers: list[tuple[str, float, float, float, float]]) ->
|
|
162
162
|
def get_rasterize_template(layers: list[tuple[str, float, float, float, float]]) -> str:
|
163
163
|
"""Returns a template for rasterizing bounding box layers in QGIS.
|
164
164
|
|
165
|
-
|
165
|
+
Arguments:
|
166
166
|
layers (list[tuple[str, float, float, float, float]]): A list of tuples containing the
|
167
167
|
layer name and the bounding box coordinates.
|
168
168
|
|
@@ -177,7 +177,7 @@ def save_scripts(
|
|
177
177
|
) -> None:
|
178
178
|
"""Saves QGIS scripts for creating bounding box, point, and raster layers.
|
179
179
|
|
180
|
-
|
180
|
+
Arguments:
|
181
181
|
layers (list[tuple[str, float, float, float, float]]): A list of tuples containing the
|
182
182
|
layer name and the bounding box coordinates.
|
183
183
|
save_dir (str): The directory to save the scripts.
|
maps4fs/generator/texture.py
CHANGED
@@ -36,7 +36,7 @@ class Texture(Component):
|
|
36
36
|
"""Class which represents a layer with textures and tags.
|
37
37
|
It's using to obtain data from OSM using tags and make changes into corresponding textures.
|
38
38
|
|
39
|
-
|
39
|
+
Arguments:
|
40
40
|
name (str): Name of the layer.
|
41
41
|
tags (dict[str, str | list[str]]): Dictionary of tags to search for.
|
42
42
|
width (int | None): Width of the polygon in meters (only for LineString).
|
@@ -89,7 +89,7 @@ class Texture(Component):
|
|
89
89
|
def from_json(cls, data: dict[str, str | list[str] | bool]) -> Texture.Layer:
|
90
90
|
"""Creates a new instance of the class from dictionary.
|
91
91
|
|
92
|
-
|
92
|
+
Arguments:
|
93
93
|
data (dict[str, str | list[str] | bool]): Dictionary with layer data.
|
94
94
|
|
95
95
|
Returns:
|
@@ -236,7 +236,7 @@ class Texture(Component):
|
|
236
236
|
"""Generates weight files for textures. Each file is a numpy array of zeros and
|
237
237
|
dtype uint8 (0-255).
|
238
238
|
|
239
|
-
|
239
|
+
Arguments:
|
240
240
|
layer (Layer): Layer with textures and tags.
|
241
241
|
"""
|
242
242
|
size = (self.map_height, self.map_width)
|
@@ -266,7 +266,7 @@ class Texture(Component):
|
|
266
266
|
def layers(self, layers: list[Layer]) -> None:
|
267
267
|
"""Sets list of layers with textures and tags.
|
268
268
|
|
269
|
-
|
269
|
+
Arguments:
|
270
270
|
layers (list[Layer]): List of layers.
|
271
271
|
"""
|
272
272
|
self._layers = layers
|
@@ -395,7 +395,7 @@ class Texture(Component):
|
|
395
395
|
"""Draws base layer and saves it into the png file.
|
396
396
|
Base layer is the last layer to be drawn, it fills the remaining area of the map.
|
397
397
|
|
398
|
-
|
398
|
+
Arguments:
|
399
399
|
cumulative_image (np.ndarray): Cumulative image with all layers.
|
400
400
|
"""
|
401
401
|
base_layer = self.get_base_layer()
|
@@ -409,7 +409,7 @@ class Texture(Component):
|
|
409
409
|
def get_relative_x(self, x: float) -> int:
|
410
410
|
"""Converts UTM X coordinate to relative X coordinate in map image.
|
411
411
|
|
412
|
-
|
412
|
+
Arguments:
|
413
413
|
x (float): UTM X coordinate.
|
414
414
|
|
415
415
|
Returns:
|
@@ -420,7 +420,7 @@ class Texture(Component):
|
|
420
420
|
def get_relative_y(self, y: float) -> int:
|
421
421
|
"""Converts UTM Y coordinate to relative Y coordinate in map image.
|
422
422
|
|
423
|
-
|
423
|
+
Arguments:
|
424
424
|
y (float): UTM Y coordinate.
|
425
425
|
|
426
426
|
Returns:
|
@@ -432,9 +432,9 @@ class Texture(Component):
|
|
432
432
|
def _to_np(self, geometry: shapely.geometry.polygon.Polygon, *args) -> np.ndarray:
|
433
433
|
"""Converts Polygon geometry to numpy array of polygon points.
|
434
434
|
|
435
|
-
|
435
|
+
Arguments:
|
436
436
|
geometry (shapely.geometry.polygon.Polygon): Polygon geometry.
|
437
|
-
*
|
437
|
+
*Arguments: Additional arguments:
|
438
438
|
- width (int | None): Width of the polygon in meters.
|
439
439
|
|
440
440
|
Returns:
|
@@ -449,7 +449,7 @@ class Texture(Component):
|
|
449
449
|
def _to_polygon(self, obj: pd.core.series.Series, width: int | None) -> np.ndarray | None:
|
450
450
|
"""Converts OSM object to numpy array of polygon points.
|
451
451
|
|
452
|
-
|
452
|
+
Arguments:
|
453
453
|
obj (pd.core.series.Series): OSM object.
|
454
454
|
width (int | None): Width of the polygon in meters.
|
455
455
|
|
@@ -471,7 +471,7 @@ class Texture(Component):
|
|
471
471
|
) -> np.ndarray:
|
472
472
|
"""Converts LineString or Point geometry to numpy array of polygon points.
|
473
473
|
|
474
|
-
|
474
|
+
Arguments:
|
475
475
|
geometry (shapely.geometry.linestring.LineString | shapely.geometry.point.Point):
|
476
476
|
LineString or Point geometry.
|
477
477
|
width (int | None): Width of the polygon in meters.
|
@@ -487,7 +487,7 @@ class Texture(Component):
|
|
487
487
|
) -> Optional[Callable[[BaseGeometry, Optional[int]], np.ndarray]]:
|
488
488
|
"""Returns a converter function for a given geometry type.
|
489
489
|
|
490
|
-
|
490
|
+
Arguments:
|
491
491
|
geom_type (str): Geometry type.
|
492
492
|
|
493
493
|
Returns:
|
@@ -501,7 +501,7 @@ class Texture(Component):
|
|
501
501
|
) -> Generator[np.ndarray, None, None]:
|
502
502
|
"""Generator which yields numpy arrays of polygons from OSM data.
|
503
503
|
|
504
|
-
|
504
|
+
Arguments:
|
505
505
|
tags (dict[str, str | list[str]]): Dictionary of tags to search for.
|
506
506
|
width (int | None): Width of the polygon in meters (only for LineString).
|
507
507
|
|
maps4fs/toolbox/dem.py
CHANGED
@@ -11,7 +11,7 @@ from rasterio.windows import from_bounds # type: ignore
|
|
11
11
|
def read_geo_tiff(file_path: str) -> DatasetReader:
|
12
12
|
"""Read a GeoTIFF file and return the DatasetReader object.
|
13
13
|
|
14
|
-
|
14
|
+
Arguments:
|
15
15
|
file_path (str): The path to the GeoTIFF file.
|
16
16
|
|
17
17
|
Raises:
|
@@ -43,7 +43,7 @@ def get_geo_tiff_bbox(
|
|
43
43
|
) -> tuple[float, float, float, float]:
|
44
44
|
"""Return the bounding box of a GeoTIFF file in the destination CRS.
|
45
45
|
|
46
|
-
|
46
|
+
Arguments:
|
47
47
|
src (DatasetReader): The DatasetReader object for the GeoTIFF file.
|
48
48
|
dst_crs (str, optional): The destination CRS. Defaults to "EPSG:4326".
|
49
49
|
|
@@ -65,7 +65,7 @@ def get_geo_tiff_bbox(
|
|
65
65
|
def extract_roi(file_path: str, bbox: tuple[float, float, float, float]) -> str:
|
66
66
|
"""Extract a region of interest (ROI) from a GeoTIFF file and save it as a new file.
|
67
67
|
|
68
|
-
|
68
|
+
Arguments:
|
69
69
|
file_path (str): The path to the GeoTIFF file.
|
70
70
|
bbox (tuple[float, float, float, float]): The bounding box of the region of interest
|
71
71
|
as (north, south, east, west).
|
@@ -0,0 +1,22 @@
|
|
1
|
+
maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
|
2
|
+
maps4fs/logger.py,sha256=B-NEYpMjPAAqlV4VpfTi6nbBFnEABVtQOaYe6nMpidg,1489
|
3
|
+
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
|
+
maps4fs/generator/background.py,sha256=h6zyqMc51eOD8_Jbe8eP9DJFy27-XItzIOVEThQKFdk,14011
|
5
|
+
maps4fs/generator/component.py,sha256=ibfl2V_niXqWaFO05aaV25JbPBaupUpKBOLxKQq0Fv4,10714
|
6
|
+
maps4fs/generator/config.py,sha256=qomeSaHNgSYvRyPbGkyDjgAxU1jUMND8wESuy9uXcV4,4280
|
7
|
+
maps4fs/generator/dem.py,sha256=aU0syr7pu81hd6oVn1rjQoDsDAYJro-58i1STTUz3jw,17167
|
8
|
+
maps4fs/generator/game.py,sha256=hvVsU4l43kHYM9oZ6WBFhDiI8U3gJxzSeavAvXyh0DI,7395
|
9
|
+
maps4fs/generator/grle.py,sha256=TM9I1ge1_hfepdLq485TbHozm2OBr6HWNrkmixAigI0,3436
|
10
|
+
maps4fs/generator/i3d.py,sha256=CSdVDQJOybeu6DQhxTxImEOSsbbXSNqAN8sunNuicM0,3602
|
11
|
+
maps4fs/generator/map.py,sha256=1EJfq5928xbV7v9vBBuoC3VpD5gC1SMDBTQ7geH6yaA,4678
|
12
|
+
maps4fs/generator/path_steps.py,sha256=yeN6hmOD8O2LMozUf4HcQMIy8WJ5sHF5pGQT_s2FfOw,3147
|
13
|
+
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
14
|
+
maps4fs/generator/texture.py,sha256=9qBlL3udozp5ATg9N48naRjTQPWe_eOPgs28hG4U13g,22381
|
15
|
+
maps4fs/generator/tile.py,sha256=6zUpDidPcPRTGzQvYSNw-0Pj-if2WiakU2qb-40vyOk,2151
|
16
|
+
maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
17
|
+
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
18
|
+
maps4fs-0.9.97.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
19
|
+
maps4fs-0.9.97.dist-info/METADATA,sha256=s4WH0mc0o_KT-TTA4PdgsYLTMEwr8LnlrvXqxVdWUZo,25194
|
20
|
+
maps4fs-0.9.97.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
21
|
+
maps4fs-0.9.97.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
22
|
+
maps4fs-0.9.97.dist-info/RECORD,,
|
maps4fs-0.9.95.dist-info/RECORD
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
|
2
|
-
maps4fs/logger.py,sha256=B-NEYpMjPAAqlV4VpfTi6nbBFnEABVtQOaYe6nMpidg,1489
|
3
|
-
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
|
-
maps4fs/generator/background.py,sha256=XtrTtLEYL5yINFPib-RsYSisNlqBZx9brDCyn4bBj5E,14006
|
5
|
-
maps4fs/generator/component.py,sha256=ZEDjChPnvqAsgnBu2f2YBOlwGOlfax4VaAYBcJerLIQ,10684
|
6
|
-
maps4fs/generator/config.py,sha256=ZO5BWDU-S3p0-ndKDSFa8Oin3YcYy0iH8B4lqEA_07Q,4275
|
7
|
-
maps4fs/generator/dem.py,sha256=2hqkNfJpMJ3rNUK5Mi1OoWzMaaDfycwr7Okb19PyF4M,17142
|
8
|
-
maps4fs/generator/game.py,sha256=94HjPNOyy6XSSOnBp-uxrkBglKyC-X3ULIrrucfdlKw,6825
|
9
|
-
maps4fs/generator/i3d.py,sha256=UuQiQRusPQ2f6PvGKxJ_UZeXsx3uG15efmy8Ysnm3F8,3597
|
10
|
-
maps4fs/generator/map.py,sha256=tJqe4r4Y8Z8ARUJtFc_8xAQjta8sL_lKdbI89vrljVM,4668
|
11
|
-
maps4fs/generator/path_steps.py,sha256=yeN6hmOD8O2LMozUf4HcQMIy8WJ5sHF5pGQT_s2FfOw,3147
|
12
|
-
maps4fs/generator/qgis.py,sha256=R5Iv3ovyLXkhAL5Oy41u3ZLNOSEbc1byLetzPootO7o,6091
|
13
|
-
maps4fs/generator/texture.py,sha256=SBWZRXq7CdSZh2e8PMW57J56-kqwRvrl_jCPxtOkpR8,22316
|
14
|
-
maps4fs/generator/tile.py,sha256=6zUpDidPcPRTGzQvYSNw-0Pj-if2WiakU2qb-40vyOk,2151
|
15
|
-
maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
16
|
-
maps4fs/toolbox/dem.py,sha256=53KVZ6IKIlK642eYFSRDAC8l2HL9IEUpQNYkkTC56uU,3510
|
17
|
-
maps4fs-0.9.95.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
18
|
-
maps4fs-0.9.95.dist-info/METADATA,sha256=PBJcYY-N-DuY-oBkbuE5k9isXXMtyyfQkInhEDSQxTI,25194
|
19
|
-
maps4fs-0.9.95.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
20
|
-
maps4fs-0.9.95.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
21
|
-
maps4fs-0.9.95.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|