voxcity 0.6.0__py3-none-any.whl → 0.6.1__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.
Potentially problematic release.
This version of voxcity might be problematic. Click here for more details.
- voxcity/generator.py +16 -2
- {voxcity-0.6.0.dist-info → voxcity-0.6.1.dist-info}/METADATA +1 -1
- {voxcity-0.6.0.dist-info → voxcity-0.6.1.dist-info}/RECORD +7 -7
- {voxcity-0.6.0.dist-info → voxcity-0.6.1.dist-info}/WHEEL +0 -0
- {voxcity-0.6.0.dist-info → voxcity-0.6.1.dist-info}/licenses/AUTHORS.rst +0 -0
- {voxcity-0.6.0.dist-info → voxcity-0.6.1.dist-info}/licenses/LICENSE +0 -0
- {voxcity-0.6.0.dist-info → voxcity-0.6.1.dist-info}/top_level.txt +0 -0
voxcity/generator.py
CHANGED
|
@@ -472,8 +472,22 @@ def create_3d_voxel(building_height_grid_ori, building_min_height_grid_ori,
|
|
|
472
472
|
# Add 1 voxel layer to ensure sufficient vertical space
|
|
473
473
|
max_height = int(np.ceil(np.max(building_height_grid + dem_grid + tree_grid) / voxel_size))+1
|
|
474
474
|
# Initialize the 3D voxel grid with zeros
|
|
475
|
-
#
|
|
476
|
-
|
|
475
|
+
# Use int8 by default to reduce memory (values range from about -99 to small positives)
|
|
476
|
+
# Allow override via kwarg 'voxel_dtype'
|
|
477
|
+
voxel_dtype = kwargs.get("voxel_dtype", np.int8)
|
|
478
|
+
|
|
479
|
+
# Optional: estimate memory and allow a soft limit before allocating
|
|
480
|
+
try:
|
|
481
|
+
bytes_per_elem = np.dtype(voxel_dtype).itemsize
|
|
482
|
+
est_mb = rows * cols * max_height * bytes_per_elem / (1024 ** 2)
|
|
483
|
+
print(f"Voxel grid shape: ({rows}, {cols}, {max_height}), dtype: {voxel_dtype}, ~{est_mb:.1f} MB")
|
|
484
|
+
max_ram_mb = kwargs.get("max_voxel_ram_mb")
|
|
485
|
+
if (max_ram_mb is not None) and (est_mb > max_ram_mb):
|
|
486
|
+
raise MemoryError(f"Estimated voxel grid memory {est_mb:.1f} MB exceeds limit {max_ram_mb} MB. Increase mesh size or restrict ROI.")
|
|
487
|
+
except Exception:
|
|
488
|
+
pass
|
|
489
|
+
|
|
490
|
+
voxel_grid = np.zeros((rows, cols, max_height), dtype=voxel_dtype)
|
|
477
491
|
# Configure tree trunk-to-crown ratio
|
|
478
492
|
# This determines how much of the tree is trunk vs canopy
|
|
479
493
|
trunk_height_ratio = kwargs.get("trunk_height_ratio")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: voxcity
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: voxcity is an easy and one-stop tool to output 3d city models for microclimate simulation by integrating multiple geospatial open-data
|
|
5
5
|
Author-email: Kunihiko Fujiwara <kunihiko@nus.edu.sg>
|
|
6
6
|
Maintainer-email: Kunihiko Fujiwara <kunihiko@nus.edu.sg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
voxcity/__init__.py,sha256=el9v3gfybHOF_GUYPeSOqN0-vCrTW0eU1mcvi0sEfeU,252
|
|
2
|
-
voxcity/generator.py,sha256=
|
|
2
|
+
voxcity/generator.py,sha256=J61i6-bvgOlNQWgxlkSvOZ7CLAjRgh_XRYwslWkKxVM,55756
|
|
3
3
|
voxcity/downloader/__init__.py,sha256=o_T_EU7hZLGyXxX9wVWn1x-OAa3ThGYdnpgB1_2v3AE,151
|
|
4
4
|
voxcity/downloader/citygml.py,sha256=jVeHCLlJTf7k55OQGX0lZGQAngz_DD2V5TldSqRFlvc,36024
|
|
5
5
|
voxcity/downloader/eubucco.py,sha256=ln1YNaaOgJfxNfCtVbYaMm775-bUvpAA_LDv60_i22w,17875
|
|
@@ -30,9 +30,9 @@ voxcity/utils/lc.py,sha256=722Gz3lPbgAp0mmTZ-g-QKBbAnbxrcgaYwb1sa7q8Sk,16189
|
|
|
30
30
|
voxcity/utils/material.py,sha256=H8K8Lq4wBL6dQtgj7esUW2U6wLCOTeOtelkTDJoRgMo,10007
|
|
31
31
|
voxcity/utils/visualization.py,sha256=Hk31pVOZ3q8K0QaudAMSqKUquF1Hd1Hug8626D4JJ74,115143
|
|
32
32
|
voxcity/utils/weather.py,sha256=2Jtg-rIVJcsTtiKE-KuDnhIqS1-MSS16_zFRzj6zmu4,36435
|
|
33
|
-
voxcity-0.6.
|
|
34
|
-
voxcity-0.6.
|
|
35
|
-
voxcity-0.6.
|
|
36
|
-
voxcity-0.6.
|
|
37
|
-
voxcity-0.6.
|
|
38
|
-
voxcity-0.6.
|
|
33
|
+
voxcity-0.6.1.dist-info/licenses/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
|
|
34
|
+
voxcity-0.6.1.dist-info/licenses/LICENSE,sha256=s_jE1Df1nTPL4A_5GCGic5Zwex0CVaPKcAmSilxJPPE,1089
|
|
35
|
+
voxcity-0.6.1.dist-info/METADATA,sha256=xjpQvvglGgYo63uNuUKkdupRRAZs9so-8GWFDPh6N-c,26723
|
|
36
|
+
voxcity-0.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
voxcity-0.6.1.dist-info/top_level.txt,sha256=00b2U-LKfDllt6RL1R33MXie5MvxzUFye0NGD96t_8I,8
|
|
38
|
+
voxcity-0.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|