Hi,<br><br>I&#39;m using GTOPO30 DEM data and TRMM (rainfall) data, I selected the data for the whole of africa but I&#39;m getting an error when executing v.rast.stats.<br><br>Here is a step-by-step of what I did:<br><br>
1. GTOPO30 DEM<br>       - downloaded e020n10,w020s10,e020n40,w020n40 compressed files from &quot;<a href="ftp://edcftp.cr.usgs.gov/pub/data/gtopo30/global/">ftp://edcftp.cr.usgs.gov/pub/data/gtopo30/global/</a>&quot;.<br>
       - decompressed all the above files.<br>       - Added &quot;PIXELTYPE SIGNEDINT&quot; in all .HDR files <br>       - warp merged all the .DEM file with  &quot;gdalwarp *.DEM Africa.tif&quot; command.<br>       - projected it with &quot;gdal_translate -a_srs EPSG:4326  Africa.tif DEM.tif&quot;<br>
<br>2. TRMM &quot;rainfall&quot; data<br>      - downloaded 3B42RT.2010061503.1day.tif,3B42RT.2010061503.1day.tfw from &quot;&quot;.<br>      - projected it with &quot;gdal_translate -a_srs EPSG:4326 -projwin -20 40 60 -60 3B42RT.2010061503.1day.tif TRMM.tif &quot;.<br>
<br>Then, imported the two data sets:<br><br>r.in.gdal in=/home/tgumede1/grassdem/ict4eo/DEM.tif out=dem<br>Projection of input dataset and current location appear to match<br> 100%<br>r.in.gdal complete. Raster map &lt;dem&gt; created.<br>
<br>g.region rast=dem<br><br>r.in.gdal in=/home/tgumede1/grassdem/ict4eo/CapeTown_TRMMs.tif out=rainfall target=CapeTown<br>Projection of input dataset and current location appear to match<br> 100%<br>r.in.gdal complete. Raster map &lt;rainfall&gt; created.<br>
<br>r.watershed elevation=dem accumulation=acc drainage=direction stream=str basin=catch memory=300 threshold=100000<br>SECTION 1a (of 5): Initiating Memory.<br>SECTION 1b (of 5): Determining Offmap Flow.<br> 100%<br>SECTION 2: A * Search.<br>
 100%<br>SECTION 3: Accumulating Surface Flow.<br> 100%<br>SECTION 4: Watershed determination.<br> 100%<br>SECTION 5: Closing Maps.<br> 100%<br><br>  <span style="color: rgb(255, 0, 0);">Q: How do one really know the exact threshold value?</span><br style="color: rgb(255, 0, 0);">
<br>r.to.vect in=catch out=catchments feature=area<br>Extracting areas...<br> 100%<br> 100%<br>Building topology for vector map &lt;catchments&gt;...<br>Registering primitives...<br>134246 primitives registered<br>701002 vertices registered<br>
Building areas...<br> 100%<br>44645 areas built<br>1 isles built<br>Attaching islands...<br> 100%<br>Attaching centroids...<br> 100%<br>Number of nodes: 89602<br>Number of primitives: 134246<br>Number of points: 0<br>Number of lines: 0<br>
Number of boundaries: 89604<br>Number of centroids: 44642<br>Number of areas: 44645<br>Number of isles: 1<br>Number of areas without centroid: 3<br>r.to.vect complete.<br><br><br>g.region rast=rainfall<br><br>v.rast.stats vector=catchments raster=rainfall colprefix=precip<br>
WARNING: Area without centroid (may be OK for island)<br>WARNING: Area without centroid (may be OK for island)<br>WARNING: Area without centroid (may be OK for island)<br>DBMI-DBF driver error:<br>SQL parser error: syntax error, unexpected NULL_VALUE processing &#39;NULL&#39;<br>
in statement:<br>UPDATE catchments SET precip_cf_=-NULL WHERE cat=17<br>Error in db_execute_immediate()<br><br>ERROR: Error while executing: &#39;UPDATE catchments SET precip_cf_=-NULL WHERE<br>       cat=17&#39;<br><br><br>
- output of <a href="http://r.info">r.info</a> -g<br><br><a href="http://r.info">r.info</a> -g rainfall<br>north=40<br>south=-60<br>east=60<br>west=-20<br><br>- output of <a href="http://v.info">v.info</a><br><br><a href="http://v.info">v.info</a> -g catchments<br>
north=40<br>south=-60<br>east=60<br>west=-20<br>top=0.000000<br>bottom=0.000000<br><br>output of <a href="http://r.info">r.info</a><br><br>Type of Map:  raster               Number of Categories: 2559            <br>    Data Type:    CELL                                                       <br>
    Rows:         400                                                        <br>    Columns:      320                                                        <br>    Total Cells:  128000                                                     <br>
         Projection: Latitude-Longitude                                      <br>             N:        40N    S:        60S   Res:  0:15                     <br>             E:        60E    W:        20W   Res:  0:15                     <br>
    Range of data:    min = 0  max = 2559                                    <br>                                                                             <br>    Data Description:                                                        <br>
     generated by r.in.gdal                                                  <br>                                                                             <br>    Comments:                                                                <br>
     r.in.gdal input=&quot;/home/tgumede1/grassdem/ict4eo/CapeTown_TRMMs.tif&quot; \   <br>     output=&quot;rainfall&quot; target=&quot;CapeTown&quot;<br><br><br>- output of r.univar<br><br>r.univar rainfall<br> 100%<br>
total null and non-null cells: 115200000<br>total null cells: 0<br><br>Of the non-null cells:<br>----------------------<br>n: 115200000<br>minimum: 0<br>maximum: 2559<br>range: 2559<br>mean: 22.4897<br>mean of absolute values: 22.4897<br>
standard deviation: 83.1312<br>variance: 6910.79<br>variation coefficient: 369.642 %<br>sum: 2590809300<br><br><br><br><br><br>-- <br>Kind Regards<br>TS Gumede<br>CSIR, Meraka Institute<br>072 258 1650<br><br>