[GRASSLIST:8016] Re: ascii vector line format question

Radim Blazek radim.blazek at gmail.com
Mon Aug 22 05:40:53 EDT 2005


On 8/19/05, Maciek Sieczka <werchowyna at epf.pl> wrote:
> Dear All,
> 
> Is it a 100% rule, that the line ending is *always* indicated by "1"?
> 
> Say like here:
> 
> L  12 1
>  597230.44979275 5681618.56747334
>  597235.81795873 5681608.14691583
>  597241.81767366 5681596.14748598
>  1     2
> 
> I have written a simple awk script for exporting Grass vector into a Surfer
> "blanking file", "BLN" ascii format, which is e.g. used for defining
> elevation faults for interpolation in Surfer. I would like to share it on a
> WIKI, but first I need to make sure if the awk search formula I use:
> 
> ( (NR > 10) && ($1 == "L") ) {print $2",0"}
> ( (NR > 10) && ($1 != "L") && ($1 !=1) ) {print $1","$2}
> 
> is 100% compatible with any possible Grass ascii line vector file.
> 
> Maciek

No, it depends on number of layers and categories specified as second
number after L, here are some examples:
L  2 0
 597230.44979275 5681618.56747334
 597235.81795873 5681608.14691583
L  2
 597230.44979275 5681618.56747334
 597235.81795873 5681608.14691583
L  2 1
 597230.44979275 5681618.56747334
 597235.81795873 5681608.14691583
 1     2
L  2 2
 597230.44979275 5681618.56747334
 597235.81795873 5681608.14691583
 1     2
 1     3
L  2 3 
 597230.44979275 5681618.56747334
 597235.81795873 5681608.14691583
 1     2
 1     3
 2    123

Radim




More information about the grass-user mailing list