[GRASSLIST:2973] Re: invalid #dims or fields for site import

Hamish hamish_nospam at yahoo.com
Thu Mar 18 00:52:21 EST 2004


> > I am using s.in.dbf sites=horse input=horse  The file
> > I am including has one field: -116.656290 32.789870  horse
> > 
> > This is my error:
> > ERROR: ebuf -116.656290 nbuf 32.789870 @"Horse"
...

> Here is the unmodified file.. I think the version A had another
> problem.

Ok, I see that second file as a single line of data.


The problem is the column format:

GRASS53 > s.in.dbf -l tbl_hrspos1103.dbf 
Attribute fields available in tbl_hrspos1103.dbf:
1: ID [float4:19]
2: LON [float4:19]
3: LAT [float4:19]
4: X [float4:19]
5: Y [float4:19]


The man page for s.in.dbf states:
"A field selection/reordering parameter is not yet provided. So the
EAST/NORTH columns have to be the first and second column in the table."

You will see your other cdc file has coordinates as the first two
columns (check the order!).

So there's the problem. It's using the first field (ID) for easting and 
the second (LON) for northing.. and lat/lon northings can't be bigger 
than 90 or smaller than -90. Thus it breaks when it hits latitude -116.
I think that's what's happening anyway.


You can get it to import with the following command though:

dbview -b tbl_hrspos1103.dbf | awk -F: '{print $2 $3 $1}' | \
  s.in.ascii sites=horse


That needs the handy little dbview utility, download the .tar.gz 
source-code package from this page:
  http://packages.debian.org/testing/misc/dbview



Hamish




More information about the grass-user mailing list