[GRASSLIST:7993] Re: v.out.ascii - vertices in a line

Maciek Sieczka werchowyna at epf.pl
Fri Aug 19 15:48:01 EDT 2005


Cheers Dylan,

You made learn some awk, and I owe you!

Maciek

----- Original Message ----- 
From: "Dylan Beaudette" <dylan at iici.no-ip.org>
To: "Maciek Sieczka" <werchowyna at epf.pl>
Cc: <GRASSLIST at baylor.edu>
Sent: Friday, August 19, 2005 12:38 AM
Subject: [GRASSLIST:7978] Re: v.out.ascii - vertices in a line


> Maciek,
>
> Sure, it was something like this:
>
> ...
> utm_easting utm_northing
> utm_easting utm_northing
> utm_easting utm_northing
> utm_easting utm_northing
> ...
>
> just a simple list of x,y coordinate pairs.
>
> Hope that helps,
>
> Dylan
>
> On Thursday 18 August 2005 01:31 pm, Maciek Sieczka wrote:
>> Dylan
>>
>> Thanks! I'm not familiar with the GPS points data format, so could I ask
>> you to post a few lines of your input and output for me to understand 
>> your
>> sript better?
>>
>> Maciek
>>
>> ----- Original Message -----
>> From: "Dylan Beaudette" <dylan at iici.no-ip.org>
>> To: "Maciek Sieczka" <werchowyna at epf.pl>
>> Cc: <GRASSLIST at baylor.edu>
>> Sent: Wednesday, August 17, 2005 11:25 PM
>> Subject: [GRASSLIST:7961] Re: v.out.ascii - vertices in a line
>>
>> > On Wednesday 17 August 2005 12:27 pm, Maciek Sieczka wrote:
>> >> Hi
>> >>
>> >> I need to craft an ascii vector file, where the first and last vertex
>> >> are given in one line, like in this example:
>> >>
>> >> 885.824 634.545 874.954 452.858
>> >> 874.954 452.858 910.670 327.075
>> >> 910.670 327.075 1013.160 219.927
>> >>
>> >> instead of what v.out.ascii  format=standard gives:
>> >>
>> >> 885.824 634.545
>> >> 874.954 452.858
>> >> 910.670 327.075
>> >> 1013.160 219.927
>> >>
>> >> How can I do it? Please help me.
>> >>
>> >> Maciek
>> >
>> > my first thought is awk ...
>> >
>> > v.out.ascii | awk '{script here}'
>> >
>> > i have done the opposite -- convert x,y into line segment data from GPS
>> > points.
>> > here is how i did it (rather hackish...) walk1.raw contained x,y pairs.
>> >
>> > --------------------
>> > awk '
>> > BEGIN {print "VERTI:" ; n = 0}
>> > {
>> > vertex = $6" "$7
>> > if(  (n > 0 && n < 3) )
>> >   {
>> >   print "L 2\n"old_vertex"\n"vertex
>> >   }
>> >   else if(n >2 )
>> >   {
>> >   print "L 2\n"old_vertex"\n"vertex
>> >   }
>> > old_vertex = vertex
>> > n++
>> > }
>> > ' walk1.raw > walk1.ascii
>> > -----------
>> >
>> > then imported walk1.ascii with v.in.ascii
>> >
>> >
>> > also, Hamish  once suggested looking at the v.in.garmin.sh script for
>> > ideas...
>> >
>> > --
>> > Dylan Beaudette
>> > Soils and Biogeochemistry Graduate Group
>> > University of California at Davis
>> > 530.754.7341
>
> -- 
> Dylan Beaudette
> Soils and Biogeochemistry Graduate Group
> University of California at Davis
> 530.754.7341
>
> 




More information about the grass-user mailing list