momepy.fractal_dimension#
- momepy.fractal_dimension(geometry)[source]#
Calculates fractal dimension based on area and perimeter.
\[{2log({{perimeter} \over {4}})} \over log(area)\]Based on [McGarigal and Marks, 1995].
- Parameters:
- geometryGeoDataFrame | GeoSeries
A GeoDataFrame or GeoSeries containing polygons to analyse.
- Returns:
- Series
Examples
>>> path = momepy.datasets.get_path("bubenec") >>> buildings = geopandas.read_file(path, layer="buildings") >>> momepy.fractal_dimension(buildings) 0 1.072678 1 1.182350 2 1.018422 3 1.048314 4 1.017328 ... 139 1.014975 140 1.033581 141 1.064103 142 1.022617 143 1.000008 Length: 144, dtype: float64