[GRASS-dev] v.out.ascii format=script

Glynn Clements glynn at gclements.plus.com
Fri Jun 2 21:52:52 EDT 2006


Jachym Cepicky wrote:

> parsing the output from v.out.ascii format=standard is hard work. 
> 
> Attached patch adds new output format to v.out.ascii called "script".
> With this output, working with vector data in our scripts should be
> *much* simpler.
> 
> If format=script is choosed, each feature will be printed in one line,
> so e.g.
> 
> B  6 1
>  5958812.48844435 3400828.84221011
>  5958957.29887089 3400877.11235229
>  5959021.65906046 3400930.7458436
>  5959048.47580612 3400973.65263665
>  5959069.92920264 3401032.64947709
>  5958812.48844435 3400828.84221011
> 1 1
> 
> will become
> 
> B:6:1:1 1:5958812.48844435 3400828.84221011:5958957.29887089 3400877.11235229:....

Many of the tools which you might want to use to process such data
may have limits on the maximum length of a line.

Writing scripts which expect all the data on one line is a recipe for
producing scripts which only work with "simple" maps (or which only
work with the GNU versions of the standard tools, as they usually
allocate line buffers dynamically).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list