Writes the graph to a GraphML file compatible with OSMnx / NetworkX / Gephi.
Edge geometry is preserved losslessly as a WKT attribute, so the graph
round-trips through ox_load_graphml().
Arguments
- g
An osm_graph.
- path
Output
.graphmlpath.
References
osmnxr is an R port of OSMnx. If you use it, please cite:
Boeing, G. (2025). Modeling and analyzing urban networks and amenities with OSMnx. Geographical Analysis, 57(4), 567–577. doi:10.1111/gean.70009
Examples
g <- example_osm_graph()
f <- tempfile(fileext = ".graphml")
ox_save_graphml(g, f)