Open jesselangdon opened 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.
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.
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