[GRASSLIST:8697] Re: Import geodetic points
Hamish
hamish_nospam at yahoo.com
Wed Oct 19 17:25:37 EDT 2005
> what is the correct geodetic format GRASS can import. I am trying to
> import the following text file:
>
> cat long lat loc
> 1 5:46:01E 49:48:33N PERLE
..
> ------------snip-------------------------------
>
> with the following COMMAND:
>
> > tail +2 georef_man.txt | v.in.ascii fs='\t' out=precip x=2 y=3 cat=1 \
> columns='cat int, x double, y double, label varchar(20)'
>
> I get the following ERROR message:
>
> Maximum input row length: 40
> Maximum number of columns: 4
> Minimum number of columns: 4
> ERROR: x column is not of number type
>
> Apparently, the geographical coordinates are in the wrong format and
> the column specification is probably also wrong (columns= x double,
> ...).
>
> Which format do I have to use for degrees, minutes and seconds? And
> how can I specify that in the columns option? (x long, y lat ??)
v.in.ascii will not (currently) read ddd:mm:ss format coordinates. It
should be using the G_scan_easting() and G_scan_northing() library
functions to convert these into floating point numbers but this hasn't
been done yet. So you need to convert 5:46:01E into +5.000212963 and
import that way. It is seeing the d:m:s input as a text string when it
wants a number.
ps: "fs=tab" works and you might want to use "skip=1" to avoid having to
use `tail +2` and save the header line to the map's history file.
Alternatively you can #comment out the header line to skip it.
Hamish
More information about the grass-user
mailing list