API reference#

The API reference provides an overview of all public functions in neatnet.

Network Simplification Routines#

The top-level function that performs complete adaptive simplification of street networks is the primary API of neatnet.

neatify(roads, *[, exclusion_mask, ...])

Top-level workflow for simplifying networks.

The minimal topology fixing can be done using another routine:

fix_topology(roads, *[, eps])

Fix road network topology.

Node Simplification#

Some of the individual components are also exposed as independent functions (note that most are consumed by neatify()).

A subset of functions dealing with network nodes:

consolidate_nodes(gdf, *[, tolerance, ...])

Return geometry with consolidated nodes.

remove_interstitial_nodes(gdf, *[, aggfunc])

Clean topology of existing LineString geometry by removal of nodes of degree 2.

induce_nodes(roads, *[, eps])

Adding potentially missing nodes on intersections of individual LineString endpoints with the remaining network.

Face artifact detection#

A subset dealing with face artifacts:

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

Identify face artifacts in street networks.

get_artifacts(roads, *[, exclusion_mask, ...])

Extract face artifacts and return the FAI threshold.

Gap filling#

Snapping and extending lines in case of imprecise topology:

close_gaps(gdf, tolerance)

Close gaps in LineString geometry where it should be contiguous.

extend_lines(gdf, tolerance, *[, target, ...])

Extends lines from gdf to itself or target within a set tolerance.

Internal components#

For debugging purposes, users may use some parts of the internal API used within neatify().

get_artifacts(roads, *[, exclusion_mask, ...])

Extract face artifacts and return the FAI threshold.

neatify_loop(roads, artifacts, *[, ...])

Perform an iteration of the simplification procedure which includes:

neatify_singletons(artifacts, roads, *[, ...])

Simplification of singleton face artifacts – the first simplification step in the procedure detailed in simplify.neatify_loop().

neatify_pairs(artifacts, roads, *[, ...])

Simplification of pairs of face artifacts – the second simplification step in the procedure detailed in simplify.neatify_loop().

neatify_clusters(artifacts, roads, *[, ...])

Simplification of clusters of face artifacts – the third simplification step in the procedure detailed in simplify.neatify_loop().

None of the other functions is intended for public use and their API can change without a warning.