[GRASS-dev] v.net.strahler

Dear developers,

I am looking for a way to do a Horton/Strahler-analysis, preferably on vector data.

There are modules for this in JGrass (raster only and difficult to integrate in a GRASS-script), SagaGIS (even more difficult to integrate) and David Tarboton's TAUDEM (a GPL'd module for ArcGIS - most difficult to integrate in my workflow)

At the moment I am struggling with such workarounds but a native solution in GRASS-GIS would make my life easier these days.

Do you, from a developer's point of view, think it would be difficult to implement a vector module for GRASS GIS that essentially does the following:

1) Find source segments of a network; assign order=1
2) For every source segment: follow downstream and check at first confluence:
    confluence with segment without order: do nothing
    confluence with segment of same order -> assign order=2 (order++) to the resulting stream
    confluence with segment of lower order -> assign higher order to resulting stream
3) check if there are segments left without assigned order
    yes: repeat 2) for segments with order++
    no: exit

(If this algorithm is incomplete, flawed or clumsy, please correct me.)

The bigger problem is: My C knowledge is very limited (around chapter three in K&R?) and consequently I don't feel at home with Vlib and DGlib...

So I'm asking you for some hints on how to accomplish such a task, starting with:
- v.net.path and d.path find paths on the network I'm working with, so I assume the network topology already is stored somewhere in the data. If this is correct, how do I access the topology information in order to get the segments that are sharing a common node?

Hope you can help me,
yours,
Florian Kindl