voxcity 0.6.4__py3-none-any.whl → 0.6.6__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.
@@ -1,537 +1,534 @@
1
- Metadata-Version: 2.4
2
- Name: voxcity
3
- Version: 0.6.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
- Author-email: Kunihiko Fujiwara <fujiwara.kunihiko@takenaka.co.jp>
6
- Maintainer-email: Kunihiko Fujiwara <fujiwara.kunihiko@takenaka.co.jp>
7
- License: MIT
8
- Project-URL: bugs, https://github.com/kunifujiwara/voxcity/issues
9
- Project-URL: changelog, https://github.com/kunifujiwara/voxcity/blob/master/changelog.md
10
- Project-URL: homepage, https://github.com/kunifujiwara/voxcity
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Requires-Python: <3.13,>=3.10
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- License-File: AUTHORS.rst
18
- Requires-Dist: typer
19
- Requires-Dist: pandas
20
- Requires-Dist: requests
21
- Requires-Dist: pyproj
22
- Requires-Dist: ipyleaflet
23
- Requires-Dist: geopandas
24
- Requires-Dist: rasterio==1.3.11
25
- Requires-Dist: shapely
26
- Requires-Dist: gdown
27
- Requires-Dist: numpy
28
- Requires-Dist: matplotlib
29
- Requires-Dist: contextily
30
- Requires-Dist: fiona
31
- Requires-Dist: rtree
32
- Requires-Dist: plotly
33
- Requires-Dist: tqdm
34
- Requires-Dist: scipy
35
- Requires-Dist: affine
36
- Requires-Dist: earthengine-api
37
- Requires-Dist: geemap
38
- Requires-Dist: rio-cogeo
39
- Requires-Dist: geopy
40
- Requires-Dist: py-vox-io
41
- Requires-Dist: numba
42
- Requires-Dist: reverse_geocoder
43
- Requires-Dist: pycountry
44
- Requires-Dist: seaborn
45
- Requires-Dist: overturemaps
46
- Requires-Dist: protobuf
47
- Requires-Dist: timezonefinder
48
- Requires-Dist: astral
49
- Requires-Dist: osmnx
50
- Requires-Dist: joblib
51
- Requires-Dist: trimesh
52
- Requires-Dist: pyvista
53
- Requires-Dist: IPython
54
- Requires-Dist: lxml
55
- Requires-Dist: scikit-learn
56
- Provides-Extra: dev
57
- Requires-Dist: coverage; extra == "dev"
58
- Requires-Dist: mypy; extra == "dev"
59
- Requires-Dist: pytest; extra == "dev"
60
- Requires-Dist: ruff; extra == "dev"
61
- Dynamic: license-file
62
-
63
- [![PyPi version](https://img.shields.io/pypi/v/voxcity.svg)](https://pypi.python.org/pypi/voxcity)
64
- [![Python versions](https://img.shields.io/pypi/pyversions/voxcity.svg)](https://pypi.org/project/voxcity/)
65
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing)
66
- [![License](https://img.shields.io/pypi/l/voxcity.svg)](https://pypi.org/project/voxcity/)
67
- [![Downloads](https://pepy.tech/badge/voxcity)](https://pepy.tech/project/voxcity)
68
- [![Documentation Status](https://readthedocs.org/projects/voxcity/badge/?version=latest)](https://voxcity.readthedocs.io/en/latest/?badge=latest)
69
- <!-- [![License: CC BY-SA 4.0](https://licensebuttons.net/l/by-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-sa/4.0/) -->
70
-
71
- <p align="center">
72
- Tutorial preview: <a href="https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing">[Google Colab]</a> | Documentation: <a href="https://voxcity.readthedocs.io/en/latest">[Read the Docs]</a>
73
- </p>
74
-
75
- <p align="center">
76
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/logo.png" alt="Voxcity logo" width="550">
77
- </p>
78
-
79
- # VoxCity
80
-
81
- **voxcity** is a Python package that provides a seamless solution for grid-based 3D city model generation and urban simulation for cities worldwide. VoxCity's generator module automatically downloads building heights, tree canopy heights, land cover, and terrain elevation within a specified target area, and voxelizes buildings, trees, land cover, and terrain to generate an integrated voxel city model. The simulator module enables users to conduct environmental simulations, including solar radiation and view index analyses. Users can export the generated models using several file formats compatible with external software, such as ENVI-met (INX), Blender, and Rhino (OBJ). Try it out using the [Google Colab Demo](https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing) or your local environment. For detailed documentation, API reference, and tutorials, visit our [Read the Docs](https://voxcity.readthedocs.io/en/latest) page.
82
-
83
- <!-- <p align="center">
84
- <picture>
85
- <source media="(prefers-color-scheme: dark)" srcset="https://github.com/kunifujiwara/VoxCity/blob/main/images/concept.png">
86
- <img src="https://github.com/kunifujiwara/VoxCity/blob/main/images/concept.png" alt="Conceptual Diagram of voxcity" width="800">
87
- </picture>
88
- </p> -->
89
- <p align="center">
90
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/concept.png" alt="Conceptual Diagram of voxcity" width="800">
91
- </p>
92
-
93
-
94
- ## Key Features
95
-
96
- - **Integration of Multiple Data Sources:**
97
- Combines building footprints, land cover data, canopy height maps, and DEMs to generate a consistent 3D voxel representation of an urban scene.
98
-
99
- - **Flexible Input Sources:**
100
- Supports various building and terrain data sources including:
101
- - Building Footprints: OpenStreetMap, Overture, EUBUCCO, Microsoft Building Footprints, Open Building 2.5D
102
- - Land Cover: UrbanWatch, OpenEarthMap Japan, ESA WorldCover, ESRI Land Cover, Dynamic World, OpenStreetMap
103
- - Canopy Height: High Resolution 1m Global Canopy Height Maps, ETH Global Sentinel-2 10m
104
- - DEM: DeltaDTM, FABDEM, NASA, COPERNICUS, and more
105
-
106
- *Detailed information about each data source can be found in the [References of Data Sources](#references-of-data-sources) section.*
107
-
108
- - **Customizable Domain and Resolution:**
109
- Easily define a target area by drawing a rectangle on a map or specifying center coordinates and dimensions. Adjust the mesh size to meet resolution needs.
110
-
111
- - **Integration with Earth Engine:**
112
- Leverages Google Earth Engine for large-scale geospatial data processing (authentication and project setup required).
113
-
114
- - **Output Formats:**
115
- - **ENVI-MET**: Export INX and EDB files suitable for ENVI-MET microclimate simulations.
116
- - **MagicaVoxel**: Export vox files for 3D editing and visualization in MagicaVoxel.
117
- - **OBJ**: Export wavefront OBJ for rendering and integration into other workflows.
118
-
119
- - **Analytical Tools:**
120
- - **View Index Simulations**: Compute sky view index (SVI) and green view index (GVI) from a specified viewpoint.
121
- - **Landmark Visibility Maps**: Assess the visibility of selected landmarks within the voxelized environment.
122
-
123
- ## Installation
124
-
125
- Make sure you have Python 3.12 installed. Install voxcity with:
126
-
127
- ### For Local Environment
128
-
129
- ```bash
130
- conda create --name voxcity python=3.12
131
- conda activate voxcity
132
- conda install -c conda-forge gdal
133
- pip install voxcity
134
- ```
135
-
136
- ### For Google Colab
137
-
138
- ```python
139
- !pip install voxcity
140
- ```
141
-
142
- ## Setup for Earth Engine
143
-
144
- To use Earth Engine data, set up your Earth Engine enabled Cloud Project by following the instructions here:
145
- https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup
146
-
147
- After setting up, authenticate and initialize Earth Engine:
148
-
149
- ### For Local Environment
150
-
151
- ```bash
152
- earthengine authenticate
153
- ```
154
-
155
- ### For Google Colab
156
-
157
- ```python
158
- # Click displayed link, generate token, copy and paste the token
159
- !earthengine authenticate --auth_mode=notebook
160
- ```
161
-
162
- ## Usage Overview
163
-
164
- ### 1. Authenticate Earth Engine
165
-
166
- ```python
167
- import ee
168
- ee.Authenticate()
169
- ee.Initialize(project='your-project-id')
170
- ```
171
-
172
- ### 2. Define Target Area
173
-
174
- You can define your target area in three ways:
175
-
176
- #### Option 1: Direct Coordinate Input
177
- Define the target area by directly specifying the coordinates of the rectangle vertices.
178
-
179
- ```python
180
- rectangle_vertices = [
181
- (-122.33587348582083, 47.59830044521263), # Southwest corner (longitude, latitude)
182
- (-122.33587348582083, 47.60279755390168), # Northwest corner (longitude, latitude)
183
- (-122.32922451417917, 47.60279755390168), # Northeast corner (longitude, latitude)
184
- (-122.32922451417917, 47.59830044521263) # Southeast corner (longitude, latitude)
185
- ]
186
- ```
187
-
188
- #### Option 2: Draw a Rectangle (for Jupyter Notebook)
189
- Use the GUI map interface to draw a rectangular domain of interest.
190
-
191
- ```python
192
- from voxcity.geoprocessor.draw import draw_rectangle_map_cityname
193
-
194
- cityname = "tokyo"
195
- m, rectangle_vertices = draw_rectangle_map_cityname(cityname, zoom=15)
196
- m
197
- ```
198
-
199
- #### Option 3: Specify Center and Dimensions (for Jupyter Notebook)
200
- Choose the width and height in meters and select the center point on the map.
201
-
202
- ```python
203
- from voxcity.geoprocessor.draw import center_location_map_cityname
204
-
205
- width = 500
206
- height = 500
207
- m, rectangle_vertices = center_location_map_cityname(cityname, width, height, zoom=15)
208
- m
209
- ```
210
- <p align="center">
211
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/draw_rect.png" alt="Draw Rectangle on Map GUI" width="400">
212
- </p>
213
-
214
- ### 3. Set Parameters
215
-
216
- Define data sources and mesh size (m):
217
-
218
- ```python
219
- building_source = 'OpenStreetMap' # Building footprint and height data source
220
- land_cover_source = 'OpenStreetMap' # Land cover classification data source
221
- canopy_height_source = 'High Resolution 1m Global Canopy Height Maps' # Tree canopy height data source
222
- dem_source = 'DeltaDTM' # Digital elevation model data source
223
- meshsize = 5 # Grid cell size in meters
224
-
225
- kwargs = {
226
- "output_dir": "output", # Directory to save output files
227
- "dem_interpolation": True # Enable DEM interpolation
228
- }
229
- ```
230
-
231
- ### 4. Get voxcity Output
232
-
233
- Generate voxel data grids and corresponding building geoJSON:
234
-
235
- ```python
236
- from voxcity.generator import get_voxcity
237
-
238
- voxcity_grid, building_height_grid, building_min_height_grid, \
239
- building_id_grid, canopy_height_grid, land_cover_grid, dem_grid, \
240
- building_gdf = get_voxcity(
241
- rectangle_vertices,
242
- building_source,
243
- land_cover_source,
244
- canopy_height_source,
245
- dem_source,
246
- meshsize,
247
- **kwargs
248
- )
249
- ```
250
-
251
- ### 5. Exporting Files
252
-
253
- #### ENVI-MET INX/EDB Files:
254
- [ENVI-MET](https://www.envi-met.com/) is an advanced microclimate simulation software specialized in modeling urban environments. It simulates the interactions between buildings, vegetation, and various climate parameters like temperature, wind flow, humidity, and radiation. The software is used widely in urban planning, architecture, and environmental studies (Commercial, offers educational licenses).
255
-
256
- ```python
257
- from voxcity.exporter.envimet import export_inx, generate_edb_file
258
-
259
- envimet_kwargs = {
260
- "output_directory": "output", # Directory where output files will be saved
261
- "author_name": "your name", # Name of the model author
262
- "model_description": "generated with voxcity", # Description text for the model
263
- "domain_building_max_height_ratio": 2, # Maximum ratio between domain height and tallest building height
264
- "useTelescoping_grid": True, # Enable telescoping grid for better computational efficiency
265
- "verticalStretch": 20, # Vertical grid stretching factor (%)
266
- "min_grids_Z": 20, # Minimum number of vertical grid cells
267
- "lad": 1.0 # Leaf Area Density (m2/m3) for vegetation modeling
268
- }
269
-
270
- export_inx(building_height_grid, building_id_grid, canopy_height_grid, land_cover_grid, dem_grid, meshsize, land_cover_source, rectangle_vertices, **envimet_kwargs)
271
- generate_edb_file(**envimet_kwargs)
272
- ```
273
- <p align="center">
274
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/envimet.png" alt="Generated 3D City Model on Envi-MET GUI" width="600">
275
- </p>
276
- <p align="center">
277
- <em>Example Output Exported in INX and Inported in ENVI-met</em>
278
- </p>
279
-
280
- #### OBJ Files:
281
-
282
- ```python
283
- from voxcity.exporter.obj import export_obj
284
-
285
- output_directory = "output" # Directory where output files will be saved
286
- output_file_name = "voxcity" # Base name for the output OBJ file
287
- export_obj(voxcity_grid, output_directory, output_file_name, meshsize)
288
- ```
289
- The generated OBJ files can be opened and rendered in the following 3D visualization software:
290
-
291
- - [Twinmotion](https://www.twinmotion.com/): Real-time visualization tool (Free for personal use)
292
- - [Blender](https://www.blender.org/): Professional-grade 3D creation suite (Free)
293
- - [Rhino](https://www.rhino3d.com/): Professional 3D modeling software (Commercial, offers educational licenses)
294
-
295
- <p align="center">
296
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/obj.png" alt="OBJ 3D City Model Rendered in Rhino" width="600">
297
- </p>
298
- <p align="center">
299
- <em>Example Output Exported in OBJ and Rendered in Rhino</em>
300
- </p>
301
-
302
- #### MagicaVoxel VOX Files:
303
-
304
- [MagicaVoxel](https://ephtracy.github.io/) is a lightweight and user-friendly voxel art editor. It allows users to create, edit, and render voxel-based 3D models with an intuitive interface, making it perfect for modifying and visualizing voxelized city models. The software is free and available for Windows and Mac.
305
-
306
- ```python
307
- from voxcity.exporter.magicavoxel import export_magicavoxel_vox
308
-
309
- output_path = "output"
310
- base_filename = "voxcity"
311
- export_magicavoxel_vox(voxcity_grid, output_path, base_filename=base_filename)
312
- ```
313
- <p align="center">
314
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/vox.png" alt="Generated 3D City Model on MagicaVoxel GUI" width="600">
315
- </p>
316
- <p align="center">
317
- <em>Example Output Exported in VOX and Rendered in MagicaVoxel</em>
318
- </p>
319
-
320
- ### 6. Additional Use Cases
321
-
322
- #### Compute Solar Irradiance:
323
-
324
- ```python
325
- from voxcity.simulator.solar import get_global_solar_irradiance_using_epw
326
-
327
- solar_kwargs = {
328
- "download_nearest_epw": True, # Whether to automatically download nearest EPW weather file based on location from Climate.OneBuilding.Org
329
- "rectangle_vertices": rectangle_vertices, # Coordinates defining the area of interest for calculation
330
- # "epw_file_path": "./output/new.york-downtown.manhattan.heli_ny_usa_1.epw", # Path to EnergyPlus Weather (EPW) file containing climate data. Set if you already have an EPW file.
331
- "calc_time": "01-01 12:00:00", # Time for instantaneous calculation in format "MM-DD HH:MM:SS"
332
- "view_point_height": 1.5, # Height of view point in meters for calculating solar access. Default: 1.5 m
333
- "tree_k": 0.6, # Static extinction coefficient - controls how much sunlight is blocked by trees (higher = more blocking)
334
- "tree_lad": 1.0, # Leaf area density of trees - density of leaves/branches that affect shading (higher = denser foliage)
335
- "dem_grid": dem_grid, # Digital elevation model grid for terrain heights
336
- "colormap": 'magma', # Matplotlib colormap for visualization. Default: 'viridis'
337
- "obj_export": True, # Whether to export results as 3D OBJ file
338
- "output_directory": 'output/test', # Directory for saving output files
339
- "output_file_name": 'instantaneous_solar_irradiance', # Base filename for outputs (without extension)
340
- "alpha": 1.0, # Transparency of visualization (0.0-1.0)
341
- "vmin": 0, # Minimum value for colormap scaling in visualization
342
- # "vmax": 900, # Maximum value for colormap scaling in visualization
343
- }
344
-
345
- # Compute global solar irradiance map (direct + diffuse radiation)
346
- solar_grid = get_global_solar_irradiance_using_epw(
347
- voxcity_grid, # 3D voxel grid representing the urban environment
348
- meshsize, # Size of each voxel in meters
349
- calc_type='instantaneous', # Calculate instantaneous irradiance at specified time
350
- direct_normal_irradiance_scaling=1.0, # Scaling factor for direct solar radiation (1.0 = no scaling)
351
- diffuse_irradiance_scaling=1.0, # Scaling factor for diffuse solar radiation (1.0 = no scaling)
352
- **solar_kwargs # Pass all the parameters defined above
353
- )
354
-
355
- # Adjust parameters for cumulative calculation
356
- solar_kwargs["start_time"] = "01-01 01:00:00" # Start time for cumulative calculation
357
- solar_kwargs["end_time"] = "01-31 23:00:00" # End time for cumulative calculation
358
- solar_kwargs["output_file_name"] = 'cummulative_solar_irradiance', # Base filename for outputs (without extension)
359
-
360
- # Calculate cumulative solar irradiance over the specified time period
361
- cum_solar_grid = get_global_solar_irradiance_using_epw(
362
- voxcity_grid, # 3D voxel grid representing the urban environment
363
- meshsize, # Size of each voxel in meters
364
- calc_type='cumulative', # Calculate cumulative irradiance over time period instead of instantaneous
365
- direct_normal_irradiance_scaling=1.0, # Scaling factor for direct solar radiation (1.0 = no scaling)
366
- diffuse_irradiance_scaling=1.0, # Scaling factor for diffuse solar radiation (1.0 = no scaling)
367
- **solar_kwargs # Pass all the parameters defined above
368
- )
369
- ```
370
-
371
- <p align="center">
372
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/solar.png" alt="Solar Irradiance Maps Rendered in Rhino" width="800">
373
- </p>
374
- <p align="center">
375
- <em>Example Results Saved as OBJ and Rendered in Rhino</em>
376
- </p>
377
-
378
- #### Compute Green View Index (GVI) and Sky View Index (SVI):
379
-
380
- ```python
381
- from voxcity.simulator.view import get_view_index
382
-
383
- view_kwargs = {
384
- "view_point_height": 1.5, # Height of observer viewpoint in meters
385
- "dem_grid": dem_grid, # Digital elevation model grid
386
- "colormap": "viridis", # Colormap for visualization
387
- "obj_export": True, # Whether to export as OBJ file
388
- "output_directory": "output", # Directory to save output files
389
- "output_file_name": "gvi" # Base filename for outputs
390
- }
391
-
392
- # Compute Green View Index using mode='green'
393
- gvi_grid = get_view_index(voxcity_grid, meshsize, mode='green', **view_kwargs)
394
-
395
- # Adjust parameters for Sky View Index
396
- view_kwargs["colormap"] = "BuPu_r"
397
- view_kwargs["output_file_name"] = "svi"
398
- view_kwargs["elevation_min_degrees"] = 0 # Start ray-tracing from the horizon
399
-
400
- # Compute Sky View Index using mode='sky'
401
- svi_grid = get_view_index(voxcity_grid, meshsize, mode='sky', **view_kwargs)
402
- ```
403
- <p align="center">
404
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/view_index.png" alt="View Index Maps Rendered in Rhino" width="800">
405
- </p>
406
- <p align="center">
407
- <em>Example Results Saved as OBJ and Rendered in Rhino</em>
408
- </p>
409
-
410
- #### Landmark Visibility Map:
411
-
412
- ```python
413
- from voxcity.simulator.view import get_landmark_visibility_map
414
-
415
- # Dictionary of parameters for landmark visibility analysis
416
- landmark_kwargs = {
417
- "view_point_height": 1.5, # Height of observer viewpoint in meters
418
- "rectangle_vertices": rectangle_vertices, # Vertices defining simulation domain boundary
419
- "dem_grid": dem_grid, # Digital elevation model grid
420
- "colormap": "cool", # Colormap for visualization
421
- "obj_export": True, # Whether to export as OBJ file
422
- "output_directory": "output", # Directory to save output files
423
- "output_file_name": "landmark_visibility" # Base filename for outputs
424
- }
425
- landmark_vis_map = get_landmark_visibility_map(voxcity_grid, building_id_grid, building_gdf, meshsize, **landmark_kwargs)
426
- ```
427
- <p align="center">
428
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/landmark.png" alt="Landmark Visibility Map Rendered in Rhino" width="500">
429
- </p>
430
- <p align="center">
431
- <em>Example Result Saved as OBJ and Rendered in Rhino</em>
432
- </p>
433
-
434
- #### Network Analysis:
435
-
436
- ```python
437
- from voxcity.geoprocessor.network import get_network_values
438
-
439
- network_kwargs = {
440
- "network_type": "walk", # Type of network to download from OSM (walk, drive, all, etc.)
441
- "colormap": "magma", # Matplotlib colormap for visualization
442
- "vis_graph": True, # Whether to display the network visualization
443
- "vmin": 0.0, # Minimum value for color scaling
444
- "vmax": 600000, # Maximum value for color scaling
445
- "edge_width": 2, # Width of network edges in visualization
446
- "alpha": 0.8, # Transparency of network edges
447
- "zoom": 16 # Zoom level for basemap
448
- }
449
-
450
- G, edge_gdf = get_network_values(
451
- cum_solar_grid, # Grid of cumulative solar irradiance values
452
- rectangle_vertices, # Coordinates defining simulation domain boundary
453
- meshsize, # Size of each grid cell in meters
454
- value_name='Cumulative Global Solar Irradiance (W/m²·hour)', # Label for values in visualization
455
- **network_kwargs # Additional visualization and network parameters
456
- )
457
- ```
458
-
459
- <p align="center">
460
- <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/network.png" alt="Example of Graph Output" width="500">
461
- </p>
462
- <p align="center">
463
- <em>Cumulative Global Solar Irradiance (kW/m²·hour) on Road Network</em>
464
- </p>
465
-
466
- ## References of Data Sources
467
-
468
- ### Building
469
-
470
- | Dataset | Spatial Coverage | Source/Data Acquisition |
471
- |---------|------------------|------------------------|
472
- | [OpenStreetMap](https://www.openstreetmap.org) | Worldwide (24% completeness in city centers) | Volunteered / updated continuously |
473
- | [Microsoft Building Footprints](https://github.com/microsoft/GlobalMLBuildingFootprints) | North America, Europe, Australia | Prediction from satellite or aerial imagery / 2018-2019 for majority of the input imagery |
474
- | [Open Buildings 2.5D Temporal Dataset](https://sites.research.google/gr/open-buildings/temporal/) | Africa, Latin America, and South and Southeast Asia | Prediction from satellite imagery / 2016-2023 |
475
- | [EUBUCCO v0.1](https://eubucco.com/) | 27 EU countries and Switzerland (378 regions and 40,829 cities) | OpenStreetMap, government datasets / 2003-2021 (majority is after 2019) |
476
- | [UT-GLOBUS](https://zenodo.org/records/11156602) | Worldwide (more than 1200 cities or locales) | Prediction from building footprints, population, spaceborne nDSM / not provided |
477
- | [Overture Maps](https://overturemaps.org/) | Worldwide | OpenStreetMap, Esri Community Maps Program, Google Open Buildings, etc. / updated continuously |
478
-
479
- ### Tree Canopy Height
480
-
481
- | Dataset | Coverage | Resolution | Source/Data Acquisition |
482
- |---------|-----------|------------|------------------------|
483
- | [High Resolution 1m Global Canopy Height Maps](https://sustainability.atmeta.com/blog/2024/04/22/using-artificial-intelligence-to-map-the-earths-forests/) | Worldwide | 1 m | Prediction from satellite imagery / 2009 and 2020 (80% are 2018-2020) |
484
- | [ETH Global Sentinel-2 10m Canopy Height (2020)](https://langnico.github.io/globalcanopyheight/) | Worldwide | 10 m | Prediction from satellite imagery / 2020 |
485
-
486
- ### Land Cover
487
-
488
- | Dataset | Spatial Coverage | Resolution | Source/Data Acquisition |
489
- |---------|------------------|------------|----------------------|
490
- | [ESA World Cover 10m 2021 V200](https://zenodo.org/records/7254221) | Worldwide | 10 m | Prediction from satellite imagery / 2021 |
491
- | [ESRI 10m Annual Land Cover (2017-2023)](https://www.arcgis.com/home/item.html?id=cfcb7609de5f478eb7666240902d4d3d) | Worldwide | 10 m | Prediction from satellite imagery / 2017-2023 |
492
- | [Dynamic World V1](https://dynamicworld.app) | Worldwide | 10 m | Prediction from satellite imagery / updated continuously |
493
- | [OpenStreetMap](https://www.openstreetmap.org) | Worldwide | - (Vector) | Volunteered / updated continuously |
494
- | [OpenEarthMap Japan](https://www.open-earth-map.org/demo/Japan/leaflet.html) | Japan | ~1 m | Prediction from aerial imagery / 1974-2022 (mostly after 2018 in major cities) |
495
- | [UrbanWatch](https://urbanwatch.charlotte.edu/) | 22 major cities in the US | 1 m | Prediction from aerial imagery / 2014–2017 |
496
-
497
- ### Terrain Elevation
498
-
499
- | Dataset | Coverage | Resolution | Source/Data Acquisition |
500
- |---------|-----------|------------|------------------------|
501
- | [FABDEM](https://doi.org/10.5523/bris.25wfy0f9ukoge2gs7a5mqpq2j7) | Worldwide | 30 m | Correction of Copernicus DEM using canopy height and building footprints data / 2011-2015 (Copernicus DEM) |
502
- | [DeltaDTM](https://gee-community-catalog.org/projects/delta_dtm/) | Worldwide (Only for coastal areas below 10m + mean sea level) | 30 m | Copernicus DEM, spaceborne LiDAR / 2011-2015 (Copernicus DEM) |
503
- | [USGS 3DEP 1m DEM](https://www.usgs.gov/3d-elevation-program) | United States | 1 m | Aerial LiDAR / 2004-2024 (mostly after 2015) |
504
- | [England 1m Composite DTM](https://environment.data.gov.uk/dataset/13787b9a-26a4-4775-8523-806d13af58fc) | England | 1 m | Aerial LiDAR / 2000-2022 |
505
- | [Australian 5M DEM](https://ecat.ga.gov.au/geonetwork/srv/eng/catalog.search#/metadata/89644) | Australia | 5 m | Aerial LiDAR / 2001-2015 |
506
- | [RGE Alti](https://geoservices.ign.fr/rgealti) | France | 1 m | Aerial LiDAR |
507
-
508
-
509
- ## Citation
510
-
511
- Please cite the [paper](https://doi.org/10.48550/arXiv.2504.13934) if you use `voxcity` in a scientific publication:
512
-
513
- Fujiwara K, Tsurumi R, Kiyono T, Fan Z, Liang X, Lei B, Yap W, Ito K, Biljecki F. VoxCity: A Seamless Framework for Open Geospatial Data Integration, Grid-Based Semantic 3D City Model Generation, and Urban Environment Simulation. arXiv preprint arXiv:2504.13934. 2025.
514
-
515
- ```bibtex
516
- @article{fujiwara2025voxcity,
517
- title={VoxCity: A Seamless Framework for Open Geospatial Data Integration, Grid-Based Semantic 3D City Model Generation, and Urban Environment Simulation},
518
- author={Fujiwara, Kunihiko and Tsurumi, Ryuta and Kiyono, Tomoki and Fan, Zicheng and Liang, Xiucheng and Lei, Binyu and Yap, Winston and Ito, Koichi and Biljecki, Filip},
519
- journal={arXiv preprint arXiv:2504.13934},
520
- year={2025},
521
- doi = {10.48550/arXiv.2504.13934},
522
- }
523
- ```
524
-
525
- ## Credit
526
-
527
- This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [`audreyr/cookiecutter-pypackage`](https://github.com/audreyr/cookiecutter-pypackage) project template.
528
-
529
- --------------------------------------------------------------------------------
530
- <br>
531
- <br>
532
- <p align="center">
533
- <a href="https://ual.sg/">
534
- <img src="https://raw.githubusercontent.com/winstonyym/urbanity/main/images/ualsg.jpeg" width = 55% alt="Logo">
535
- </a>
536
- </p>
537
-
1
+ Metadata-Version: 2.3
2
+ Name: voxcity
3
+ Version: 0.6.6
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
+ License: MIT
6
+ Author: Kunihiko Fujiwara
7
+ Author-email: fujiwara.kunihiko@takenaka.co.jp
8
+ Maintainer: Kunihiko Fujiwara
9
+ Maintainer-email: fujiwara.kunihiko@takenaka.co.jp
10
+ Requires-Python: >=3.10,<3.13
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Dist: IPython
17
+ Requires-Dist: affine
18
+ Requires-Dist: astral
19
+ Requires-Dist: contextily
20
+ Requires-Dist: earthengine-api
21
+ Requires-Dist: fiona
22
+ Requires-Dist: gdown
23
+ Requires-Dist: geemap
24
+ Requires-Dist: geopandas
25
+ Requires-Dist: geopy
26
+ Requires-Dist: ipyleaflet
27
+ Requires-Dist: joblib
28
+ Requires-Dist: lxml
29
+ Requires-Dist: matplotlib
30
+ Requires-Dist: numba
31
+ Requires-Dist: numpy
32
+ Requires-Dist: osmnx
33
+ Requires-Dist: overturemaps
34
+ Requires-Dist: pandas
35
+ Requires-Dist: plotly
36
+ Requires-Dist: protobuf
37
+ Requires-Dist: py-vox-io
38
+ Requires-Dist: pycountry
39
+ Requires-Dist: pyproj
40
+ Requires-Dist: pyvista
41
+ Requires-Dist: rasterio (==1.3.11)
42
+ Requires-Dist: requests
43
+ Requires-Dist: reverse_geocoder
44
+ Requires-Dist: rio-cogeo
45
+ Requires-Dist: rtree
46
+ Requires-Dist: scikit-learn
47
+ Requires-Dist: scipy
48
+ Requires-Dist: seaborn
49
+ Requires-Dist: shapely
50
+ Requires-Dist: timezonefinder
51
+ Requires-Dist: tqdm
52
+ Requires-Dist: trimesh
53
+ Requires-Dist: typer
54
+ Project-URL: bugs, https://github.com/kunifujiwara/voxcity/issues
55
+ Project-URL: changelog, https://github.com/kunifujiwara/voxcity/blob/master/changelog.md
56
+ Project-URL: homepage, https://github.com/kunifujiwara/voxcity
57
+ Description-Content-Type: text/markdown
58
+
59
+ [![PyPi version](https://img.shields.io/pypi/v/voxcity.svg)](https://pypi.python.org/pypi/voxcity)
60
+ [![Python versions](https://img.shields.io/pypi/pyversions/voxcity.svg)](https://pypi.org/project/voxcity/)
61
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing)
62
+ [![License](https://img.shields.io/pypi/l/voxcity.svg)](https://pypi.org/project/voxcity/)
63
+ [![Downloads](https://pepy.tech/badge/voxcity)](https://pepy.tech/project/voxcity)
64
+ [![Documentation Status](https://readthedocs.org/projects/voxcity/badge/?version=latest)](https://voxcity.readthedocs.io/en/latest/?badge=latest)
65
+ <!-- [![License: CC BY-SA 4.0](https://licensebuttons.net/l/by-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-sa/4.0/) -->
66
+
67
+ <p align="center">
68
+ Tutorial preview: <a href="https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing">[Google Colab]</a> | Documentation: <a href="https://voxcity.readthedocs.io/en/latest">[Read the Docs]</a>
69
+ </p>
70
+
71
+ <p align="center">
72
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/logo.png" alt="Voxcity logo" width="550">
73
+ </p>
74
+
75
+ # VoxCity
76
+
77
+ **voxcity** is a Python package that provides a seamless solution for grid-based 3D city model generation and urban simulation for cities worldwide. VoxCity's generator module automatically downloads building heights, tree canopy heights, land cover, and terrain elevation within a specified target area, and voxelizes buildings, trees, land cover, and terrain to generate an integrated voxel city model. The simulator module enables users to conduct environmental simulations, including solar radiation and view index analyses. Users can export the generated models using several file formats compatible with external software, such as ENVI-met (INX), Blender, and Rhino (OBJ). Try it out using the [Google Colab Demo](https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing) or your local environment. For detailed documentation, API reference, and tutorials, visit our [Read the Docs](https://voxcity.readthedocs.io/en/latest) page.
78
+
79
+ <!-- <p align="center">
80
+ <picture>
81
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/kunifujiwara/VoxCity/blob/main/images/concept.png">
82
+ <img src="https://github.com/kunifujiwara/VoxCity/blob/main/images/concept.png" alt="Conceptual Diagram of voxcity" width="800">
83
+ </picture>
84
+ </p> -->
85
+ <p align="center">
86
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/concept.png" alt="Conceptual Diagram of voxcity" width="800">
87
+ </p>
88
+
89
+
90
+ ## Key Features
91
+
92
+ - **Integration of Multiple Data Sources:**
93
+ Combines building footprints, land cover data, canopy height maps, and DEMs to generate a consistent 3D voxel representation of an urban scene.
94
+
95
+ - **Flexible Input Sources:**
96
+ Supports various building and terrain data sources including:
97
+ - Building Footprints: OpenStreetMap, Overture, EUBUCCO, Microsoft Building Footprints, Open Building 2.5D
98
+ - Land Cover: UrbanWatch, OpenEarthMap Japan, ESA WorldCover, ESRI Land Cover, Dynamic World, OpenStreetMap
99
+ - Canopy Height: High Resolution 1m Global Canopy Height Maps, ETH Global Sentinel-2 10m
100
+ - DEM: DeltaDTM, FABDEM, NASA, COPERNICUS, and more
101
+
102
+ *Detailed information about each data source can be found in the [References of Data Sources](#references-of-data-sources) section.*
103
+
104
+ - **Customizable Domain and Resolution:**
105
+ Easily define a target area by drawing a rectangle on a map or specifying center coordinates and dimensions. Adjust the mesh size to meet resolution needs.
106
+
107
+ - **Integration with Earth Engine:**
108
+ Leverages Google Earth Engine for large-scale geospatial data processing (authentication and project setup required).
109
+
110
+ - **Output Formats:**
111
+ - **ENVI-MET**: Export INX and EDB files suitable for ENVI-MET microclimate simulations.
112
+ - **MagicaVoxel**: Export vox files for 3D editing and visualization in MagicaVoxel.
113
+ - **OBJ**: Export wavefront OBJ for rendering and integration into other workflows.
114
+
115
+ - **Analytical Tools:**
116
+ - **View Index Simulations**: Compute sky view index (SVI) and green view index (GVI) from a specified viewpoint.
117
+ - **Landmark Visibility Maps**: Assess the visibility of selected landmarks within the voxelized environment.
118
+
119
+ ## Installation
120
+
121
+ Make sure you have Python 3.12 installed. Install voxcity with:
122
+
123
+ ### For Local Environment
124
+
125
+ ```bash
126
+ conda create --name voxcity python=3.12
127
+ conda activate voxcity
128
+ conda install -c conda-forge gdal
129
+ pip install voxcity
130
+ ```
131
+
132
+ ### For Google Colab
133
+
134
+ ```python
135
+ !pip install voxcity
136
+ ```
137
+
138
+ ## Setup for Earth Engine
139
+
140
+ To use Earth Engine data, set up your Earth Engine enabled Cloud Project by following the instructions here:
141
+ https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup
142
+
143
+ After setting up, authenticate and initialize Earth Engine:
144
+
145
+ ### For Local Environment
146
+
147
+ ```bash
148
+ earthengine authenticate
149
+ ```
150
+
151
+ ### For Google Colab
152
+
153
+ ```python
154
+ # Click displayed link, generate token, copy and paste the token
155
+ !earthengine authenticate --auth_mode=notebook
156
+ ```
157
+
158
+ ## Usage Overview
159
+
160
+ ### 1. Authenticate Earth Engine
161
+
162
+ ```python
163
+ import ee
164
+ ee.Authenticate()
165
+ ee.Initialize(project='your-project-id')
166
+ ```
167
+
168
+ ### 2. Define Target Area
169
+
170
+ You can define your target area in three ways:
171
+
172
+ #### Option 1: Direct Coordinate Input
173
+ Define the target area by directly specifying the coordinates of the rectangle vertices.
174
+
175
+ ```python
176
+ rectangle_vertices = [
177
+ (-122.33587348582083, 47.59830044521263), # Southwest corner (longitude, latitude)
178
+ (-122.33587348582083, 47.60279755390168), # Northwest corner (longitude, latitude)
179
+ (-122.32922451417917, 47.60279755390168), # Northeast corner (longitude, latitude)
180
+ (-122.32922451417917, 47.59830044521263) # Southeast corner (longitude, latitude)
181
+ ]
182
+ ```
183
+
184
+ #### Option 2: Draw a Rectangle (for Jupyter Notebook)
185
+ Use the GUI map interface to draw a rectangular domain of interest.
186
+
187
+ ```python
188
+ from voxcity.geoprocessor.draw import draw_rectangle_map_cityname
189
+
190
+ cityname = "tokyo"
191
+ m, rectangle_vertices = draw_rectangle_map_cityname(cityname, zoom=15)
192
+ m
193
+ ```
194
+
195
+ #### Option 3: Specify Center and Dimensions (for Jupyter Notebook)
196
+ Choose the width and height in meters and select the center point on the map.
197
+
198
+ ```python
199
+ from voxcity.geoprocessor.draw import center_location_map_cityname
200
+
201
+ width = 500
202
+ height = 500
203
+ m, rectangle_vertices = center_location_map_cityname(cityname, width, height, zoom=15)
204
+ m
205
+ ```
206
+ <p align="center">
207
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/draw_rect.png" alt="Draw Rectangle on Map GUI" width="400">
208
+ </p>
209
+
210
+ ### 3. Set Parameters
211
+
212
+ Define data sources and mesh size (m):
213
+
214
+ ```python
215
+ building_source = 'OpenStreetMap' # Building footprint and height data source
216
+ land_cover_source = 'OpenStreetMap' # Land cover classification data source
217
+ canopy_height_source = 'High Resolution 1m Global Canopy Height Maps' # Tree canopy height data source
218
+ dem_source = 'DeltaDTM' # Digital elevation model data source
219
+ meshsize = 5 # Grid cell size in meters
220
+
221
+ kwargs = {
222
+ "output_dir": "output", # Directory to save output files
223
+ "dem_interpolation": True # Enable DEM interpolation
224
+ }
225
+ ```
226
+
227
+ ### 4. Get voxcity Output
228
+
229
+ Generate voxel data grids and corresponding building geoJSON:
230
+
231
+ ```python
232
+ from voxcity.generator import get_voxcity
233
+
234
+ voxcity_grid, building_height_grid, building_min_height_grid, \
235
+ building_id_grid, canopy_height_grid, land_cover_grid, dem_grid, \
236
+ building_gdf = get_voxcity(
237
+ rectangle_vertices,
238
+ building_source,
239
+ land_cover_source,
240
+ canopy_height_source,
241
+ dem_source,
242
+ meshsize,
243
+ **kwargs
244
+ )
245
+ ```
246
+
247
+ ### 5. Exporting Files
248
+
249
+ #### ENVI-MET INX/EDB Files:
250
+ [ENVI-MET](https://www.envi-met.com/) is an advanced microclimate simulation software specialized in modeling urban environments. It simulates the interactions between buildings, vegetation, and various climate parameters like temperature, wind flow, humidity, and radiation. The software is used widely in urban planning, architecture, and environmental studies (Commercial, offers educational licenses).
251
+
252
+ ```python
253
+ from voxcity.exporter.envimet import export_inx, generate_edb_file
254
+
255
+ envimet_kwargs = {
256
+ "output_directory": "output", # Directory where output files will be saved
257
+ "author_name": "your name", # Name of the model author
258
+ "model_description": "generated with voxcity", # Description text for the model
259
+ "domain_building_max_height_ratio": 2, # Maximum ratio between domain height and tallest building height
260
+ "useTelescoping_grid": True, # Enable telescoping grid for better computational efficiency
261
+ "verticalStretch": 20, # Vertical grid stretching factor (%)
262
+ "min_grids_Z": 20, # Minimum number of vertical grid cells
263
+ "lad": 1.0 # Leaf Area Density (m2/m3) for vegetation modeling
264
+ }
265
+
266
+ export_inx(building_height_grid, building_id_grid, canopy_height_grid, land_cover_grid, dem_grid, meshsize, land_cover_source, rectangle_vertices, **envimet_kwargs)
267
+ generate_edb_file(**envimet_kwargs)
268
+ ```
269
+ <p align="center">
270
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/envimet.png" alt="Generated 3D City Model on Envi-MET GUI" width="600">
271
+ </p>
272
+ <p align="center">
273
+ <em>Example Output Exported in INX and Inported in ENVI-met</em>
274
+ </p>
275
+
276
+ #### OBJ Files:
277
+
278
+ ```python
279
+ from voxcity.exporter.obj import export_obj
280
+
281
+ output_directory = "output" # Directory where output files will be saved
282
+ output_file_name = "voxcity" # Base name for the output OBJ file
283
+ export_obj(voxcity_grid, output_directory, output_file_name, meshsize)
284
+ ```
285
+ The generated OBJ files can be opened and rendered in the following 3D visualization software:
286
+
287
+ - [Twinmotion](https://www.twinmotion.com/): Real-time visualization tool (Free for personal use)
288
+ - [Blender](https://www.blender.org/): Professional-grade 3D creation suite (Free)
289
+ - [Rhino](https://www.rhino3d.com/): Professional 3D modeling software (Commercial, offers educational licenses)
290
+
291
+ <p align="center">
292
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/obj.png" alt="OBJ 3D City Model Rendered in Rhino" width="600">
293
+ </p>
294
+ <p align="center">
295
+ <em>Example Output Exported in OBJ and Rendered in Rhino</em>
296
+ </p>
297
+
298
+ #### MagicaVoxel VOX Files:
299
+
300
+ [MagicaVoxel](https://ephtracy.github.io/) is a lightweight and user-friendly voxel art editor. It allows users to create, edit, and render voxel-based 3D models with an intuitive interface, making it perfect for modifying and visualizing voxelized city models. The software is free and available for Windows and Mac.
301
+
302
+ ```python
303
+ from voxcity.exporter.magicavoxel import export_magicavoxel_vox
304
+
305
+ output_path = "output"
306
+ base_filename = "voxcity"
307
+ export_magicavoxel_vox(voxcity_grid, output_path, base_filename=base_filename)
308
+ ```
309
+ <p align="center">
310
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/vox.png" alt="Generated 3D City Model on MagicaVoxel GUI" width="600">
311
+ </p>
312
+ <p align="center">
313
+ <em>Example Output Exported in VOX and Rendered in MagicaVoxel</em>
314
+ </p>
315
+
316
+ ### 6. Additional Use Cases
317
+
318
+ #### Compute Solar Irradiance:
319
+
320
+ ```python
321
+ from voxcity.simulator.solar import get_global_solar_irradiance_using_epw
322
+
323
+ solar_kwargs = {
324
+ "download_nearest_epw": True, # Whether to automatically download nearest EPW weather file based on location from Climate.OneBuilding.Org
325
+ "rectangle_vertices": rectangle_vertices, # Coordinates defining the area of interest for calculation
326
+ # "epw_file_path": "./output/new.york-downtown.manhattan.heli_ny_usa_1.epw", # Path to EnergyPlus Weather (EPW) file containing climate data. Set if you already have an EPW file.
327
+ "calc_time": "01-01 12:00:00", # Time for instantaneous calculation in format "MM-DD HH:MM:SS"
328
+ "view_point_height": 1.5, # Height of view point in meters for calculating solar access. Default: 1.5 m
329
+ "tree_k": 0.6, # Static extinction coefficient - controls how much sunlight is blocked by trees (higher = more blocking)
330
+ "tree_lad": 1.0, # Leaf area density of trees - density of leaves/branches that affect shading (higher = denser foliage)
331
+ "dem_grid": dem_grid, # Digital elevation model grid for terrain heights
332
+ "colormap": 'magma', # Matplotlib colormap for visualization. Default: 'viridis'
333
+ "obj_export": True, # Whether to export results as 3D OBJ file
334
+ "output_directory": 'output/test', # Directory for saving output files
335
+ "output_file_name": 'instantaneous_solar_irradiance', # Base filename for outputs (without extension)
336
+ "alpha": 1.0, # Transparency of visualization (0.0-1.0)
337
+ "vmin": 0, # Minimum value for colormap scaling in visualization
338
+ # "vmax": 900, # Maximum value for colormap scaling in visualization
339
+ }
340
+
341
+ # Compute global solar irradiance map (direct + diffuse radiation)
342
+ solar_grid = get_global_solar_irradiance_using_epw(
343
+ voxcity_grid, # 3D voxel grid representing the urban environment
344
+ meshsize, # Size of each voxel in meters
345
+ calc_type='instantaneous', # Calculate instantaneous irradiance at specified time
346
+ direct_normal_irradiance_scaling=1.0, # Scaling factor for direct solar radiation (1.0 = no scaling)
347
+ diffuse_irradiance_scaling=1.0, # Scaling factor for diffuse solar radiation (1.0 = no scaling)
348
+ **solar_kwargs # Pass all the parameters defined above
349
+ )
350
+
351
+ # Adjust parameters for cumulative calculation
352
+ solar_kwargs["start_time"] = "01-01 01:00:00" # Start time for cumulative calculation
353
+ solar_kwargs["end_time"] = "01-31 23:00:00" # End time for cumulative calculation
354
+ solar_kwargs["output_file_name"] = 'cummulative_solar_irradiance', # Base filename for outputs (without extension)
355
+
356
+ # Calculate cumulative solar irradiance over the specified time period
357
+ cum_solar_grid = get_global_solar_irradiance_using_epw(
358
+ voxcity_grid, # 3D voxel grid representing the urban environment
359
+ meshsize, # Size of each voxel in meters
360
+ calc_type='cumulative', # Calculate cumulative irradiance over time period instead of instantaneous
361
+ direct_normal_irradiance_scaling=1.0, # Scaling factor for direct solar radiation (1.0 = no scaling)
362
+ diffuse_irradiance_scaling=1.0, # Scaling factor for diffuse solar radiation (1.0 = no scaling)
363
+ **solar_kwargs # Pass all the parameters defined above
364
+ )
365
+ ```
366
+
367
+ <p align="center">
368
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/solar.png" alt="Solar Irradiance Maps Rendered in Rhino" width="800">
369
+ </p>
370
+ <p align="center">
371
+ <em>Example Results Saved as OBJ and Rendered in Rhino</em>
372
+ </p>
373
+
374
+ #### Compute Green View Index (GVI) and Sky View Index (SVI):
375
+
376
+ ```python
377
+ from voxcity.simulator.view import get_view_index
378
+
379
+ view_kwargs = {
380
+ "view_point_height": 1.5, # Height of observer viewpoint in meters
381
+ "dem_grid": dem_grid, # Digital elevation model grid
382
+ "colormap": "viridis", # Colormap for visualization
383
+ "obj_export": True, # Whether to export as OBJ file
384
+ "output_directory": "output", # Directory to save output files
385
+ "output_file_name": "gvi" # Base filename for outputs
386
+ }
387
+
388
+ # Compute Green View Index using mode='green'
389
+ gvi_grid = get_view_index(voxcity_grid, meshsize, mode='green', **view_kwargs)
390
+
391
+ # Adjust parameters for Sky View Index
392
+ view_kwargs["colormap"] = "BuPu_r"
393
+ view_kwargs["output_file_name"] = "svi"
394
+ view_kwargs["elevation_min_degrees"] = 0 # Start ray-tracing from the horizon
395
+
396
+ # Compute Sky View Index using mode='sky'
397
+ svi_grid = get_view_index(voxcity_grid, meshsize, mode='sky', **view_kwargs)
398
+ ```
399
+ <p align="center">
400
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/view_index.png" alt="View Index Maps Rendered in Rhino" width="800">
401
+ </p>
402
+ <p align="center">
403
+ <em>Example Results Saved as OBJ and Rendered in Rhino</em>
404
+ </p>
405
+
406
+ #### Landmark Visibility Map:
407
+
408
+ ```python
409
+ from voxcity.simulator.view import get_landmark_visibility_map
410
+
411
+ # Dictionary of parameters for landmark visibility analysis
412
+ landmark_kwargs = {
413
+ "view_point_height": 1.5, # Height of observer viewpoint in meters
414
+ "rectangle_vertices": rectangle_vertices, # Vertices defining simulation domain boundary
415
+ "dem_grid": dem_grid, # Digital elevation model grid
416
+ "colormap": "cool", # Colormap for visualization
417
+ "obj_export": True, # Whether to export as OBJ file
418
+ "output_directory": "output", # Directory to save output files
419
+ "output_file_name": "landmark_visibility" # Base filename for outputs
420
+ }
421
+ landmark_vis_map = get_landmark_visibility_map(voxcity_grid, building_id_grid, building_gdf, meshsize, **landmark_kwargs)
422
+ ```
423
+ <p align="center">
424
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/landmark.png" alt="Landmark Visibility Map Rendered in Rhino" width="500">
425
+ </p>
426
+ <p align="center">
427
+ <em>Example Result Saved as OBJ and Rendered in Rhino</em>
428
+ </p>
429
+
430
+ #### Network Analysis:
431
+
432
+ ```python
433
+ from voxcity.geoprocessor.network import get_network_values
434
+
435
+ network_kwargs = {
436
+ "network_type": "walk", # Type of network to download from OSM (walk, drive, all, etc.)
437
+ "colormap": "magma", # Matplotlib colormap for visualization
438
+ "vis_graph": True, # Whether to display the network visualization
439
+ "vmin": 0.0, # Minimum value for color scaling
440
+ "vmax": 600000, # Maximum value for color scaling
441
+ "edge_width": 2, # Width of network edges in visualization
442
+ "alpha": 0.8, # Transparency of network edges
443
+ "zoom": 16 # Zoom level for basemap
444
+ }
445
+
446
+ G, edge_gdf = get_network_values(
447
+ cum_solar_grid, # Grid of cumulative solar irradiance values
448
+ rectangle_vertices, # Coordinates defining simulation domain boundary
449
+ meshsize, # Size of each grid cell in meters
450
+ value_name='Cumulative Global Solar Irradiance (W/m²·hour)', # Label for values in visualization
451
+ **network_kwargs # Additional visualization and network parameters
452
+ )
453
+ ```
454
+
455
+ <p align="center">
456
+ <img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/network.png" alt="Example of Graph Output" width="500">
457
+ </p>
458
+ <p align="center">
459
+ <em>Cumulative Global Solar Irradiance (kW/m²·hour) on Road Network</em>
460
+ </p>
461
+
462
+ ## References of Data Sources
463
+
464
+ ### Building
465
+
466
+ | Dataset | Spatial Coverage | Source/Data Acquisition |
467
+ |---------|------------------|------------------------|
468
+ | [OpenStreetMap](https://www.openstreetmap.org) | Worldwide (24% completeness in city centers) | Volunteered / updated continuously |
469
+ | [Microsoft Building Footprints](https://github.com/microsoft/GlobalMLBuildingFootprints) | North America, Europe, Australia | Prediction from satellite or aerial imagery / 2018-2019 for majority of the input imagery |
470
+ | [Open Buildings 2.5D Temporal Dataset](https://sites.research.google/gr/open-buildings/temporal/) | Africa, Latin America, and South and Southeast Asia | Prediction from satellite imagery / 2016-2023 |
471
+ | [EUBUCCO v0.1](https://eubucco.com/) | 27 EU countries and Switzerland (378 regions and 40,829 cities) | OpenStreetMap, government datasets / 2003-2021 (majority is after 2019) |
472
+ | [UT-GLOBUS](https://zenodo.org/records/11156602) | Worldwide (more than 1200 cities or locales) | Prediction from building footprints, population, spaceborne nDSM / not provided |
473
+ | [Overture Maps](https://overturemaps.org/) | Worldwide | OpenStreetMap, Esri Community Maps Program, Google Open Buildings, etc. / updated continuously |
474
+
475
+ ### Tree Canopy Height
476
+
477
+ | Dataset | Coverage | Resolution | Source/Data Acquisition |
478
+ |---------|-----------|------------|------------------------|
479
+ | [High Resolution 1m Global Canopy Height Maps](https://sustainability.atmeta.com/blog/2024/04/22/using-artificial-intelligence-to-map-the-earths-forests/) | Worldwide | 1 m | Prediction from satellite imagery / 2009 and 2020 (80% are 2018-2020) |
480
+ | [ETH Global Sentinel-2 10m Canopy Height (2020)](https://langnico.github.io/globalcanopyheight/) | Worldwide | 10 m | Prediction from satellite imagery / 2020 |
481
+
482
+ ### Land Cover
483
+
484
+ | Dataset | Spatial Coverage | Resolution | Source/Data Acquisition |
485
+ |---------|------------------|------------|----------------------|
486
+ | [ESA World Cover 10m 2021 V200](https://zenodo.org/records/7254221) | Worldwide | 10 m | Prediction from satellite imagery / 2021 |
487
+ | [ESRI 10m Annual Land Cover (2017-2023)](https://www.arcgis.com/home/item.html?id=cfcb7609de5f478eb7666240902d4d3d) | Worldwide | 10 m | Prediction from satellite imagery / 2017-2023 |
488
+ | [Dynamic World V1](https://dynamicworld.app) | Worldwide | 10 m | Prediction from satellite imagery / updated continuously |
489
+ | [OpenStreetMap](https://www.openstreetmap.org) | Worldwide | - (Vector) | Volunteered / updated continuously |
490
+ | [OpenEarthMap Japan](https://www.open-earth-map.org/demo/Japan/leaflet.html) | Japan | ~1 m | Prediction from aerial imagery / 1974-2022 (mostly after 2018 in major cities) |
491
+ | [UrbanWatch](https://urbanwatch.charlotte.edu/) | 22 major cities in the US | 1 m | Prediction from aerial imagery / 2014–2017 |
492
+
493
+ ### Terrain Elevation
494
+
495
+ | Dataset | Coverage | Resolution | Source/Data Acquisition |
496
+ |---------|-----------|------------|------------------------|
497
+ | [FABDEM](https://doi.org/10.5523/bris.25wfy0f9ukoge2gs7a5mqpq2j7) | Worldwide | 30 m | Correction of Copernicus DEM using canopy height and building footprints data / 2011-2015 (Copernicus DEM) |
498
+ | [DeltaDTM](https://gee-community-catalog.org/projects/delta_dtm/) | Worldwide (Only for coastal areas below 10m + mean sea level) | 30 m | Copernicus DEM, spaceborne LiDAR / 2011-2015 (Copernicus DEM) |
499
+ | [USGS 3DEP 1m DEM](https://www.usgs.gov/3d-elevation-program) | United States | 1 m | Aerial LiDAR / 2004-2024 (mostly after 2015) |
500
+ | [England 1m Composite DTM](https://environment.data.gov.uk/dataset/13787b9a-26a4-4775-8523-806d13af58fc) | England | 1 m | Aerial LiDAR / 2000-2022 |
501
+ | [Australian 5M DEM](https://ecat.ga.gov.au/geonetwork/srv/eng/catalog.search#/metadata/89644) | Australia | 5 m | Aerial LiDAR / 2001-2015 |
502
+ | [RGE Alti](https://geoservices.ign.fr/rgealti) | France | 1 m | Aerial LiDAR |
503
+
504
+
505
+ ## Citation
506
+
507
+ Please cite the [paper](https://doi.org/10.48550/arXiv.2504.13934) if you use `voxcity` in a scientific publication:
508
+
509
+ Fujiwara K, Tsurumi R, Kiyono T, Fan Z, Liang X, Lei B, Yap W, Ito K, Biljecki F. VoxCity: A Seamless Framework for Open Geospatial Data Integration, Grid-Based Semantic 3D City Model Generation, and Urban Environment Simulation. arXiv preprint arXiv:2504.13934. 2025.
510
+
511
+ ```bibtex
512
+ @article{fujiwara2025voxcity,
513
+ title={VoxCity: A Seamless Framework for Open Geospatial Data Integration, Grid-Based Semantic 3D City Model Generation, and Urban Environment Simulation},
514
+ author={Fujiwara, Kunihiko and Tsurumi, Ryuta and Kiyono, Tomoki and Fan, Zicheng and Liang, Xiucheng and Lei, Binyu and Yap, Winston and Ito, Koichi and Biljecki, Filip},
515
+ journal={arXiv preprint arXiv:2504.13934},
516
+ year={2025},
517
+ doi = {10.48550/arXiv.2504.13934},
518
+ }
519
+ ```
520
+
521
+ ## Credit
522
+
523
+ This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [`audreyr/cookiecutter-pypackage`](https://github.com/audreyr/cookiecutter-pypackage) project template.
524
+
525
+ --------------------------------------------------------------------------------
526
+ <br>
527
+ <br>
528
+ <p align="center">
529
+ <a href="https://ual.sg/">
530
+ <img src="https://raw.githubusercontent.com/winstonyym/urbanity/main/images/ualsg.jpeg" width = 55% alt="Logo">
531
+ </a>
532
+ </p>
533
+
534
+