NetworkX

Previous topic

parse_pajek

Next topic

read_shp

GIS ShapefileΒΆ

Generates a networkx.DiGraph from point and line shapefiles.

Point geometries are translated into nodes, lines into edges. Coordinate tuples are used as keys. Attributes are preserved, line geometries are simplified into start and end coordinates. Accepts a single shapefile or directory of many shapefiles.

“The Esri Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by Esri as a (mostly) open specification for data interoperability among Esri and other software products.” See http://en.wikipedia.org/wiki/Shapefile for additional information.

read_shp(path) Generates a networkx.DiGraph from shapefiles. Point geometries are
write_shp(G, outdir) Writes a networkx.DiGraph to two shapefiles, edges and nodes.