iduedu.read_gml

iduedu.read_gml(gml_path, **nx_kwargs)[source]

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

Loads the graph via networkx.read_gml and, when an edge attribute geometry is a string, attempts to parse it with shapely.wkt.from_wkt. Non-parsable strings are left unchanged.

Parameters:
  • gml_path (str) – Path to the GML file.

  • **nx_kwargs – Additional keyword arguments forwarded to networkx.read_gml.

Returns:

The graph with edge geometry parsed to shapely objects where possible.

Return type:

(nx.Graph)