momepy.
ShapeIndex
(gdf, longest_axis, areas=None)[source]¶Calculates shape index of each object in given geoDataFrame.
GeoDataFrame containing objects
the name of the dataframe column, np.array, or pd.Series where is stored longest axis value
the name of the dataframe column, np.array, or pd.Series where is stored area value. If set to None, function will calculate areas during the process without saving them separately.
Examples
>>> buildings_df['shape_index'] = momepy.ShapeIndex(buildings_df, longest_axis='long_ax', areas='area').series
100%|██████████| 144/144 [00:00<00:00, 5558.33it/s]
>>> buildings_df['shape_index'][0]
0.7564029493781987
Series containing resulting values
original GeoDataFrame
Series containing used longest axis values
Series containing used area values
__init__
(self, gdf, longest_axis, areas=None)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |