Hi,<br><br>Can anyone help!<br><br><div class="gmail_quote">On Wed, Jul 14, 2010 at 1:31 PM, Sandile Gumede <span dir="ltr">&lt;<a href="mailto:akasandile@gmail.com">akasandile@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
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/" target="_blank">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<div class="im"><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></div>g.region rast=dem<br><br>r.in.gdal in=/home/tgumede1/grassdem/ict4eo/CapeTown_TRMMs.tif out=rainfall target=CapeTown<div class="im"><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></div>r.watershed elevation=dem accumulation=acc drainage=direction stream=str basin=catch memory=300 threshold=100000<div class="im"><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></div>  <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<div class="im"><br>Extracting areas...<br> 100%<br> 100%<br>Building topology for vector map &lt;catchments&gt;...<br>Registering primitives...<br></div>134246 primitives registered<br>
701002 vertices registered<br>
Building areas...<br> 100%<br>44645 areas built<div class="im"><br>1 isles built<br>Attaching islands...<br> 100%<br>Attaching centroids...<br> 100%<br></div>Number of nodes: 89602<br>Number of primitives: 134246<div class="im">
<br>Number of points: 0<br>Number of lines: 0<br></div>
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)<div class="im"><br>DBMI-DBF driver error:<br>SQL parser error: syntax error, unexpected NULL_VALUE processing &#39;NULL&#39;<br>

in statement:<br></div>UPDATE catchments SET precip_cf_=-NULL WHERE cat=17<div class="im"><br>Error in db_execute_immediate()<br><br></div>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" target="_blank">r.info</a> -g<br><br><a href="http://r.info" target="_blank">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" target="_blank">v.info</a><br>
<br><a href="http://v.info" target="_blank">v.info</a> -g catchments<br>
north=40<br>south=-60<br>east=60<br>west=-20<div class="im"><br>top=0.000000<br>bottom=0.000000<br><br></div>output of <a href="http://r.info" target="_blank">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><div class="im">                                                                             <br>    Data Description:                                                        <br>

     generated by r.in.gdal                                                  <br>                                                                             <br>    Comments:                                                                <br>
</div>
     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<div class="im"><br>total null cells: 0<br><br>Of the non-null cells:<br>----------------------<br></div>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<div><div></div><div class="h5"><br><br><br><br><br><br>-- <br>Kind Regards<br>TS Gumede<br>CSIR, Meraka Institute<br>
072 258 1650<br><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Kind Regards<br>TS Gumede<br>CSIR, Meraka Institute<br>072 258 1650<br><br>