[GRASS-dev] Vect_get_num_lines() versus Vect_get_num_primitives()

Paul Kelly paul-grass at stjohnspoint.co.uk
Mon Sep 25 07:13:10 EDT 2006


Hello Moritz

On Mon, 25 Sep 2006, Moritz Lennert wrote:

> When working on a revision of d.vect.chart, I got the feeling that
> Vect_get_num_lines was used as if it returned the number of _all_ the
> features in the map, not only the lines (from lines 49+ of
> display/d.vect.chart/plot.c):
>
> nlines = Vect_get_num_lines ( Map );
> 	/* loop through each vector feature */
> for ( line = 1; line <= nlines; line++ ) {
>    G_debug ( 3, "line = %d", line );
>    ltype =  Vect_read_line (Map, Points, Cats, line);
>
> As you can create charts with vector point, I don't know how this would
> work, if Vect_get_num_lines returns only number of lines.

My understanding is that a point is represented as a line containing only 
one node. So the number of lines is equivalent to the number of points. I 
have very limited experience with this but in any maps I came across while 
testing recent changes to v.surf.idw to remove it's dependency on 
topology, this is how points where represented.

Paul




More information about the grass-dev mailing list