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.

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.