Skip to content

Commit f670432

Browse files
authored
Merge pull request #6 from ni1o1/0.2.4
0.3.0
2 parents abd8e4e + 4d01c26 commit f670432

18 files changed

+1471
-687
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Given a building GeoDataFrame and UTC datetime, `pybdshadow` can calculate the b
3030
```python
3131
import pybdshadow
3232
#Given UTC datetime
33-
date = pd.to_datetime('2015-01-01 04:45:33.959797119')
33+
date = pd.to_datetime('2022-01-01 12:45:33.959797119')\
34+
.tz_localize('Asia/Shanghai')\
35+
.tz_convert('UTC')
3436
#Calculate building shadow for sun light
3537
shadows = pybdshadow.bdshadow_sunlight(buildings,date)
3638
```

docs/source/analysis.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. _analysis:
2+
3+
4+
*****************************
5+
Shadow coverage analysis
6+
*****************************
7+
8+
9+
Shadow coverage analysis
10+
--------------------------------------
11+
12+
.. function:: pybdshadow.cal_sunshadows(buildings, cityname='somecity', dates=['2022-01-01'], gap=3600,roof=True, include_building=True,save_shadows=False,printlog=False)
13+
14+
Calculate the sunlight shadow in different date with given time gap.
15+
16+
**Parameters**
17+
18+
buildings : GeoDataFrame
19+
Buildings. coordinate system should be WGS84
20+
cityname : string
21+
Cityname. If save_shadows, this function will create `result/cityname` folder to save the shadows
22+
dates : list
23+
list of dates
24+
gap : number
25+
time gap(s)
26+
roof : bool
27+
whether to calculate roof shadow.
28+
include_building : bool
29+
whether the shadow include building outline
30+
save_shadows : bool
31+
whether to save calculated shadows
32+
printlog : bool
33+
whether to print log
34+
35+
**Return**
36+
37+
allshadow : GeoDataFrame
38+
All building shadows calculated
39+
40+
41+
.. function:: pybdshadow.cal_shadowcoverage(shadows_input,buildings,roof=True,gap = 3600,accuracy=1)
42+
43+
Calculate the sunlight shadow coverage time for given area.
44+
45+
**Parameters**
46+
47+
shadows_input : GeoDataFrame
48+
All building shadows calculated
49+
buildings : GeoDataFrame
50+
Buildings. coordinate system should be WGS84
51+
roof : bool
52+
If true roof shadow, false then ground shadow
53+
gap : number
54+
time gap(s), which is for calculation of coverage time
55+
accuracy : number
56+
size of grids.
57+
58+
**Return**
59+
60+
bdgrids : GeoDataFrame
61+
grids generated by TransBigData in study area, each grids have a `time` column store the shadow coverage time
62+
63+
64+

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
author = 'Qing Yu'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '0.2.3'
26-
version = '0.2.3'
25+
release = '0.3.0'
26+
version = '0.3.0'
2727
html_logo = "_static/logo-wordmark-light.png"
2828
html_favicon = '_static/logo.ico'
2929
# -- General configuration ---------------------------------------------------

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ Citation information can be found at https://github.com/ni1o1/pybdshadow/blob/ma
6262

6363
preprocess.rst
6464
bdshadow.rst
65+
analysis.rst
6566
Visualization.rst

example/example-analysis.ipynb

Lines changed: 242 additions & 0 deletions
Large diffs are not rendered by default.

example/example-calculation.ipynb

Lines changed: 444 additions & 0 deletions
Large diffs are not rendered by default.

example/example-roof.ipynb

Lines changed: 0 additions & 105 deletions
This file was deleted.

example/example.ipynb

Lines changed: 0 additions & 442 deletions
This file was deleted.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ geopandas
33
matplotlib
44
suncalc
55
keplergl
6-
scikit-opt
6+
scikit-opt
7+
transbigdata

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="pybdshadow",
8-
version="0.2.3",
8+
version="0.3.0",
99
author="Qing Yu",
1010
author_email="[email protected]",
1111
description="Python package to generate building shadow geometry",
@@ -17,7 +17,7 @@
1717
"Bug Tracker": "https://github.com/ni1o1/pybdshadow/issues",
1818
},
1919
install_requires=[
20-
"numpy", "pandas", "shapely", "geopandas", "matplotlib","suncalc","keplergl"
20+
"numpy", "pandas", "shapely", "geopandas", "matplotlib","suncalc","keplergl","transbigdata"
2121
],
2222
classifiers=[
2323
"Operating System :: OS Independent",

0 commit comments

Comments
 (0)