[GRASS-user] v.rast.stats

Sandile Gumede akasandile at gmail.com
Wed Jul 14 07:31:45 EDT 2010


Hi,

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.

Here is a step-by-step of what I did:

1. GTOPO30 DEM
       - downloaded e020n10,w020s10,e020n40,w020n40 compressed files from "
ftp://edcftp.cr.usgs.gov/pub/data/gtopo30/global/".
       - decompressed all the above files.
       - Added "PIXELTYPE SIGNEDINT" in all .HDR files
       - warp merged all the .DEM file with  "gdalwarp *.DEM Africa.tif"
command.
       - projected it with "gdal_translate -a_srs EPSG:4326  Africa.tif
DEM.tif"

2. TRMM "rainfall" data
      - downloaded 3B42RT.2010061503.1day.tif,3B42RT.2010061503.1day.tfw
from "".
      - projected it with "gdal_translate -a_srs EPSG:4326 -projwin -20 40
60 -60 3B42RT.2010061503.1day.tif TRMM.tif ".

Then, imported the two data sets:

r.in.gdal in=/home/tgumede1/grassdem/ict4eo/DEM.tif out=dem
Projection of input dataset and current location appear to match
 100%
r.in.gdal complete. Raster map <dem> created.

g.region rast=dem

r.in.gdal in=/home/tgumede1/grassdem/ict4eo/CapeTown_TRMMs.tif out=rainfall
target=CapeTown
Projection of input dataset and current location appear to match
 100%
r.in.gdal complete. Raster map <rainfall> created.

r.watershed elevation=dem accumulation=acc drainage=direction stream=str
basin=catch memory=300 threshold=100000
SECTION 1a (of 5): Initiating Memory.
SECTION 1b (of 5): Determining Offmap Flow.
 100%
SECTION 2: A * Search.
 100%
SECTION 3: Accumulating Surface Flow.
 100%
SECTION 4: Watershed determination.
 100%
SECTION 5: Closing Maps.
 100%

  Q: How do one really know the exact threshold value?

r.to.vect in=catch out=catchments feature=area
Extracting areas...
 100%
 100%
Building topology for vector map <catchments>...
Registering primitives...
134246 primitives registered
701002 vertices registered
Building areas...
 100%
44645 areas built
1 isles built
Attaching islands...
 100%
Attaching centroids...
 100%
Number of nodes: 89602
Number of primitives: 134246
Number of points: 0
Number of lines: 0
Number of boundaries: 89604
Number of centroids: 44642
Number of areas: 44645
Number of isles: 1
Number of areas without centroid: 3
r.to.vect complete.


g.region rast=rainfall

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'


- output of r.info -g

r.info -g rainfall
north=40
south=-60
east=60
west=-20

- output of v.info

v.info -g catchments
north=40
south=-60
east=60
west=-20
top=0.000000
bottom=0.000000

output of r.info

Type of Map:  raster               Number of Categories: 2559
    Data Type:    CELL

    Rows:         400

    Columns:      320

    Total Cells:  128000

         Projection: Latitude-Longitude

             N:        40N    S:        60S   Res:  0:15

             E:        60E    W:        20W   Res:  0:15

    Range of data:    min = 0  max = 2559



    Data Description:

     generated by r.in.gdal



    Comments:

     r.in.gdal input="/home/tgumede1/grassdem/ict4eo/CapeTown_TRMMs.tif" \

     output="rainfall" target="CapeTown"


- output of r.univar

r.univar rainfall
 100%
total null and non-null cells: 115200000
total null cells: 0

Of the non-null cells:
----------------------
n: 115200000
minimum: 0
maximum: 2559
range: 2559
mean: 22.4897
mean of absolute values: 22.4897
standard deviation: 83.1312
variance: 6910.79
variation coefficient: 369.642 %
sum: 2590809300





-- 
Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100714/e643fe5c/attachment-0001.html


More information about the grass-user mailing list