[GRASSLIST:5948] Conversion from points to lines?

Hey,

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?

I also tried v.build.polylines. The manual page says its possible to use
points in the input map; and the program runs cleanly with no error
messages, but no lines are built in the process.

Thanks,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Eric Patton

Technologist, Geo-Spatial Data Services

Geological Survey of Canada (Atlantic)

Natural Resources Canada

Bedford Institute of Oceanography

Dartmouth, Nova Scotia, Canada B2Y 4A2

Postal address: P.O. Box 1006

Courier address: 1 Challenger Drive

Telephone: (902)426-7732

Facsimile: (902)426-4104

E-mail: <mailto:epatton@NRCan.gc.ca> epatton@NRCan.gc.ca

c

On Tuesday 01 March 2005 07:49 am, Patton, Eric wrote:

Hey,

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?

Hi,

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
L 2
0258462 4090196
0258454 4090172
L 2
0258454 4090172
0258449 4090158

...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.

--
Dylan Beaudette
Soil Science Graduate Group
University of California at Davis

> 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