momepy.FaceArtifacts

class momepy.FaceArtifacts(gdf, index='circular_compactness', height_mins=-inf, height_maxs=0.008, prominence=0.00075)[source]

Identify face artifacts in street networks.

For a given street network composed of transportation-oriented geometry containing features representing things like roundabouts, dual carriegaways and complex intersections, identify areas enclosed by geometry that is considered a face artifact as per [Fleischmann and Vybornova, 2024]. Face artifacts highlight areas with a high likelihood of being of non-morphological (e.g. transporation) origin and may require simplification prior morphological analysis. See [Fleischmann and Vybornova, 2024] for more details.

Parameters:
gdf : geopandas.GeoDataFrame

GeoDataFrame containing street network represented as (Multi)LineString geometry

index : str, optional

A type of the shape compacntess index to be used. Available are [‘circlular_compactness’, ‘isoperimetric_quotient’, ‘diameter_ratio’], by default “circular_compactness”

height_mins : float, optional

Required depth of valleys, by default -np.inf

height_maxs : float, optional

Required height of peaks, by default 0.008

prominence : float, optional

Required prominence of peaks, by default 0.00075

threshold[source]

Identified threshold between face polygons and face artifacts

Type:

float

face_artifacts[source]

A GeoDataFrame of geometries identified as face artifacts

Type:

GeoDataFrame

polygons[source]

All polygons resulting from polygonization of the input gdf with the face_artifact_index

Type:

GeoDataFrame

kde[source]

Representation of a kernel-density estimate using Gaussian kernels.

Type:

scipy.stats._kde.gaussian_kde

pdf[source]

Probability density function

Type:

numpy.ndarray

peaks[source]

locations of peaks in pdf

Type:

numpy.ndarray

valleys[source]

locations of valleys in pdf

Type:

numpy.ndarray

Examples

>>> fa = momepy.FaceArtifacts(street_network_prague)
>>> fa.threshold
6.9634555986177045
>>> fa.face_artifacts.head()
                                             geometry  face_artifact_index
6   POLYGON ((-744164.625 -1043922.362, -744167.39...             5.112844
9   POLYGON ((-744154.119 -1043804.734, -744152.07...             6.295660
10  POLYGON ((-744101.275 -1043738.053, -744103.80...             2.862871
12  POLYGON ((-744095.511 -1043623.478, -744095.35...             3.712403
17  POLYGON ((-744488.466 -1044533.317, -744489.33...             5.158554

Notes

In purely synthetic scenarios where all calculated face artifact index values are equal (e.g. a regular grid/lattice) a LinAlgError error will be raised. This is virtually guaranteed to not happen in practice.