[GRASS-user] DBMI-DBF driver error

Markus Neteler neteler at osgeo.org
Fri Jul 16 16:12:32 EDT 2010


On Thu, Jul 15, 2010 at 1:10 PM, Sandile Gumede <akasandile at gmail.com> wrote:
...
>> I'm using GTOPO30 DEM data and TRMM (rainfall) data, I selected the data
>> for the whole of africa but I'm getting an error when executing
>> v.rast.stats.
...
>> v.rast.stats vector=catchments raster=rainfall colprefix=precip
>> WARNING: Area without centroid (may be OK for island)
>> WARNING: Area without centroid (may be OK for island)
>> WARNING: Area without centroid (may be OK for island)
>> DBMI-DBF driver error:
>> SQL parser error: syntax error, unexpected NULL_VALUE processing 'NULL'
>> in statement:
>> UPDATE catchments SET precip_cf_=-NULL WHERE cat=17
>> Error in db_execute_immediate()
>>
>> ERROR: Error while executing: 'UPDATE catchments SET precip_cf_=-NULL
>> WHERE
>>        cat=17'

There is a minus sign in front of NULL - never seen that and likely not
SQL compliant (at least for the DBF driver which is just an enhanced table
driver).

Maybe it comes from here?

[neteler at localhost v.rast.stats]$ grep NULL *
v.rast.stats:   eval `r.univar -g $EXTSTAT map="$RASTER"
percentile="$GIS_OPT_PERCENTILE" | sed 's+nan+NULL+g'`

but AFAIK r.univar would not output -nan.

Please edit your v.rast.stats script ("which v.rast.stats") to find
the path if on Unix-like OS)
and change the first line from

#!/bin/sh

to

#!/bin/sh -x

and run it again. From the detailed output you may see where this spurious "-"
comes in and tell us about it.

Markus


More information about the grass-user mailing list