[GRASS5] [5.7] v.out.ascii to stdout

Hamish hamish_nospam at yahoo.com
Wed May 26 23:39:51 EDT 2004


On Wed, 26 May 2004 15:58:44 +0200
Radim Blazek <blazek at itc.it> wrote:

> On Tuesday 18 May 2004 13:15, Hamish wrote:
> > > That's correct, I think,  did you get a wrong output?
> > > Maybe better  !(type & (GV_POINT|GV_CENTROID) ) ?
> >
> > Without the change I get no output:
> >
> > G57: > v.out.ascii in=land
> > writing to stdout
> > G57: >
> >
> > same for maps with only areas or maps with only lines.
> 
> Correct, no points.

Perhaps we should add a "WARNING: no point data" message in that case?


> > Changing & to && I get:
> >
> > G57: > v.out.ascii in=land | wc -l
> > writing to stdout
> > 2016589.9107143|5433474.7978984
> > [...]
> > G57: > v.out.ascii in=land | wc -l
> > 4750
> 
> Wrong, 'type && GV_POINT' is always true, writes out first point of
> lines.
> 
> > Changing to "if ( pnt && !(type & (GV_POINT|GV_CENTROID) ) ) {"
> >  I get:
> >
> > G57: > v.out.ascii in=land
> > writing to stdout
> > 2017617.60219158|5435424.46544081|1
> > [...]
> > G57: > v.out.ascii in=land | wc -l
> > 2308
> 
> OK, writes centroids (in this case).
> 
> > not sure which is "better" or expected output. Usually I'd think
> > nodes were more useful to have exact positions for than centroids..
> 
> This I don't understand.


Perhaps we should think about adding a type=point,area,centroid,line,etc
option to v.out.ascii?

This isn't something I need right now, but it might be useful to
someone..



Hamish




More information about the grass-dev mailing list