Networks / Arcs

David Gerdes dpgerdes at
Fri Oct 21 13:18:18 EDT 1994

In article <memo.725251 at> you wrote:

: Can anyone point me in the direction of documentation / source code / 
: whatever to do with what I'd call 'network searchs', i.e. the ability 
: (preferably in GRASS) to work with the vectors which constitute a river 
: network, e.g. options such as determining what arcs are upstream of a 
: point on another arc.

: I've been looking at the Programmers Manual concerning vectors - am I 
: right in assuming that the GRASS 'Vect_read_next_line' function will just 
: get the next line as it was put in the data file - it doesn't mean the 
: next arc in a sequence which forms a 'line' ?

: Thanks,

: Steve Culshaw
: NRA North West
: e-mail : nra at (use this for general usage)
: or         sculshaw at (Private - only checked at best 
: biweekly)

Well.  The existing library falls short for getting that type of 
data out of a vector map.  What you have to do is poke into the
data structures themselves, which do hold full connectivity information.
The data structures can be found in src/mapdev/diglib/dig_structs.h.

There are some slides floating around someplace that I have used in
classes which give information about the structures.  But basically
when you open a map in Level II mode, all of the connectivity
information is available.  You will need to look in the Node structs to
find what lines are attached at each node, and in the Line structs to
find the next node.  I think there is a program called v.line which
kinduv does some of that, but interactively.

GRASS 5.0 will have full API support for accessing ALL vector information.

  David Gerdes
  US Army Construction Engineering Research Lab
  Spatial Analysis & Systems Team
  dpgerdes at

     Currently at:
      USDA Soil Conservation Service/TISD
      2625 Redwing Rd, Suite 110
      Ft. Collins CO  80526-2878

More information about the grass-dev mailing list