<div dir="ltr">Hi,<div><br></div><div>I am interested in calculating stream order (Strahler, Shreve) for stream networks based on GRASS vector networks (e.g. created by <a href="http://v.net">v.net</a>) without using the raster approach of the GRASS add-on r.stream.order. Therefore, I came across following paper:</div><div><br></div><div><span style="color:rgb(0,0,0);font-family:Arial,'Lucida Grande',Geneva,Verdana,Helvetica,'Lucida Sans Unicode',sans-serif;font-size:12px;line-height:15.6000003814697px">Gleyzer, A., Denisyuk, M., Rimmer, A. and Salingar, Y. (2004), A FAST RECURSIVE GIS ALGORITHM FOR COMPUTING STRAHLER STREAM ORDER IN BRAIDED AND NONBRAIDED NETWORKS. JAWRA Journal of the American Water Resources Association, 40: 937–946. doi: 10.1111/j.1752-1688.2004.tb01057.x</span></div><div><br></div><div>which also provides pseudocode to calculate Strahler order for non-braided and braided vector networks defined by arcs and nodes. Thus, I am wondering if it is possible to get the information from which node a specific arc starts (from_node) and where it drains to (to_node). BTW, I seems some kind of this information is already provided with the NC-dataset (FNODE_ and TNODE column) in the streams attribute table, however I don't know where this information comes from. Of course to extract this information the network needs to be directed to define what is the upstream and what the downstream node of each arc. However, having this information available, it should not be to complicated to apply the algorithm proposed by Gleyzer et al 2004. Thus I am interested to get 'from_node' and 'to_node' information e.g. stored in the attribute table of <a href="http://v.net">v.net</a> output?</div><div><br></div><div>Here the pseudocode provided by Gleyzer et al 2004:</div><div><br></div><div>########################################################################</div><div><div>MakeDictionaries(Network)</div><div>1 for each Arc ∈ Network</div><div>2 do FromNodesPerArc[Arc's ID] ← Arc’s FromNodeID</div><div>3 InflowingArcsPerNode[Arc's ToNodeID] ← InflowingArcsPerNode[Arc’s ToNodeID] ∪ Arc’s ID</div><div>4 OriginatingNode[Arc's ID] ← Arc’s FromNodeID</div><div><br></div><div>StreamOrdering(ArcID)</div><div>1 Visited[ArcID] ← true</div><div>2 if | InflowingArcsPerNode[ FromNodesPerArc[ArcID] ] | = 0</div><div>3 then StreamOrders[ArcID] ← 1</div><div>4 else</div><div>5 for each Arc ∈ InflowingArcsPerNode[ FromNodesPerArc[ArcID] ]</div><div>6 do if not Visited[Arc]</div><div>7 then UpstreamOrders[Arc] ← (StreamOrdering(Arc), OriginatingNode[Arc])</div><div>8 else UpstreamOrders[Arc] ← (StreamOrders[Arc], OriginatingNode[Arc])</div><div>9 MaxOrder ← 0</div><div>10 MaxOrderCount ← 0</div><div>11 for each (Order, Origin) ∈ UpstreamOrders</div><div>12 do if Order > MaxOrder</div><div>13 then MaxOrder ← Order</div><div>14 MaxOrderCount ← 1</div><div>15 MaxOrderOrigin ← Origin</div><div>16 else if Order = MaxOrder</div><div>17 then if Origin ≠ MaxOrderOrigin</div><div>18 then MaxOrderCount ← MaxOrderCount + 1</div><div>19 if MaxOrderCount > 1</div><div>20 then StreamOrders[ArcID] ← MaxOrder + 1</div><div>21 OriginatingNode[ArcID] ← FromNodesPerArc[ArcID]</div><div>22 else StreamOrders[ArcID] ← MaxOrder</div><div>23 OriginatingNode[ArcID] ← MaxOrderOrigin</div><div>24 if SegmentIDsPerOriginatingNode[ OriginatingNode[ArcID] ] = nil</div><div>25 then SegmentIDs[ StreamOrders[ArcID] ] ← SegmentIDs[ StreamOrders[ArcID] ] + 1</div><div>26 SegmentIDsPerOriginatingNode[ OriginatingNode[ArcID] ] ← SegmentIDs[ StreamOrders[ArcID] ]</div><div>27 Segments[ArcID] ← SegmentIDsPerOriginatingNode[ OriginatingNode[ArcID] ]</div><div>28 return StreamOrders[ArcID]</div></div><div><div>########################################################################</div><div></div></div><div><br></div><div>Is there anyone having experience with that, or has already tried to implement a vector-stream order approach in GRASS GIS. Specifically I am interested</div><div>in Shreve stream order for simple (non-braided) stream networks and Strahler stream order for braided river networks (Gleyzer et al 2004).</div><div><br></div><div>Best regards,</div><div>Johannes</div></div>