irstv/gdms-topology — pull request #25 by agouge (2013-03-28 16:43:15+00:00)
Title: Add ST_StrahlerStreamOrder

In this PR we add a function to calculate the [Strahler number](http://en.wikipedia.org/wiki/Strahler_number) of each vertex in a given input tree, generated by ST_Graph.

For now, we leave it up to the user to make sure that the input graph is in fact a tree. The algorithm will still execute even if the graph is not a tree, but the results will not be exactly correct. I would eventually like to add a tool for helping the user test whether the input graph is a tree and to identify loops in the input graph if it is not a tree.

It is also up to the user to choose the root node of the tree (the root node is not necessarily unique).

The Strahler numbers are computed on the nodes, but the definition is easily extended to the edges. Applying a proportional line to the result, we obtain something like this:

![strahler](https://f.cloud.github.com/assets/2470768/314252/1c8a0fda-97c6-11e2-8f93-1157484dbb30.png)

I will soon be publishing a guide / example beanshell script on the wiki.

This fixes irstv/gdms-topology#17.

Cf. [RivEX](http://www.rivex.co.uk/) for ArgGIS.