neatnet.FaceArtifacts

neatnet.FaceArtifacts#

class neatnet.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 [FV24]. 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 [FV24] for more details.

Parameters:
gdfgeopandas.GeoDataFrame

GeoDataFrame containing street network represented as (Multi)LineString geometry

indexstr = ‘circular_compactness’

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

height_minsfloat = -numpy.inf

Required depth of valleys.

height_maxsfloat = 0.008

Required height of peaks

prominencefloat = 0.00075

Required prominence of peaks

Attributes:
thresholdfloat

Identified threshold between face polygons and face artifacts

face_artifactsgeopandas.GeoDataFrame

A GeoDataFrame of geometries identified as face artifacts

polygonsgeopandas.GeoDataFrame

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

kdescipy.stats._kde.gaussian_kde

Representation of a kernel-density estimate using Gaussian kernels.

pdfnumpy.ndarray

Probability density function

peaksnumpy.ndarray

locations of peaks in pdf

valleysnumpy.ndarray

locations of valleys in pdf

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.

Examples

>>> fa = neatnet.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
__init__(gdf, *, index='circular_compactness', height_mins=-inf, height_maxs=0.008, prominence=0.00075)[source]#

Methods

__init__(gdf, *[, index, height_mins, ...])