voxcity 0.3.24__tar.gz → 0.3.25__tar.gz

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.

Files changed (53) hide show
  1. {voxcity-0.3.24 → voxcity-0.3.25}/PKG-INFO +1 -1
  2. {voxcity-0.3.24 → voxcity-0.3.25}/pyproject.toml +1 -1
  3. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/utils/visualization.py +110 -0
  4. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity.egg-info/PKG-INFO +1 -1
  5. {voxcity-0.3.24 → voxcity-0.3.25}/AUTHORS.rst +0 -0
  6. {voxcity-0.3.24 → voxcity-0.3.25}/CONTRIBUTING.rst +0 -0
  7. {voxcity-0.3.24 → voxcity-0.3.25}/HISTORY.rst +0 -0
  8. {voxcity-0.3.24 → voxcity-0.3.25}/LICENSE +0 -0
  9. {voxcity-0.3.24 → voxcity-0.3.25}/MANIFEST.in +0 -0
  10. {voxcity-0.3.24 → voxcity-0.3.25}/README.md +0 -0
  11. {voxcity-0.3.24 → voxcity-0.3.25}/docs/Makefile +0 -0
  12. {voxcity-0.3.24 → voxcity-0.3.25}/docs/archive/README.rst +0 -0
  13. {voxcity-0.3.24 → voxcity-0.3.25}/docs/authors.rst +0 -0
  14. {voxcity-0.3.24 → voxcity-0.3.25}/docs/conf.py +0 -0
  15. {voxcity-0.3.24 → voxcity-0.3.25}/docs/index.rst +0 -0
  16. {voxcity-0.3.24 → voxcity-0.3.25}/docs/make.bat +0 -0
  17. {voxcity-0.3.24 → voxcity-0.3.25}/setup.cfg +0 -0
  18. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/__init__.py +0 -0
  19. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/__init__.py +0 -0
  20. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/eubucco.py +0 -0
  21. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/gee.py +0 -0
  22. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/mbfp.py +0 -0
  23. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/oemj.py +0 -0
  24. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/omt.py +0 -0
  25. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/osm.py +0 -0
  26. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/overture.py +0 -0
  27. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/downloader/utils.py +0 -0
  28. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/exporter/__init_.py +0 -0
  29. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/exporter/envimet.py +0 -0
  30. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/exporter/magicavoxel.py +0 -0
  31. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/exporter/obj.py +0 -0
  32. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/generator.py +0 -0
  33. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/__init_.py +0 -0
  34. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/draw.py +0 -0
  35. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/grid.py +0 -0
  36. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/mesh.py +0 -0
  37. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/network.py +0 -0
  38. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/polygon.py +0 -0
  39. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/geoprocessor/utils.py +0 -0
  40. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/simulator/__init_.py +0 -0
  41. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/simulator/solar.py +0 -0
  42. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/simulator/utils.py +0 -0
  43. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/simulator/view.py +0 -0
  44. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/utils/__init_.py +0 -0
  45. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/utils/lc.py +0 -0
  46. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/utils/material.py +0 -0
  47. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity/utils/weather.py +0 -0
  48. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity.egg-info/SOURCES.txt +0 -0
  49. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity.egg-info/dependency_links.txt +0 -0
  50. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity.egg-info/requires.txt +0 -0
  51. {voxcity-0.3.24 → voxcity-0.3.25}/src/voxcity.egg-info/top_level.txt +0 -0
  52. {voxcity-0.3.24 → voxcity-0.3.25}/tests/__init__.py +0 -0
  53. {voxcity-0.3.24 → voxcity-0.3.25}/tests/voxelcity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voxcity
3
- Version: 0.3.24
3
+ Version: 0.3.25
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "voxcity"
3
- version = "0.3.24"
3
+ version = "0.3.25"
4
4
  requires-python = ">=3.10,<3.13"
5
5
  classifiers = [
6
6
  "Programming Language :: Python :: 3.10",
@@ -1109,6 +1109,116 @@ def visualize_voxcity_multi_view(voxel_array, meshsize, **kwargs):
1109
1109
  plt.show()
1110
1110
  plt.close()
1111
1111
 
1112
+ def visualize_voxcity_multi_view_with_multiple_sim_grids(voxel_array, meshsize, sim_configs, **kwargs):
1113
+ """
1114
+ Create multiple views of the voxel city data with multiple simulation grids.
1115
+
1116
+ Args:
1117
+ voxel_array: 3D numpy array containing voxel data
1118
+ meshsize: Size of each voxel/cell
1119
+ sim_configs: List of dictionaries, each containing configuration for a simulation grid:
1120
+ {
1121
+ 'sim_grid': 2D numpy array of simulation values,
1122
+ 'z_offset': height offset in meters (default: 1.5),
1123
+ 'cmap_name': colormap name (default: 'viridis'),
1124
+ 'vmin': minimum value for colormap (optional),
1125
+ 'vmax': maximum value for colormap (optional),
1126
+ 'label': label for the colorbar (optional)
1127
+ }
1128
+ **kwargs: Additional arguments including:
1129
+ - vox_dict: Dictionary mapping voxel values to colors
1130
+ - output_directory: Directory to save output images
1131
+ - output_file_name: Base filename for exports
1132
+ - dem_grid: DEM grid for height information
1133
+ - projection_type: 'perspective' or 'orthographic'
1134
+ - distance_factor: Factor to adjust camera distance
1135
+ """
1136
+ os.system('Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &')
1137
+ os.environ['DISPLAY'] = ':99'
1138
+
1139
+ # Configure PyVista settings
1140
+ pv.set_plot_theme('document')
1141
+ pv.global_theme.background = 'white'
1142
+ pv.global_theme.window_size = [1024, 768]
1143
+ pv.global_theme.jupyter_backend = 'static'
1144
+
1145
+ # Parse general kwargs
1146
+ vox_dict = kwargs.get("vox_dict", get_default_voxel_color_map())
1147
+ output_directory = kwargs.get("output_directory", 'output')
1148
+ base_filename = kwargs.get("output_file_name", None)
1149
+ dem_grid_ori = kwargs.get("dem_grid", None)
1150
+ projection_type = kwargs.get("projection_type", "perspective")
1151
+ distance_factor = kwargs.get("distance_factor", 1.0)
1152
+
1153
+ if dem_grid_ori is not None:
1154
+ dem_grid = dem_grid_ori - np.min(dem_grid_ori)
1155
+
1156
+ # Create meshes
1157
+ print("Creating voxel meshes...")
1158
+ meshes = create_city_meshes(voxel_array, vox_dict, meshsize=meshsize)
1159
+
1160
+ # Process each simulation grid
1161
+ for i, config in enumerate(sim_configs):
1162
+ sim_grid = config['sim_grid']
1163
+ if sim_grid is None or dem_grid is None:
1164
+ continue
1165
+
1166
+ z_offset = config.get('z_offset', 1.5)
1167
+ cmap_name = config.get('cmap_name', 'viridis')
1168
+ vmin = config.get('vmin', np.nanmin(sim_grid))
1169
+ vmax = config.get('vmax', np.nanmax(sim_grid))
1170
+ label = config.get('label', f'Simulation {i+1}')
1171
+
1172
+ print(f"Creating sim_grid surface mesh for {label}...")
1173
+ sim_mesh = create_sim_surface_mesh(
1174
+ sim_grid, dem_grid,
1175
+ meshsize=meshsize,
1176
+ z_offset=z_offset,
1177
+ cmap_name=cmap_name,
1178
+ vmin=vmin,
1179
+ vmax=vmax
1180
+ )
1181
+
1182
+ if sim_mesh is not None:
1183
+ meshes[f"sim_surface_{i}"] = sim_mesh
1184
+
1185
+ # Create colorbar for this simulation
1186
+ norm = mcolors.Normalize(vmin=vmin, vmax=vmax)
1187
+ scalar_map = cm.ScalarMappable(norm=norm, cmap=cmap_name)
1188
+
1189
+ fig, ax = plt.subplots(figsize=(6, 1))
1190
+ plt.colorbar(scalar_map, cax=ax, orientation='horizontal', label=label)
1191
+ plt.tight_layout()
1192
+ plt.show()
1193
+
1194
+ # Export if filename provided
1195
+ if base_filename is not None:
1196
+ print(f"Exporting files to '{base_filename}.*' ...")
1197
+ os.makedirs(output_directory, exist_ok=True)
1198
+ export_meshes(meshes, output_directory, base_filename)
1199
+
1200
+ # Create and save multiple views
1201
+ print("Creating multiple views...")
1202
+ os.makedirs(output_directory, exist_ok=True)
1203
+ image_files = create_multi_view_scene(
1204
+ meshes,
1205
+ output_directory=output_directory,
1206
+ projection_type=projection_type,
1207
+ distance_factor=distance_factor
1208
+ )
1209
+
1210
+ # Display each view separately
1211
+ for view_name, img_file in image_files:
1212
+ plt.figure(figsize=(12, 8))
1213
+ img = plt.imread(img_file)
1214
+ plt.imshow(img)
1215
+ plt.title(view_name.replace('_', ' ').title(), pad=20)
1216
+ plt.axis('off')
1217
+ plt.show()
1218
+ plt.close()
1219
+
1220
+ return meshes
1221
+
1112
1222
  # def create_interactive_scene(meshes):
1113
1223
  # scene = trimesh.Scene()
1114
1224
  # scene.ambient_light = np.array([0.1, 0.1, 0.1, 1.0])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voxcity
3
- Version: 0.3.24
3
+ Version: 0.3.25
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>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes