pybdshadow
Introduction
Functionality
Currently, pybdshadow mainly provides the following methods:
Generating building shadow from sun light: With given location and time, the function in pybdshadow uses the properties of sun position obtained from suncalc-py and the building height to generate shadow geometry data.
Generating building shadow from point light: pybdshadow can generate the building shadow with given location and height of the point light, which can be potentially useful for visual area analysis in urban environment.
Analysis: pybdshadow integrated the analysing method based on the properties of sun movement to track the changing position of shadows within a fixed time interval. Based on the grid processing framework provided by TransBigData, pybdshadow is capable of calculating sunshine time on the ground and on the roof.
Visualization: Built-in visualization capabilities leverage the visualization package keplergl to interactively visualize building and shadow data in Jupyter notebooks with simple code.
The target audience of pybdshadow includes data science researchers and data engineers in the field of BIM, GIS, energy, environment, and urban computing.
Example
Given a building GeoDataFrame and UTC datetime, pybdshadow can calculate the building shadow based on the sun position obtained by suncalc
import pybdshadow
#Given UTC datetime
date = pd.to_datetime('2022-01-01 12:45:33.959797119')\
.tz_localize('Asia/Shanghai')\
.tz_convert('UTC')
#Calculate building shadow
shadows = pybdshadow.bdshadow_sunlight(buildings,date)
pybdshadow also provide visualization method supported by keplergl.
# visualize buildings and shadows
pybdshadow.show_bdshadow(buildings = buildings,shadows = shadows)