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

Radim Blazek radim.blazek at gmail.com
Mon Sep 25 09:11:14 EDT 2006


On 9/25/06, Markus Neteler <neteler at itc.it> wrote:
> On Mon, Sep 25, 2006 at 11:45:36AM +0200, Radim Blazek wrote:
> > On 9/25/06, Markus Neteler <neteler at itc.it> wrote:
> > >Hi,
> > >
> > >trying the new Python-Vector API, I found a discrepancy which
> > >I would like to understand:
> > >
> > >On 'roads' in Spearfish, v.info reports
> > >   Number of lines:        825
> > >based on Vect_get_num_primitives(&Map, GV_LINE)
> > >
> > >If I use in the Python API the Vect_get_num_lines(map),
> > >I get
> > >Number of lines: 2876
> > >
> > >Difference:
> > >- Vect_get_num_primitives uses map->plus.n_llines
> > >- Vect_get_num_lines      uses map->plus.n_lines
> > >
> > >Which one is right? Probably Vect_get_num_lines() should
> > >use n_lines as well and we need an extra function to
> > >report segments?
> >
> > It must be a bug in Python API, Vect_get_num_lines() must
> > also give 825.
>
> While a bug in Python API is likely, I wonder about the
> difference between
>
> map->plus.n_llines  and
> map->plus.n_lines

n_lines are all primitives (elements) in coor file, i.e. without
areas and n_llines are only primitives of type GV_LINE.

> May I ask you to explain it (or point me to the docs?)?
>
> Related: I assume that v.info should be changed to use
> Vect_get_num_lines() etc instead of Vect_get_num_primitives()?

It depends what you want to print, IMO it is correct.

Radim

> thanks
> Markus
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev
>




More information about the grass-dev mailing list