Geometry shape
[1]:
import pandas as pd
blocks_gdf = pd.read_pickle('./../../data/saint_petersburg/blocks.pickle')
Aspect ratio
[2]:
from blocksnet.analysis.geometry.shape import calculate_aspect_ratio
aspect_ratio_gdf = calculate_aspect_ratio(blocks_gdf)
aspect_ratio_gdf.head()
100%|██████████| 9533/9533 [00:00<00:00, 29830.10it/s]
[2]:
geometry | aspect_ratio | |
---|---|---|
0 | POLYGON ((349424.859 6631180.891, 349424.751 6... | 157.726300 |
1 | POLYGON ((352083.617 6633950.146, 352240.448 6... | 3.734174 |
2 | POLYGON ((346700.642 6618453.176, 346681.107 6... | 1.114986 |
3 | POLYGON ((347043.363 6618261.219, 347042.608 6... | 1.640961 |
4 | POLYGON ((354879.039 6618859.116, 354845.405 6... | 1.423429 |
[6]:
aspect_ratio_gdf.plot('aspect_ratio', legend=True, vmax=10, vmin=1).set_axis_off()
