momepy.COINS#
- class momepy.COINS(edge_gdf, angle_threshold=0)[source]#
Calculates natural continuity and hierarchy of street networks in given GeoDataFrame using COINS algorithm.
For details on the algorithms refer to the original paper [Tripathy et al., 2020].
This is a reimplementation of the original script from https://github.com/PratyushTripathy/COINS
COINS
can return final stroke geometry (.stroke_gdf()
) or a pandas Series encoding stroke groups onto the original input geometry (.stroke_attribute()
).- Parameters
- edge_gdfGeoDataFrame
GeoDataFrame containing edge geometry of street network. edge_gdf should ideally not contain MultiLineStrings.
- angle_thresholdint, float (default 0)
the angle threshold for the COINS algorithm. Segments will only be considered a part of the same street if the deflection angle is above the threshold.
Examples
Initialise COINS class. This step will already compute the topology.
>>> coins = momepy.COINS(streets)
To get final stroke geometry:
>>> stroke_gdf = coins.stroke_gdf()
To get a Series encoding stroke groups:
>>> stroke_attr = coins.stroke_attribute()
Methods
stroke_attribute
()Returns a pandas Series encoding stroke groups onto the original input geometry.
stroke_gdf
()Returns a GeoDataFrame containing merged final stroke geometry.
Methods
__init__
(edge_gdf[, angle_threshold])stroke_attribute
()Returns a pandas Series encoding stroke groups onto the original input geometry.
stroke_gdf
()Returns a GeoDataFrame containing merged final stroke geometry.