Required attributes: id, fromnode, tonode
When considering downstream connections with diversions, there are three
factors considered to determine which is primary.
1a) same name
1b) is named
2) feature type (type_attr controls this)
3) flows to coast (has a coastal connection is preferred)
The following list describes the order of precedence for tests
1: 1a, 2, 3
2: 1a, 2
3: The NHDPlus uses diverted fraction this is not used currently.
4: 1b, 2, 3
5: 2, 3
6: 1b, 3
7: 3,
8: 1b, 2
9: 2
10: 1b
If all checks return and no primary connection has been identified, the
connection with a smaller id is chosen.
In the case that there are two or more upstream connections, the upstream
name to use is chosen 1) if there is only one upstream flowline with a name
2) if one of the upstream flowlines with a name matches the downstream line,
3) if one of the upstream flowlines is of a "major" type and others are not,
and, 4) if no criteria exist to select one, the smallest id value otherwise.