voxcity 0.6.4__py3-none-any.whl → 0.6.5__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.

@@ -211,8 +211,9 @@ def export_topog(building_height_grid, building_id_grid, output_path,
211
211
  material_code = BUILDING_MATERIAL_MAPPING.get(building_material,
212
212
  BUILDING_MATERIAL_MAPPING['default'])
213
213
 
214
- # Write all grid cells including those without buildings
215
- n_buildings = ny * nx
214
+ # Count only cells with building height > 0
215
+ building_mask = building_height_grid > 0
216
+ n_buildings = int(np.count_nonzero(building_mask))
216
217
 
217
218
  with open(filename, 'w') as f:
218
219
  # Write number of buildings
@@ -324,8 +325,9 @@ def export_vmap(canopy_height_grid, output_path, tree_base_ratio=0.3, tree_type=
324
325
  ny, nx = canopy_height_grid.shape
325
326
  tree_code = TREE_TYPE_MAPPING.get(tree_type, TREE_TYPE_MAPPING['default'])
326
327
 
327
- # Write all grid cells including those without vegetation
328
- n_trees = ny * nx
328
+ # Count only cells with canopy height > 0
329
+ vegetation_mask = canopy_height_grid > 0
330
+ n_trees = int(np.count_nonzero(vegetation_mask))
329
331
 
330
332
  with open(filename, 'w') as f:
331
333
  # Write number of trees
@@ -1,6 +1,6 @@
1
- from .draw import *
2
- from .grid import *
3
- from .utils import *
4
- from .network import *
5
- from .polygon import *
6
- from .mesh import *
1
+ from .draw import *
2
+ from .grid import *
3
+ from .utils import *
4
+ from .network import *
5
+ from .polygon import *
6
+ from .mesh import *