write_shp#

write_shp(G, outdir)[source]#

Writes a networkx.DiGraph to two shapefiles, edges and nodes.

Deprecated since version 2.6: write_shp is deprecated and will be removed in 3.0. See https://networkx.org/documentation/latest/auto_examples/index.html#geospatial.

Nodes and edges are expected to have a Well Known Binary (Wkb) or Well Known Text (Wkt) key in order to generate geometries. Also acceptable are nodes with a numeric tuple key (x,y).

“The Esri Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software [1].”

Parameters:
GNetworkX graph

Directed graph

outdirdirectory path

Output directory for the two shapefiles.

Returns:
None

References

Examples

nx.write_shp(digraph, ‘/shapefiles’) # doctest +SKIP