zero2geospatial3d-sdk 0.1.1__tar.gz → 0.2.0__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.
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/CHANGELOG.md +27 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/CITATION.cff +5 -4
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/MANIFEST.in +1 -0
- zero2geospatial3d_sdk-0.2.0/PKG-INFO +219 -0
- zero2geospatial3d_sdk-0.2.0/README.md +170 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/pyproject.toml +22 -28
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/__init__.py +1 -1
- zero2geospatial3d_sdk-0.2.0/src/zero2geospatial3d/__main__.py +5 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/osm.py +1 -1
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/server.py +17 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/shading.py +16 -7
- zero2geospatial3d_sdk-0.2.0/src/zero2geospatial3d_sdk.egg-info/PKG-INFO +219 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d_sdk.egg-info/SOURCES.txt +1 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_results_server_cli.py +46 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_shading.py +23 -0
- zero2geospatial3d_sdk-0.1.1/PKG-INFO +0 -219
- zero2geospatial3d_sdk-0.1.1/README.md +0 -175
- zero2geospatial3d_sdk-0.1.1/src/zero2geospatial3d_sdk.egg-info/PKG-INFO +0 -219
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/LICENSE +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/THIRD_PARTY_NOTICES.md +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/setup.cfg +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/acoustics.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/classify.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/cli.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/comfort.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/data/epw_stations.json.gz +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/daylight.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/dispersion.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/epw.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/geo.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/grid.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/microclimate.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/morphology.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/nsga2.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/osm_tags.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/py.typed +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/results.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/road_sources.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/scene.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/solar.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/terrain.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/urban_form.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/walkability.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/weather.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/index.html +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/analysis/climate.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/analysis/compliance.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/analysis/gpu.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/analysis/optimize.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/analysis/runners.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/analysis/terrain_results.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/app.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/acoustics.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/classify.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/comfort.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/daylight_rule.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/dispersion.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/microclimate.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/morphology.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/nsga2.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/party_walls.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/road_sources.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/solar.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/terrain_analysis.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/terrain_math.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/urban_form.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/walkability.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/weather.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/core/wind.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/export/check_pdf.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/export/exporters.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/export/pdf.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/export/snapshot.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/export/snapshot_scene.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/main.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/scene/objects.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/scene/overlay.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/scene/terrain.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/scene/viewer.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/scene/wind_streamlines.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/style.css +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/building_report.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/charts.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/colorize.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/compare.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/dom.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/panel_analyze.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/panel_compare.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/panel_layers.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/panel_terrain.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/qgis_link.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/sunclock.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/tools.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/src/ui/viewtools.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/vendor/three/addons/controls/OrbitControls.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/vendor/three/addons/exporters/GLTFExporter.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/vendor/three/addons/utils/TextureUtils.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/web/vendor/three/three.module.js +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d/wind.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d_sdk.egg-info/dependency_links.txt +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d_sdk.egg-info/entry_points.txt +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d_sdk.egg-info/requires.txt +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/src/zero2geospatial3d_sdk.egg-info/top_level.txt +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_acoustics_dispersion.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_classify.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_comfort.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_core_pure.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_daylight.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_microclimate.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_morphology_wind.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_nsga2.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_osm_scene.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_solar.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_terrain.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_urban_form.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_walkability.py +0 -0
- {zero2geospatial3d_sdk-0.1.1 → zero2geospatial3d_sdk-0.2.0}/tests/test_weather.py +0 -0
|
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.0] - 2026-12-02
|
|
11
|
+
### Added
|
|
12
|
+
- Usage guide (`docs/guide.md`): tasks with their real output (sun hours and BRE 209, a winter shadow study, the canyon sky view factor, yearly irradiation and rooftop PV, outdoor comfort, terrain and earthworks, OpenStreetMap sites) and the method with its formulas and sources.
|
|
13
|
+
- A hero figure of real output (`docs/assets/hero.svg`: shade, sun hours and sky view factor of a synthetic district) and `docs/assets/make_assets.py` to rebuild it.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Releases are signed with PEP 740 attestations from the GitLab pipeline (Trusted Publishing identity), so PyPI shows verified provenance for every file.
|
|
17
|
+
- The PyPI "Documentation" link opens the package page on geophilo.com.
|
|
18
|
+
- README: hero figure, "Why" section, extras table, the quickstart's real output, grouped features, CLI help and a link to the guide. `Natural Language :: English` classifier; `MANIFEST.in` prunes `docs/`.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- `shading.solar_irradiation` and `shading.directional_irradiation` raised `TypeError` when given `weather.annual_sun_bins(...)["directions"]`, as their docstrings suggested, because those entries are `{"dir", "weight"}` mappings rather than pairs. Both now accept either form.
|
|
22
|
+
|
|
23
|
+
## [0.1.2] - 2026-11-15
|
|
24
|
+
### Fixed
|
|
25
|
+
- The viewer server (`serve_scene(..., results_dir=...)`) refuses POST requests sent by a
|
|
26
|
+
page on another origin (HTTP 403). A cross-site "simple" POST needs no CORS preflight,
|
|
27
|
+
so any web page open in the same browser could previously write files into `results_dir`.
|
|
28
|
+
### Added
|
|
29
|
+
- `python -m zero2geospatial3d` runs the command-line tool.
|
|
30
|
+
### Changed
|
|
31
|
+
- Project links, citation metadata, the OSM User-Agent and CI moved to GitLab (gitlab.com/geophilo1/zero2geospatial3d_sdk);
|
|
32
|
+
GitHub workflows removed, GitLab CI pipeline added (Python 3.9, 3.11, 3.13; tagged releases to PyPI).
|
|
33
|
+
- README: GitLab pipeline and downloads badges, absolute links that work on PyPI, related packages.
|
|
34
|
+
- PyPI metadata: refined description and keywords, Education audience classifier,
|
|
35
|
+
Documentation / SDK dashboard / DOI links.
|
|
36
|
+
|
|
10
37
|
## [0.1.1] - 2026-11-08
|
|
11
38
|
### Changed
|
|
12
39
|
- Release archived on Zenodo; no code changes.
|
|
@@ -3,13 +3,14 @@ message: "If you use this software, please cite it as below."
|
|
|
3
3
|
authors:
|
|
4
4
|
- family-names: "Eminoğlu"
|
|
5
5
|
given-names: "Yusuf"
|
|
6
|
-
email: "
|
|
6
|
+
email: "geospacephilo@gmail.com"
|
|
7
7
|
orcid: "https://orcid.org/0009-0005-6000-2934"
|
|
8
8
|
title: "zero2geospatial3d-sdk"
|
|
9
|
-
version: "0.
|
|
10
|
-
date-released: "2026-
|
|
9
|
+
version: "0.2.0"
|
|
10
|
+
date-released: "2026-12-02"
|
|
11
|
+
doi: "10.5281/zenodo.24057137"
|
|
11
12
|
license: "MIT"
|
|
12
|
-
repository-code: "https://
|
|
13
|
+
repository-code: "https://gitlab.com/geophilo1/zero2geospatial3d_sdk"
|
|
13
14
|
url: "https://pypi.org/project/zero2geospatial3d-sdk/"
|
|
14
15
|
abstract: "Headless 3D terrain and building analysis in Python: sun hours, shadows, sky view factor, solar PV, UTCI/PET thermal comfort, wind, noise and air-quality screening, daylight rules, terrain sections, flooding and cut/fill. A numpy port of the 02 Geo3D Analyzer (zero2geospatial3d) QGIS plugin."
|
|
15
16
|
keywords:
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zero2geospatial3d-sdk
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Headless 3D urban and terrain analysis in Python and NumPy: sun hours, shadows, sky view factor, solar PV, UTCI/PET thermal comfort, wind, noise, air quality, flooding and cut/fill.
|
|
5
|
+
Author-email: Yusuf Eminoğlu <geospacephilo@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/geophilo1/zero2geospatial3d_sdk
|
|
8
|
+
Project-URL: Repository, https://gitlab.com/geophilo1/zero2geospatial3d_sdk
|
|
9
|
+
Project-URL: Documentation, https://geophilo.com/sdks/zero2geospatial3d-sdk/
|
|
10
|
+
Project-URL: Issues, https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/work_items
|
|
11
|
+
Project-URL: Changelog, https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/CHANGELOG.md
|
|
12
|
+
Project-URL: SDK dashboard, https://geophilo.com/sdk-dashboard/
|
|
13
|
+
Project-URL: DOI, https://doi.org/10.5281/zenodo.24057137
|
|
14
|
+
Project-URL: QGIS plugin, https://plugins.qgis.org/plugins/zero2geospatial3d/
|
|
15
|
+
Keywords: 3d-city-analysis,urban-climate,sun-hours,shadow-analysis,sky-view-factor,solar-pv,utci,thermal-comfort,wind-comfort,noise-mapping,viewshed,dem,flood,cut-and-fill,urban-planning
|
|
16
|
+
Classifier: Development Status :: 4 - Beta
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Intended Audience :: Education
|
|
20
|
+
Classifier: Environment :: Console
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Programming Language :: Python :: 3
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
30
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
31
|
+
Classifier: Natural Language :: English
|
|
32
|
+
Classifier: Typing :: Typed
|
|
33
|
+
Requires-Python: >=3.9
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
37
|
+
Requires-Dist: numpy>=1.20.0
|
|
38
|
+
Provides-Extra: geo
|
|
39
|
+
Requires-Dist: shapely>=2.0.0; extra == "geo"
|
|
40
|
+
Requires-Dist: rasterio>=1.3.0; extra == "geo"
|
|
41
|
+
Requires-Dist: pyproj>=3.3.0; extra == "geo"
|
|
42
|
+
Requires-Dist: matplotlib>=3.5.0; extra == "geo"
|
|
43
|
+
Provides-Extra: dev
|
|
44
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
45
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
46
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="https://geophilo.com/sdks/zero2geospatial3d-sdk/"><img src="https://geophilo.com/assets/sdk_icons/zero2geospatial3d_sdk.svg" width="120" height="120" alt="zero2geospatial3d-sdk icon"></a>
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
# zero2geospatial3d-sdk
|
|
55
|
+
|
|
56
|
+
[](https://pypi.org/project/zero2geospatial3d-sdk/)
|
|
57
|
+
[](https://pypi.org/project/zero2geospatial3d-sdk/)
|
|
58
|
+
[](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/pipelines)
|
|
59
|
+
[](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/LICENSE)
|
|
60
|
+
[](https://doi.org/10.5281/zenodo.24057137)
|
|
61
|
+
[](https://pepy.tech/project/zero2geospatial3d-sdk)
|
|
62
|
+
|
|
63
|
+
**Headless 3D site analysis in Python on NumPy alone: sun hours and shadows, sky view factor, solar irradiation and PV, UTCI, PET and mean radiant temperature, wind, noise, air quality, BRE 209 daylight, terrain, flooding and cut and fill, with the same mathematics as the 02 Geo3D Analyzer QGIS plugin.**
|
|
64
|
+
|
|
65
|
+
<p align="center"><img src="https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/raw/main/docs/assets/hero.svg" width="820" alt="Three maps of a synthetic district in Izmir on a 2 m grid computed by zero2geospatial3d-sdk: sunlit and shaded ground at 16:00 on 21 March with shadows falling north-east, hours of direct sun on 21 March with the BRE 209 two-hour line drawn north of each block, and the sky view factor of every ground cell"></p>
|
|
66
|
+
|
|
67
|
+
*Real output of `shading.shadow_mask`, `shading.sun_hours` and `shading.sky_view_factor`, rebuilt by [docs/assets/make_assets.py](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/docs/assets/make_assets.py).*
|
|
68
|
+
|
|
69
|
+
## Why zero2geospatial3d-sdk?
|
|
70
|
+
|
|
71
|
+
- **One engine, two front ends.** It is the scriptable engine behind the 02 Geo3D Analyzer QGIS plugin, ported from the plugin's GPU code to NumPy. Scene packages move both ways: a scene exported by the plugin loads in Python, and a scene built in Python opens in the bundled three.js viewer.
|
|
72
|
+
- **Broad and headless.** Sun, shade, sky view, irradiation and PV, outdoor thermal comfort, wind comfort classes, road noise, ventilation and air quality, BRE 209 daylight checks, terrain analysis and multi-objective optimisation run in notebooks, batch jobs, servers and CI, with no QGIS and no GPU.
|
|
73
|
+
- **Checked against references.** The tests reproduce the plugin's numeric assertions: the NREL SPA sun position to within 0.3 degrees, UTCI and PET reference values, BRE 209 closed forms, terrain indices and flood and cut-and-fill volumes. The raster engines are checked against the canyon sky view factor and wall shadow lengths.
|
|
74
|
+
- **One dependency.** NumPy only. GeoTIFF output, map plots and projections come with the optional `geo` extra.
|
|
75
|
+
- **Tested and typed.** 168 tests with 92 % line and branch coverage, a clean mypy run and a `py.typed` marker; CI runs Python 3.9, 3.11 and 3.13.
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install zero2geospatial3d-sdk
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Extra | Adds | For |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `geo` | rasterio, pyproj, shapely, matplotlib | GeoTIFF output, reprojection and plots |
|
|
86
|
+
| `dev` | pytest, pytest-cov, ruff, mypy | running the test suite |
|
|
87
|
+
|
|
88
|
+
Python 3.9 to 3.13. The import name is `zero2geospatial3d`.
|
|
89
|
+
|
|
90
|
+
## Quickstart
|
|
91
|
+
|
|
92
|
+
This runs offline as pasted.
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
import numpy as np
|
|
96
|
+
from zero2geospatial3d import Building, Scene, shading, comfort, terrain
|
|
97
|
+
from zero2geospatial3d.results import aggregate_by_id
|
|
98
|
+
|
|
99
|
+
# A 200 m x 200 m level site in Izmir (UTC+3) with a 2 m grid and two buildings.
|
|
100
|
+
scene = Scene.flat(200, 200, cell=2.0, lat=38.42, lon=27.14, utc_offset=3.0)
|
|
101
|
+
for cx, h in ((-30, 24.0), (30, 12.0)):
|
|
102
|
+
ring = [[cx - 15, -10], [cx + 15, -10], [cx + 15, 10], [cx - 15, 10], [cx - 15, -10]]
|
|
103
|
+
scene.buildings.append(Building([[ring]], height=h))
|
|
104
|
+
|
|
105
|
+
surface = scene.surface() # terrain + buildings as a Grid
|
|
106
|
+
_, ids = scene.building_rasters() # building id per cell (0 = ground)
|
|
107
|
+
|
|
108
|
+
# BRE 209: sun hours on 21 March
|
|
109
|
+
hours = shading.sun_hours(surface, scene.lat, scene.lon, scene.utc_offset, month=3, day=21)
|
|
110
|
+
open_ground = hours[ids == 0]
|
|
111
|
+
print(f"open ground with >= 2 h of sun: {100 * np.mean(open_ground >= 2):.0f} %")
|
|
112
|
+
|
|
113
|
+
# Sky view factor and per-building roof statistics
|
|
114
|
+
svf = shading.sky_view_factor(surface, n_azimuths=16)
|
|
115
|
+
print(aggregate_by_id(ids, svf, cell_area=4.0)[1]["mean"])
|
|
116
|
+
|
|
117
|
+
# Thermal comfort for one set of conditions
|
|
118
|
+
print(comfort.utci(32.0, 55.0, 1.5, 40.0), comfort.pet(32.0, 55.0, 1.5, 40.0))
|
|
119
|
+
|
|
120
|
+
# Terrain: slope, flooding and earthworks on the DEM
|
|
121
|
+
slope, aspect = terrain.slope_aspect(scene.terrain)
|
|
122
|
+
pad = [[-20, -20], [20, -20], [20, 20], [-20, 20], [-20, -20]]
|
|
123
|
+
print(terrain.cut_fill(scene.terrain, pad, design_level=0.5).fill)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
open ground with >= 2 h of sun: 100 %
|
|
128
|
+
1.0
|
|
129
|
+
37.38729250415502 38.94852470455589
|
|
130
|
+
800.0
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## What you can do
|
|
134
|
+
|
|
135
|
+
**Sun, shade and sky** (`shading`, `solar`): `shadow_mask`, `sun_hours`, `shadow_study`, `horizon_angles`, `sky_view_factor`, `viewshed`; `solar_position`, `sunrise_sunset`, `sun_path` and `sky_hemisphere` with the NOAA solar equations.
|
|
136
|
+
|
|
137
|
+
**Solar energy** (`shading`, `weather`, `epw`): `solar_irradiation` (direct, diffuse and reflected), `pv_yield`; EPW files with `read_epw`, `wind_rose` and `monthly_summary`; a clear-sky year with `clear_sky_year`; the nearest TMYx station with `nearest_stations` and `download_station`.
|
|
138
|
+
|
|
139
|
+
**Outdoor comfort and microclimate** (`comfort`, `microclimate`, `wind`): `utci`, `pet`, `mean_radiant_temperature`, `sky_temperature`; `surface_temperature` and `canopy_cooling_grid`; `wind_ratio` with Lawson comfort classes.
|
|
140
|
+
|
|
141
|
+
**Noise and air** (`acoustics`, `dispersion`, `road_sources`): `noise_propagation` with `maekawa_diffraction`, `building_facade_noise`; `ventilation_efficiency` and `pollutant_dispersion`.
|
|
142
|
+
|
|
143
|
+
**Planning rules and form** (`daylight`, `urban_form`, `morphology`, `walkability`): BRE 209 vertical sky component and 25-degree checks (`check_rule`, `vsc_long`), `solar_envelope`, `green_view_index`, `classify_lcz`, `block_indicators`, `pedestrian_walkability_index`, `find_cool_route`.
|
|
144
|
+
|
|
145
|
+
**Terrain** (`terrain`): Horn `slope_aspect`, `hillshade`, `contours`, `profile`, `flood`, `cut_fill`, `balanced_level`, `curvature`, `tpi`, `ruggedness`, `flow_accumulation`, `wetness`.
|
|
146
|
+
|
|
147
|
+
**Scenes, results and tools** (`scene`, `osm`, `results`, `server`, `classify`, `nsga2`): `Scene.flat`, `Scene.from_osm` with the Overpass client `osm.fetch`, `load_scene`; `aggregate_by_id`, ASCII grid, `.npy` and GeoTIFF writers; the bundled viewer (`serve_scene`); Jenks and quantile breaks; an NSGA-II optimiser.
|
|
148
|
+
|
|
149
|
+
All grids are NumPy arrays of shape `(rows, cols)` with row 0 at the north edge, in local metres (x east, y north). The raster engines work on a 2.5-D surface (terrain plus building and tree heights), so overhangs and facades are not represented; the guide explains the method and its limits.
|
|
150
|
+
|
|
151
|
+
## Command line
|
|
152
|
+
|
|
153
|
+
```text
|
|
154
|
+
$ zero2geospatial3d --help
|
|
155
|
+
usage: zero2geospatial3d [-h] [--version]
|
|
156
|
+
{sun,stations,epw,comfort,osm,demo,analyze,view} ...
|
|
157
|
+
|
|
158
|
+
Headless 3D terrain and building analysis (sun, shade, comfort, terrain).
|
|
159
|
+
|
|
160
|
+
positional arguments:
|
|
161
|
+
{sun,stations,epw,comfort,osm,demo,analyze,view}
|
|
162
|
+
sun sunrise, sunset and noon elevation
|
|
163
|
+
stations nearest TMYx weather stations
|
|
164
|
+
epw download an EPW weather file
|
|
165
|
+
comfort UTCI and PET for one set of conditions
|
|
166
|
+
osm download OSM data and write a scene package
|
|
167
|
+
demo write a synthetic demo scene package
|
|
168
|
+
analyze run a raster analysis on a scene package
|
|
169
|
+
view open a scene package in the browser viewer
|
|
170
|
+
|
|
171
|
+
options:
|
|
172
|
+
-h, --help show this help message and exit
|
|
173
|
+
--version show program's version number and exit
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
zero2geospatial3d sun --lat 38.42 --lon 27.14 --date 2026-06-21 --tz 3
|
|
178
|
+
zero2geospatial3d comfort --ta 32 --tr 55 --v 1.5 --rh 40
|
|
179
|
+
zero2geospatial3d demo --out demo_scene
|
|
180
|
+
zero2geospatial3d analyze demo_scene sun-hours --date 2026-03-21 --out sun.asc
|
|
181
|
+
zero2geospatial3d analyze demo_scene irradiation --epw istanbul.epw --out kwh.tif # .tif needs [geo]
|
|
182
|
+
zero2geospatial3d view demo_scene --results results/
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`analyze` supports `sun-hours`, `shadow`, `svf`, `viewshed`, `irradiation`, `slope`, `aspect`, `hillshade` and `flood`, and prints summary statistics as JSON. `view` serves the plugin's three.js viewer on `127.0.0.1`, so your data stays on your computer.
|
|
186
|
+
|
|
187
|
+
## Documentation
|
|
188
|
+
|
|
189
|
+
- Usage guide with tasks, the method and its formulas: [docs/guide.md](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/docs/guide.md)
|
|
190
|
+
- Package page: [geophilo.com/sdks/zero2geospatial3d-sdk](https://geophilo.com/sdks/zero2geospatial3d-sdk/)
|
|
191
|
+
- QGIS plugin: [plugins.qgis.org/plugins/zero2geospatial3d](https://plugins.qgis.org/plugins/zero2geospatial3d/)
|
|
192
|
+
|
|
193
|
+
| API | What it does |
|
|
194
|
+
| --- | --- |
|
|
195
|
+
| `Scene.flat(...)`, `Scene.from_osm(...)`, `load_scene(path)` | Build or load a site |
|
|
196
|
+
| `shading.sun_hours(surface, lat, lon, utc_offset, month, day)` | Hours of direct sun per cell |
|
|
197
|
+
| `shading.sky_view_factor(surface, n_azimuths=36)` | Sky view factor per cell |
|
|
198
|
+
| `shading.solar_irradiation(...)`, `shading.pv_yield(...)` | Yearly irradiation and PV yield |
|
|
199
|
+
| `comfort.utci(...)`, `comfort.pet(...)`, `comfort.mean_radiant_temperature(...)` | Outdoor thermal comfort |
|
|
200
|
+
| `terrain.slope_aspect`, `terrain.flood`, `terrain.cut_fill` | Terrain analysis and earthworks |
|
|
201
|
+
|
|
202
|
+
## Related packages
|
|
203
|
+
|
|
204
|
+
- [urbanshadow](https://pypi.org/project/urbanshadow/): exact vector shadow polygons and sun hours from 2D footprints and heights, a cross-check for the raster shadows here.
|
|
205
|
+
- [skyview](https://pypi.org/project/skyview/): sky view factor at points from footprints, by exact ray casting, and street-canyon metrics.
|
|
206
|
+
- [heatstress](https://pypi.org/project/heatstress/): heat index, WBGT, UTCI and heatwave detection from weather series.
|
|
207
|
+
- [planx-3d-city](https://pypi.org/project/planx-3d-city/): an offline three.js 3D city viewer for GeoJSON, OpenStreetMap and DEMs.
|
|
208
|
+
|
|
209
|
+
## Citation
|
|
210
|
+
|
|
211
|
+
Please cite the Zenodo record [10.5281/zenodo.24057137](https://doi.org/10.5281/zenodo.24057137); the metadata is in [CITATION.cff](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/CITATION.cff).
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
Eminoğlu, Y. (2026). zero2geospatial3d-sdk (Version 0.2.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.24057137
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT, see [LICENSE](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/LICENSE). The bundled viewer includes three.js (MIT), the UTCI polynomial follows pythermalcomfort (MIT), and the station index credits Climate.OneBuilding.Org. Details are in [THIRD_PARTY_NOTICES.md](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/THIRD_PARTY_NOTICES.md).
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://geophilo.com/sdks/zero2geospatial3d-sdk/"><img src="https://geophilo.com/assets/sdk_icons/zero2geospatial3d_sdk.svg" width="120" height="120" alt="zero2geospatial3d-sdk icon"></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# zero2geospatial3d-sdk
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/zero2geospatial3d-sdk/)
|
|
8
|
+
[](https://pypi.org/project/zero2geospatial3d-sdk/)
|
|
9
|
+
[](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/pipelines)
|
|
10
|
+
[](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/LICENSE)
|
|
11
|
+
[](https://doi.org/10.5281/zenodo.24057137)
|
|
12
|
+
[](https://pepy.tech/project/zero2geospatial3d-sdk)
|
|
13
|
+
|
|
14
|
+
**Headless 3D site analysis in Python on NumPy alone: sun hours and shadows, sky view factor, solar irradiation and PV, UTCI, PET and mean radiant temperature, wind, noise, air quality, BRE 209 daylight, terrain, flooding and cut and fill, with the same mathematics as the 02 Geo3D Analyzer QGIS plugin.**
|
|
15
|
+
|
|
16
|
+
<p align="center"><img src="https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/raw/main/docs/assets/hero.svg" width="820" alt="Three maps of a synthetic district in Izmir on a 2 m grid computed by zero2geospatial3d-sdk: sunlit and shaded ground at 16:00 on 21 March with shadows falling north-east, hours of direct sun on 21 March with the BRE 209 two-hour line drawn north of each block, and the sky view factor of every ground cell"></p>
|
|
17
|
+
|
|
18
|
+
*Real output of `shading.shadow_mask`, `shading.sun_hours` and `shading.sky_view_factor`, rebuilt by [docs/assets/make_assets.py](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/docs/assets/make_assets.py).*
|
|
19
|
+
|
|
20
|
+
## Why zero2geospatial3d-sdk?
|
|
21
|
+
|
|
22
|
+
- **One engine, two front ends.** It is the scriptable engine behind the 02 Geo3D Analyzer QGIS plugin, ported from the plugin's GPU code to NumPy. Scene packages move both ways: a scene exported by the plugin loads in Python, and a scene built in Python opens in the bundled three.js viewer.
|
|
23
|
+
- **Broad and headless.** Sun, shade, sky view, irradiation and PV, outdoor thermal comfort, wind comfort classes, road noise, ventilation and air quality, BRE 209 daylight checks, terrain analysis and multi-objective optimisation run in notebooks, batch jobs, servers and CI, with no QGIS and no GPU.
|
|
24
|
+
- **Checked against references.** The tests reproduce the plugin's numeric assertions: the NREL SPA sun position to within 0.3 degrees, UTCI and PET reference values, BRE 209 closed forms, terrain indices and flood and cut-and-fill volumes. The raster engines are checked against the canyon sky view factor and wall shadow lengths.
|
|
25
|
+
- **One dependency.** NumPy only. GeoTIFF output, map plots and projections come with the optional `geo` extra.
|
|
26
|
+
- **Tested and typed.** 168 tests with 92 % line and branch coverage, a clean mypy run and a `py.typed` marker; CI runs Python 3.9, 3.11 and 3.13.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install zero2geospatial3d-sdk
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Extra | Adds | For |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| `geo` | rasterio, pyproj, shapely, matplotlib | GeoTIFF output, reprojection and plots |
|
|
37
|
+
| `dev` | pytest, pytest-cov, ruff, mypy | running the test suite |
|
|
38
|
+
|
|
39
|
+
Python 3.9 to 3.13. The import name is `zero2geospatial3d`.
|
|
40
|
+
|
|
41
|
+
## Quickstart
|
|
42
|
+
|
|
43
|
+
This runs offline as pasted.
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import numpy as np
|
|
47
|
+
from zero2geospatial3d import Building, Scene, shading, comfort, terrain
|
|
48
|
+
from zero2geospatial3d.results import aggregate_by_id
|
|
49
|
+
|
|
50
|
+
# A 200 m x 200 m level site in Izmir (UTC+3) with a 2 m grid and two buildings.
|
|
51
|
+
scene = Scene.flat(200, 200, cell=2.0, lat=38.42, lon=27.14, utc_offset=3.0)
|
|
52
|
+
for cx, h in ((-30, 24.0), (30, 12.0)):
|
|
53
|
+
ring = [[cx - 15, -10], [cx + 15, -10], [cx + 15, 10], [cx - 15, 10], [cx - 15, -10]]
|
|
54
|
+
scene.buildings.append(Building([[ring]], height=h))
|
|
55
|
+
|
|
56
|
+
surface = scene.surface() # terrain + buildings as a Grid
|
|
57
|
+
_, ids = scene.building_rasters() # building id per cell (0 = ground)
|
|
58
|
+
|
|
59
|
+
# BRE 209: sun hours on 21 March
|
|
60
|
+
hours = shading.sun_hours(surface, scene.lat, scene.lon, scene.utc_offset, month=3, day=21)
|
|
61
|
+
open_ground = hours[ids == 0]
|
|
62
|
+
print(f"open ground with >= 2 h of sun: {100 * np.mean(open_ground >= 2):.0f} %")
|
|
63
|
+
|
|
64
|
+
# Sky view factor and per-building roof statistics
|
|
65
|
+
svf = shading.sky_view_factor(surface, n_azimuths=16)
|
|
66
|
+
print(aggregate_by_id(ids, svf, cell_area=4.0)[1]["mean"])
|
|
67
|
+
|
|
68
|
+
# Thermal comfort for one set of conditions
|
|
69
|
+
print(comfort.utci(32.0, 55.0, 1.5, 40.0), comfort.pet(32.0, 55.0, 1.5, 40.0))
|
|
70
|
+
|
|
71
|
+
# Terrain: slope, flooding and earthworks on the DEM
|
|
72
|
+
slope, aspect = terrain.slope_aspect(scene.terrain)
|
|
73
|
+
pad = [[-20, -20], [20, -20], [20, 20], [-20, 20], [-20, -20]]
|
|
74
|
+
print(terrain.cut_fill(scene.terrain, pad, design_level=0.5).fill)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
open ground with >= 2 h of sun: 100 %
|
|
79
|
+
1.0
|
|
80
|
+
37.38729250415502 38.94852470455589
|
|
81
|
+
800.0
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## What you can do
|
|
85
|
+
|
|
86
|
+
**Sun, shade and sky** (`shading`, `solar`): `shadow_mask`, `sun_hours`, `shadow_study`, `horizon_angles`, `sky_view_factor`, `viewshed`; `solar_position`, `sunrise_sunset`, `sun_path` and `sky_hemisphere` with the NOAA solar equations.
|
|
87
|
+
|
|
88
|
+
**Solar energy** (`shading`, `weather`, `epw`): `solar_irradiation` (direct, diffuse and reflected), `pv_yield`; EPW files with `read_epw`, `wind_rose` and `monthly_summary`; a clear-sky year with `clear_sky_year`; the nearest TMYx station with `nearest_stations` and `download_station`.
|
|
89
|
+
|
|
90
|
+
**Outdoor comfort and microclimate** (`comfort`, `microclimate`, `wind`): `utci`, `pet`, `mean_radiant_temperature`, `sky_temperature`; `surface_temperature` and `canopy_cooling_grid`; `wind_ratio` with Lawson comfort classes.
|
|
91
|
+
|
|
92
|
+
**Noise and air** (`acoustics`, `dispersion`, `road_sources`): `noise_propagation` with `maekawa_diffraction`, `building_facade_noise`; `ventilation_efficiency` and `pollutant_dispersion`.
|
|
93
|
+
|
|
94
|
+
**Planning rules and form** (`daylight`, `urban_form`, `morphology`, `walkability`): BRE 209 vertical sky component and 25-degree checks (`check_rule`, `vsc_long`), `solar_envelope`, `green_view_index`, `classify_lcz`, `block_indicators`, `pedestrian_walkability_index`, `find_cool_route`.
|
|
95
|
+
|
|
96
|
+
**Terrain** (`terrain`): Horn `slope_aspect`, `hillshade`, `contours`, `profile`, `flood`, `cut_fill`, `balanced_level`, `curvature`, `tpi`, `ruggedness`, `flow_accumulation`, `wetness`.
|
|
97
|
+
|
|
98
|
+
**Scenes, results and tools** (`scene`, `osm`, `results`, `server`, `classify`, `nsga2`): `Scene.flat`, `Scene.from_osm` with the Overpass client `osm.fetch`, `load_scene`; `aggregate_by_id`, ASCII grid, `.npy` and GeoTIFF writers; the bundled viewer (`serve_scene`); Jenks and quantile breaks; an NSGA-II optimiser.
|
|
99
|
+
|
|
100
|
+
All grids are NumPy arrays of shape `(rows, cols)` with row 0 at the north edge, in local metres (x east, y north). The raster engines work on a 2.5-D surface (terrain plus building and tree heights), so overhangs and facades are not represented; the guide explains the method and its limits.
|
|
101
|
+
|
|
102
|
+
## Command line
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
$ zero2geospatial3d --help
|
|
106
|
+
usage: zero2geospatial3d [-h] [--version]
|
|
107
|
+
{sun,stations,epw,comfort,osm,demo,analyze,view} ...
|
|
108
|
+
|
|
109
|
+
Headless 3D terrain and building analysis (sun, shade, comfort, terrain).
|
|
110
|
+
|
|
111
|
+
positional arguments:
|
|
112
|
+
{sun,stations,epw,comfort,osm,demo,analyze,view}
|
|
113
|
+
sun sunrise, sunset and noon elevation
|
|
114
|
+
stations nearest TMYx weather stations
|
|
115
|
+
epw download an EPW weather file
|
|
116
|
+
comfort UTCI and PET for one set of conditions
|
|
117
|
+
osm download OSM data and write a scene package
|
|
118
|
+
demo write a synthetic demo scene package
|
|
119
|
+
analyze run a raster analysis on a scene package
|
|
120
|
+
view open a scene package in the browser viewer
|
|
121
|
+
|
|
122
|
+
options:
|
|
123
|
+
-h, --help show this help message and exit
|
|
124
|
+
--version show program's version number and exit
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
zero2geospatial3d sun --lat 38.42 --lon 27.14 --date 2026-06-21 --tz 3
|
|
129
|
+
zero2geospatial3d comfort --ta 32 --tr 55 --v 1.5 --rh 40
|
|
130
|
+
zero2geospatial3d demo --out demo_scene
|
|
131
|
+
zero2geospatial3d analyze demo_scene sun-hours --date 2026-03-21 --out sun.asc
|
|
132
|
+
zero2geospatial3d analyze demo_scene irradiation --epw istanbul.epw --out kwh.tif # .tif needs [geo]
|
|
133
|
+
zero2geospatial3d view demo_scene --results results/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`analyze` supports `sun-hours`, `shadow`, `svf`, `viewshed`, `irradiation`, `slope`, `aspect`, `hillshade` and `flood`, and prints summary statistics as JSON. `view` serves the plugin's three.js viewer on `127.0.0.1`, so your data stays on your computer.
|
|
137
|
+
|
|
138
|
+
## Documentation
|
|
139
|
+
|
|
140
|
+
- Usage guide with tasks, the method and its formulas: [docs/guide.md](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/docs/guide.md)
|
|
141
|
+
- Package page: [geophilo.com/sdks/zero2geospatial3d-sdk](https://geophilo.com/sdks/zero2geospatial3d-sdk/)
|
|
142
|
+
- QGIS plugin: [plugins.qgis.org/plugins/zero2geospatial3d](https://plugins.qgis.org/plugins/zero2geospatial3d/)
|
|
143
|
+
|
|
144
|
+
| API | What it does |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| `Scene.flat(...)`, `Scene.from_osm(...)`, `load_scene(path)` | Build or load a site |
|
|
147
|
+
| `shading.sun_hours(surface, lat, lon, utc_offset, month, day)` | Hours of direct sun per cell |
|
|
148
|
+
| `shading.sky_view_factor(surface, n_azimuths=36)` | Sky view factor per cell |
|
|
149
|
+
| `shading.solar_irradiation(...)`, `shading.pv_yield(...)` | Yearly irradiation and PV yield |
|
|
150
|
+
| `comfort.utci(...)`, `comfort.pet(...)`, `comfort.mean_radiant_temperature(...)` | Outdoor thermal comfort |
|
|
151
|
+
| `terrain.slope_aspect`, `terrain.flood`, `terrain.cut_fill` | Terrain analysis and earthworks |
|
|
152
|
+
|
|
153
|
+
## Related packages
|
|
154
|
+
|
|
155
|
+
- [urbanshadow](https://pypi.org/project/urbanshadow/): exact vector shadow polygons and sun hours from 2D footprints and heights, a cross-check for the raster shadows here.
|
|
156
|
+
- [skyview](https://pypi.org/project/skyview/): sky view factor at points from footprints, by exact ray casting, and street-canyon metrics.
|
|
157
|
+
- [heatstress](https://pypi.org/project/heatstress/): heat index, WBGT, UTCI and heatwave detection from weather series.
|
|
158
|
+
- [planx-3d-city](https://pypi.org/project/planx-3d-city/): an offline three.js 3D city viewer for GeoJSON, OpenStreetMap and DEMs.
|
|
159
|
+
|
|
160
|
+
## Citation
|
|
161
|
+
|
|
162
|
+
Please cite the Zenodo record [10.5281/zenodo.24057137](https://doi.org/10.5281/zenodo.24057137); the metadata is in [CITATION.cff](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/CITATION.cff).
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
Eminoğlu, Y. (2026). zero2geospatial3d-sdk (Version 0.2.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.24057137
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT, see [LICENSE](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/LICENSE). The bundled viewer includes three.js (MIT), the UTCI polynomial follows pythermalcomfort (MIT), and the station index credits Climate.OneBuilding.Org. Details are in [THIRD_PARTY_NOTICES.md](https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/THIRD_PARTY_NOTICES.md).
|
|
@@ -4,38 +4,27 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "zero2geospatial3d-sdk"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
authors = [
|
|
9
|
-
{ name = "Yusuf Eminoğlu", email = "
|
|
9
|
+
{ name = "Yusuf Eminoğlu", email = "geospacephilo@gmail.com" }
|
|
10
10
|
]
|
|
11
|
-
description = "Headless 3D urban and terrain analysis in Python: sun hours, shadows, sky view factor, solar PV, UTCI/PET comfort, noise,
|
|
11
|
+
description = "Headless 3D urban and terrain analysis in Python and NumPy: sun hours, shadows, sky view factor, solar PV, UTCI/PET thermal comfort, wind, noise, air quality, flooding and cut/fill."
|
|
12
12
|
keywords = [
|
|
13
|
-
"
|
|
14
|
-
"3d",
|
|
15
|
-
"urban-planning",
|
|
13
|
+
"3d-city-analysis",
|
|
16
14
|
"urban-climate",
|
|
17
|
-
"solar",
|
|
18
15
|
"sun-hours",
|
|
19
|
-
"shadow",
|
|
16
|
+
"shadow-analysis",
|
|
20
17
|
"sky-view-factor",
|
|
21
|
-
"
|
|
22
|
-
"daylight",
|
|
23
|
-
"bre-209",
|
|
18
|
+
"solar-pv",
|
|
24
19
|
"utci",
|
|
25
|
-
"pet",
|
|
26
20
|
"thermal-comfort",
|
|
27
|
-
"microclimate",
|
|
28
21
|
"wind-comfort",
|
|
29
|
-
"noise",
|
|
30
|
-
"air-quality",
|
|
22
|
+
"noise-mapping",
|
|
31
23
|
"viewshed",
|
|
32
|
-
"terrain",
|
|
33
24
|
"dem",
|
|
34
25
|
"flood",
|
|
35
26
|
"cut-and-fill",
|
|
36
|
-
"
|
|
37
|
-
"openstreetmap",
|
|
38
|
-
"walkability",
|
|
27
|
+
"urban-planning",
|
|
39
28
|
]
|
|
40
29
|
readme = "README.md"
|
|
41
30
|
license = "MIT"
|
|
@@ -43,18 +32,21 @@ license-files = ["LICENSE", "THIRD_PARTY_NOTICES.md"]
|
|
|
43
32
|
requires-python = ">=3.9"
|
|
44
33
|
classifiers = [
|
|
45
34
|
"Development Status :: 4 - Beta",
|
|
35
|
+
"Intended Audience :: Science/Research",
|
|
36
|
+
"Intended Audience :: Developers",
|
|
37
|
+
"Intended Audience :: Education",
|
|
38
|
+
"Environment :: Console",
|
|
39
|
+
"Operating System :: OS Independent",
|
|
46
40
|
"Programming Language :: Python :: 3",
|
|
47
41
|
"Programming Language :: Python :: 3.9",
|
|
48
42
|
"Programming Language :: Python :: 3.10",
|
|
49
43
|
"Programming Language :: Python :: 3.11",
|
|
50
44
|
"Programming Language :: Python :: 3.12",
|
|
51
45
|
"Programming Language :: Python :: 3.13",
|
|
52
|
-
"Operating System :: OS Independent",
|
|
53
46
|
"Topic :: Scientific/Engineering :: GIS",
|
|
54
47
|
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
|
55
48
|
"Topic :: Scientific/Engineering :: Physics",
|
|
56
|
-
"
|
|
57
|
-
"Intended Audience :: Developers",
|
|
49
|
+
"Natural Language :: English",
|
|
58
50
|
"Typing :: Typed",
|
|
59
51
|
]
|
|
60
52
|
dependencies = [
|
|
@@ -79,12 +71,14 @@ dev = [
|
|
|
79
71
|
zero2geospatial3d = "zero2geospatial3d.cli:main"
|
|
80
72
|
|
|
81
73
|
[project.urls]
|
|
82
|
-
Homepage = "https://
|
|
83
|
-
Repository = "https://
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Changelog = "https://
|
|
87
|
-
"
|
|
74
|
+
Homepage = "https://gitlab.com/geophilo1/zero2geospatial3d_sdk"
|
|
75
|
+
Repository = "https://gitlab.com/geophilo1/zero2geospatial3d_sdk"
|
|
76
|
+
Documentation = "https://geophilo.com/sdks/zero2geospatial3d-sdk/"
|
|
77
|
+
Issues = "https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/work_items"
|
|
78
|
+
Changelog = "https://gitlab.com/geophilo1/zero2geospatial3d_sdk/-/blob/main/CHANGELOG.md"
|
|
79
|
+
"SDK dashboard" = "https://geophilo.com/sdk-dashboard/"
|
|
80
|
+
DOI = "https://doi.org/10.5281/zenodo.24057137"
|
|
81
|
+
"QGIS plugin" = "https://plugins.qgis.org/plugins/zero2geospatial3d/"
|
|
88
82
|
|
|
89
83
|
[tool.setuptools]
|
|
90
84
|
package-dir = {"" = "src"}
|
|
@@ -56,7 +56,7 @@ class OsmError(RuntimeError):
|
|
|
56
56
|
def _user_agent() -> str:
|
|
57
57
|
from . import __version__
|
|
58
58
|
|
|
59
|
-
return f"zero2geospatial3d-sdk/{__version__} (Python; +https://
|
|
59
|
+
return f"zero2geospatial3d-sdk/{__version__} (Python; +https://gitlab.com/geophilo1/zero2geospatial3d_sdk)"
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
def build_query(s: float, w: float, n: float, e: float) -> str:
|
|
@@ -140,8 +140,25 @@ class ViewerHandler(http.server.SimpleHTTPRequestHandler):
|
|
|
140
140
|
return
|
|
141
141
|
super().do_GET()
|
|
142
142
|
|
|
143
|
+
def _same_origin(self) -> bool:
|
|
144
|
+
"""False when a browser sends the request from a page on another origin.
|
|
145
|
+
|
|
146
|
+
The viewer posts with relative URLs, so its requests are same-origin. A
|
|
147
|
+
cross-site "simple" POST needs no CORS preflight and would otherwise be
|
|
148
|
+
accepted, letting any web page write files into ``results_dir``.
|
|
149
|
+
Requests without an ``Origin`` header (scripts, curl) are allowed.
|
|
150
|
+
"""
|
|
151
|
+
origin = self.headers.get("Origin")
|
|
152
|
+
if not origin:
|
|
153
|
+
return True
|
|
154
|
+
host = (self.headers.get("Host") or "").lower()
|
|
155
|
+
return bool(host) and urllib.parse.urlsplit(origin).netloc.lower() == host
|
|
156
|
+
|
|
143
157
|
def do_POST(self): # noqa: N802 (http.server naming)
|
|
144
158
|
route = self.path.split("?", 1)[0]
|
|
159
|
+
if not self._same_origin():
|
|
160
|
+
self._send_json(403, {"ok": False, "error": "cross-origin request refused"})
|
|
161
|
+
return
|
|
145
162
|
bridge = self._bridge()
|
|
146
163
|
if bridge is None or route not in (RESULT_ENDPOINT, SELECT_ENDPOINT):
|
|
147
164
|
self._send_json(404, {"ok": False, "error": "not found"})
|