SouthForkResearch / pyGNAT

Geomorphic Network and Analysis Toolbox, redesigned using FOSS python libraries.
MIT License
2 stars 0 forks source link

Find crossed reaches #30

Open jesselangdon opened 7 years ago

jesselangdon commented 7 years ago

For many scenarios, we don't want crossed stream reaches (for instance, when a canal crosses a free-flowing stream reach, something that happens quite often in highly altered stream networks). pyGNAT needs to be able to find these crossed reaches (i.e. two edges which cross, but no node at the intersection). Maybe NetworkX or PyQGIS api?

Here's an example shapefile (in the master branch). pyGNAT/experiments/shapefiles/NHD_Canals.shp

MattReimer commented 7 years ago

I think shapely should handle it with its a.intesects(b) notation.

I think this has the possibility of being a very expensive operation to perform. Every segment with every other segment is probably approaching an O^N problem so maybe we could use intersecting bounding boxes to speed it up.

Just a thought.

jesselangdon commented 7 years ago

Not sure if this is actually an 'error'. In most actual stream networks, crossed reaches do legitimately exists (i.e. canals crossing natural stream flows). This was considered an 'error' in arcGNAT, because crossed reaches would cause issues with calculating stream order, but that may not be an issue in pyGNAT, depending on how we handle stream ordering.