momepy.Linearity#

class momepy.Linearity(gdf, verbose=True)[source]#

Calculates the linearity of each LineString object in a given GeoDataFrame. MultiLineString returns np.nan.

\[\frac{l_{euclidean}}{l_{segment}}\]

where l is the length of the LineString.

Adapted from [Araldi and Fusco, 2019].

Parameters
gdfGeoDataFrame

A GeoDataFrame containing objects.

verbosebool (default True)

If True, shows progress bars in loops and indication of steps.

Examples

>>> streets_df['linearity'] = momepy.Linearity(streets_df).series
>>> streets_df['linearity'][0]
1.0
Attributes
seriesSeries

A Series containing mean distance values.

gdfGeoDataFrame

The original GeoDataFrame.

__init__(gdf, verbose=True)[source]#

Methods

__init__(gdf[, verbose])