momepy.COINS#

class momepy.COINS(edge_gdf, angle_threshold=0)[source]#

Calculates natural continuity and hierarchy of street networks in a given GeoDataFrame using the COINS algorithm.

For details on the algorithms refer to the original paper [].

This is a reimplementation of the original script from 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

A GeoDataFrame containing edge geometry of a 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.

Notes

The LineStrings of the edge_gdf are not expected to overlap. If you are creating it using OSMnx, don’t forget to cast the graph to undirected using osmnx.get_undirected(G) prior converting it to a GeoDataFrame.

Examples

Initialise a COINS class. This step will 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()

Return a pandas Series encoding stroke groups onto the original input geometry.

stroke_gdf()

Return a GeoDataFrame containing merged final stroke geometry.

__init__(edge_gdf, angle_threshold=0)[source]#

Methods

__init__(edge_gdf[, angle_threshold])

stroke_attribute()

Return a pandas Series encoding stroke groups onto the original input geometry.

stroke_gdf()

Return a GeoDataFrame containing merged final stroke geometry.