maps4fs 1.6.1__py3-none-any.whl → 1.6.3__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 +8 -3
- maps4fs/generator/dtm/usgs.py +6 -1
- {maps4fs-1.6.1.dist-info → maps4fs-1.6.3.dist-info}/METADATA +1 -1
- {maps4fs-1.6.1.dist-info → maps4fs-1.6.3.dist-info}/RECORD +7 -7
- {maps4fs-1.6.1.dist-info → maps4fs-1.6.3.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.6.1.dist-info → maps4fs-1.6.3.dist-info}/WHEEL +0 -0
- {maps4fs-1.6.1.dist-info → maps4fs-1.6.3.dist-info}/top_level.txt +0 -0
maps4fs/generator/background.py
CHANGED
@@ -179,7 +179,7 @@ class Background(Component):
|
|
179
179
|
self.logger.debug("Generating obj file in path: %s", save_path)
|
180
180
|
|
181
181
|
dem_data = cv2.imread(self.dem.dem_path, cv2.IMREAD_UNCHANGED) # pylint: disable=no-member
|
182
|
-
self.plane_from_np(dem_data, save_path) # type: ignore
|
182
|
+
self.plane_from_np(dem_data, save_path, create_preview=True) # type: ignore
|
183
183
|
|
184
184
|
# pylint: disable=too-many-locals
|
185
185
|
def cutout(self, dem_path: str, save_path: str | None = None) -> str:
|
@@ -232,6 +232,7 @@ class Background(Component):
|
|
232
232
|
dem_data: np.ndarray,
|
233
233
|
save_path: str,
|
234
234
|
include_zeros: bool = True,
|
235
|
+
create_preview: bool = False,
|
235
236
|
) -> None:
|
236
237
|
"""Generates a 3D obj file based on DEM data.
|
237
238
|
|
@@ -239,6 +240,7 @@ class Background(Component):
|
|
239
240
|
dem_data (np.ndarray) -- The DEM data as a numpy array.
|
240
241
|
save_path (str) -- The path where the obj file will be saved.
|
241
242
|
include_zeros (bool, optional) -- If True, the mesh will include the zero height values.
|
243
|
+
create_preview (bool, optional) -- If True, a simplified mesh will be saved as an STL.
|
242
244
|
"""
|
243
245
|
resize_factor = 1 / self.map.background_settings.resize_factor
|
244
246
|
dem_data = cv2.resize( # pylint: disable=no-member
|
@@ -278,7 +280,10 @@ class Background(Component):
|
|
278
280
|
bottom_left = top_left + cols
|
279
281
|
bottom_right = bottom_left + 1
|
280
282
|
|
281
|
-
if
|
283
|
+
if (
|
284
|
+
ground in [z[i, j], z[i, j + 1], z[i + 1, j], z[i + 1, j + 1]]
|
285
|
+
and not include_zeros
|
286
|
+
):
|
282
287
|
skipped += 1
|
283
288
|
continue
|
284
289
|
|
@@ -304,7 +309,7 @@ class Background(Component):
|
|
304
309
|
mesh.export(save_path)
|
305
310
|
self.logger.debug("Obj file saved: %s", save_path)
|
306
311
|
|
307
|
-
if
|
312
|
+
if create_preview:
|
308
313
|
# Simplify the preview mesh to reduce the size of the file.
|
309
314
|
mesh = mesh.simplify_quadric_decimation(face_count=len(mesh.faces) // 2**7)
|
310
315
|
|
maps4fs/generator/dtm/usgs.py
CHANGED
@@ -33,6 +33,11 @@ class USGS1mProvider(DTMProvider):
|
|
33
33
|
_settings = USGS1mProviderSettings
|
34
34
|
_author = "[ZenJakey](https://github.com/ZenJakey)"
|
35
35
|
_is_community = True
|
36
|
+
_instructions = (
|
37
|
+
"ℹ️ Set the max local elevation to approx the local max elevation for your area in"
|
38
|
+
" meters. This will allow you to use heightScale 255 in GE with minimal tweaking."
|
39
|
+
" Setting this value too low can cause a flat map!"
|
40
|
+
)
|
36
41
|
|
37
42
|
_url = (
|
38
43
|
"https://tnmaccess.nationalmap.gov/api/v1/products?prodFormats=GeoTIFF,IMG&prodExtents="
|
@@ -123,7 +128,7 @@ class USGS1mProvider(DTMProvider):
|
|
123
128
|
datasets = [rasterio.open(file) for file in input_files]
|
124
129
|
|
125
130
|
# Merge datasets
|
126
|
-
mosaic, out_transform = merge(datasets)
|
131
|
+
mosaic, out_transform = merge(datasets, nodata=0)
|
127
132
|
|
128
133
|
# Get metadata from the first file and update it for the output
|
129
134
|
out_meta = datasets[0].meta.copy()
|
@@ -1,7 +1,7 @@
|
|
1
1
|
maps4fs/__init__.py,sha256=WbT36EzJ_74GN0RUUrLIYECdSdtRiZaxKl17KUt7pjA,492
|
2
2
|
maps4fs/logger.py,sha256=B-NEYpMjPAAqlV4VpfTi6nbBFnEABVtQOaYe6nMpidg,1489
|
3
3
|
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
|
-
maps4fs/generator/background.py,sha256=
|
4
|
+
maps4fs/generator/background.py,sha256=dpvhhkDUJtOt_pobIOuDp6DV8Z1HJfLyP8pzkIkk-G8,22615
|
5
5
|
maps4fs/generator/component.py,sha256=GrTI7803gOQFhqocdjFG-wh0HOkC6HWoyKr8pR2Xp28,20409
|
6
6
|
maps4fs/generator/config.py,sha256=0QmK052B8bxyHVhg3jzCORLfOBMMmqVfhhbqXKf6OMk,4383
|
7
7
|
maps4fs/generator/dem.py,sha256=20gx0dzX0LyO6ipvDitst-BwGfcKogFqgQf9Q2qMH5U,10933
|
@@ -16,12 +16,12 @@ maps4fs/generator/texture.py,sha256=dtMpNkmJalaV5IOuv6vhVQHmjbfaWZGYZSSfhs2_m8U,
|
|
16
16
|
maps4fs/generator/dtm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
maps4fs/generator/dtm/dtm.py,sha256=azy-RWsc5PgenKDtgG0lrddMwWEw1hYzdng9V8zphMk,9167
|
18
18
|
maps4fs/generator/dtm/srtm.py,sha256=2-pX6bWrJX6gr8IM7ueX6mm_PW7_UQ58MtdzDHae2OQ,9030
|
19
|
-
maps4fs/generator/dtm/usgs.py,sha256=
|
19
|
+
maps4fs/generator/dtm/usgs.py,sha256=ZTi10RNDA3EBrsVg2ZoYrdN4uqiG1Jvk7FzdcKdgNkU,13408
|
20
20
|
maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
21
21
|
maps4fs/toolbox/background.py,sha256=9BXWNqs_n3HgqDiPztWylgYk_QM4YgBpe6_ZNQAWtSc,2154
|
22
22
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
23
|
-
maps4fs-1.6.
|
24
|
-
maps4fs-1.6.
|
25
|
-
maps4fs-1.6.
|
26
|
-
maps4fs-1.6.
|
27
|
-
maps4fs-1.6.
|
23
|
+
maps4fs-1.6.3.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
24
|
+
maps4fs-1.6.3.dist-info/METADATA,sha256=TQauyiX5_h1vu-5ToYBGJOwHMNNiWied40jjkmTYCGI,36231
|
25
|
+
maps4fs-1.6.3.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
26
|
+
maps4fs-1.6.3.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
27
|
+
maps4fs-1.6.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|