[GRASS-user] GRASS63cvs v.rast.stats reports zero for many CATs

Markus Neteler neteler at itc.it
Wed Apr 11 08:20:51 EDT 2007


On Sat, Apr 07, 2007 at 02:24:30PM +0200, Maciej Sieczka wrote:
...
> Is it possible that the slope raster has really small values at these
> locations, ie. with numbers after 10th decimal place? There is a note
> in the v.rast.stats (it's a shell script), line 165:
> 
> #check if DBF driver used, in this case cut to 10 chars col names:
> 
> Propably Markus (script author) can explain why this is necessary.

Necessary, but not desired :-) The problem is the 10 chars
limitation in the DBF specifications, at least in the implementation
which we use (OGR/SHAPELIB). You cannot have longer column names in DBF.

Solution: Use SQLite instead (doesn't need a server). See
g.manual grass-sqlite
for details. I just see that it explains how to create the SQLite DB...
This isn't needed as GRASS will do it for you automatically! Will
change (simplify) the docs now. You just create a new mapset and
then run

db.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db'
db.connect -p
db.tables -p
# of course there is no table yet

Then run 
 g.copy vect=oldmap,newmap
and everything is converted. Then v.rast.stats again...

cheers
Markus




More information about the grass-user mailing list