[GRASS-dev] [grass-code I][328] v.in.ascii: skip= does not work

Hamish hamish_nospam at yahoo.com
Fri Mar 9 18:59:06 EST 2007


grass-codei at wald.intevation.org wrote:
> code I item #328, was opened at 2007-03-09 21:47
..
> Summary: v.in.ascii: skip= does not work 
..
> Try this example:
> 
> echo "a rubbish comment line
> L 5 1
> 591336 4927369 1224
> 594317 4925341 1292
> 599356 4925162 1469
> 602396 4926653 1235
> 607524 4925431 1216
> 1 321 " | v.in.ascii -n skip=1 out=line format=standard
> 
> In spite of skip=1, the module yields and error:
> 
> WARNING: Error reading ascii file: [a rubbish comment line]


skip= only works in points mode, it's there to skip over column headings
in a .csv file. I'm not sure how it should work in combination with the
-n flag for standard mode.

In standard mode you need to start comment lines with a hash (#).



> Another thing is that although the nature of the error is fatal, the
> module proceeds anyway and exits with status 0. An ERROR should be
> issued instead of WARNING, and v.in.ascii should exit immadietly with
> status 1.

a2b.c uses G_warning() and return 0 instead of G_fatal_error().

perhaps that is so it will load as much as it can, stop when it finds an
error, and cleanly build and close the ok data before that in the vector
map? the return 0 should probably be return 1 for starters.


Hamish




More information about the grass-dev mailing list