ox_simplify: Simplify street-network topology

View source: R/simplify.R

ox_simplifyR Documentation

Simplify street-network topology

Description

Removes interstitial (degree-2) nodes that merely shape the geometry of a street, merging each maximal chain of such nodes into a single edge whose geometry follows the original points and whose length is the sum of the merged segments. Only true endpoints and intersections are kept as nodes.

Usage

ox_simplify(g)

Arguments

g

An unsimplified osm_graph.

Details

The topology walk is performed by the Rust core; geometry is rebuilt with sf. Downloaded graphs are unsimplified by default; this is the standard cleanup step before analysis.

Value

A simplified osm_graph (with meta$simplified = TRUE).

Examples

g <- example_osm_graph()
ox_simplify(g) # already simplified: returned unchanged

osmnxr documentation built on Oct. 20, 2026, 1:07 a.m.