[GRASSLIST:5956] Re: Conversion from points to lines?

Hamish hamish_nospam at yahoo.com
Tue Mar 1 17:30:12 EST 2005


> > Is it possible to convert vector points to lines in Grass 6.0?
> > v.type complained that points to lines are incompatible types. Do I
> > have to do a multi-step conversion from points -> centroids ->
> > something else -> lines instead?
..
> Well I have done it in the past with:
> 
> v.out.ascii in=point_vector out=points.ascii
> awk '{some awk script here}' points.ascii > lines.ascii
> v.in.ascii in=lines.ascii out=lines_vector
> 
> the output from v.out.ascii in=points_vector will look like:
> 0258468 4090205
> 0258462 4090196
> 0258454 4090172
> 0258449 4090158
> 
> ...and you can use AWK to convert it into an ascii line format like:
> L 2
> 0258468 4090205
> 0258462 4090196
..
> ...save the output, and load it back into grass with v.in.ascii
> 
> I had the AWK script somewhere, and now can't find it...sorry.


Have a look at the v.in.garmin script. The awk stuff in there is a bit
thick, but it works.



Hamish




More information about the grass-user mailing list