spaghetti
spaghetti copied to clipboard
construct arc adjacency matrix directly from a geodataframe
Following example given by @ljwolf from SciPy 2018 of constructing the arc adjacency matrix with a geopandas.GeoDataFrame.sindex for speed improvements.
Current procedure
- extract vertices from networks lines (
arcs).
- This means each euclidean segment within a network line, which means many small arcs for a sinuous line.
- build adjacency list of nodes
- create network arc representation based on vertices
- build contiguity weights based on (3)
Proposed procedure
- (when
geopandasavailable), build contiguity weights based on each network arc (one record) in thegeopandas.GeoDataFramewith the use of ansindex. - extract network vertices from the endpoints of (1)