[GRASSLIST:8704] Re: Import geodetic points

Markus Neteler neteler at itc.it
Thu Oct 20 04:19:01 EDT 2005


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)
:-)

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




More information about the grass-user mailing list