Graph utilitiesΒΆ

graph_to_gdf

Convert a NetworkX graph to GeoDataFrames (edges and/or nodes).

gdf_to_graph

Convert a GeoDataFrame of LineStrings into a directed graph (nx.DiGraph).

clip_nx_graph

Clip a NetworkX graph by a polygon and return the induced subgraph.

keep_largest_strongly_connected_component

Keep only the largest strongly connected component of a directed graph.

write_gml

Write a NetworkX graph to GML, coercing node coordinates to plain floats.

read_gml

Read a GML file into a NetworkX graph and cast edge geometry from WKT strings to shapely.

reproject_graph

Reproject node coordinates (x, y) and edge geometries to a new CRS (in place).