SouthForkResearch / pyGNAT

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

Identify valid disconnected networks, vs. disconnection due to error #2

Closed jesselangdon closed 7 years ago

jesselangdon commented 7 years ago

Tributaries can be disconnected from the surrounding stream network (as valid salmon habitat) due to being connected by canals only ( i.e. "valid" disconnection)

Stream reaches and tributaries can be disconnected due to a geometry error, i.e. missing segments.

This may be partially solved by the selecting reaches using the NHD FCode (336), in combination with measuring the distance between disconnected reaches.

For example, if a stream reach TO point and FROM point are separated by < 2 meter distance, this is an INVALID disconnection.

MattReimer commented 7 years ago

IMHO I think this is the biggest and most interesting problem of all the cards you've created.

Someone (I'm volunteering myself) needs to figure out how networkX parses networks and then coordinate with @jesselangdon to figure out how to go further and parse these disconnections based on NHD FCode or whatever.

Some questions that need to be answered.

  1. Why/when does networkX create disconnected segments
  2. If networkX disconnects in places we don't intent can we reconnect those networks easily?
  3. How to we create disconnection when we need to?
MattReimer commented 7 years ago

OK, see commit above:

I've been able to identify all disconnected networks. It ends up looking like this:

screen shot 2017-03-10 at 1 29 58 pm

The code also shows you how to identify the biggest segment (I assume that's important)

Finding the nearest node to the first node in a disconnected segment should be possible too.

jesselangdon commented 7 years ago

This functionality has been incorporated into the network.py and the build_network_dialog.py modules