[GRASSLIST:8689] Import geodetic points

Dear list,

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
2 5:49:10E 49:47:39N ROODT_REDANGE
3 5:50:32E 49:51:35N ARSDORF
4 5:50:50E 50:00:33N SCHIMPACH
5 5:52:28E 49:35:56N CLEMENCY
6 5:52:53E 49:45:48N REDANGE_ATTERT
7 5:54:04E 49:30:44N OBERKORN
8 5:55:36E 50:03:38N WINCRANGE
------------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 ??)

Thanks a lot,
Ulrich

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

Hamish wrote:

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.

Are you sure, Hamish? I thought that I had implemented that (GRASS 6.1-CVS)
:slight_smile:

cd vector/v.in.ascii/
grep G_scan_easting *

points.c: if (G_scan_easting ( coorbuf, &easting,
window.proj) ){
points.c: G_scan_easting ( tokens[xcol], &x, window.proj);

So you need to convert 5:46:01E into +5.000212963 and
import that way.

This should be no longer needed.

2005-10-04 22:36 markus
        * description.html, in.c, local_proto.h, points.c: DMS LatLong
          import functional now

Please report if it *still* doesn't work.

Markus

>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.
>

Are you sure, Hamish? I thought that I had implemented that (GRASS
6.1-CVS) :slight_smile:

I had not noticed. Good on'ya.

Hamish