Hi,<br><br>Thanks for the suggestions. I have downloaded the GTOPO30 data from their website, its a compressed file e020n40.tar.gz I guess these are the coordinates for part of Africa. I have decompressed the file and inside there are 8 files; .DEM, .DMW, .GIF, .HDR, .PRJ, .SCH, .STX, .SRC.<br>
<br>Is the .GIF file the one I&#39;m supposed to project in order to use it in GRASS?<br>

<br><div class="gmail_quote">2010/7/9  <span dir="ltr">&lt;<a href="mailto:micha@arava.co.il" target="_blank">micha@arava.co.il</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div>&gt; These are my data sets attached:<br>
&gt;<br>
&gt; 1. Dem_CF.tif   is the DEM<br>
&gt; 2. TRMMLast1day.tif  is the rainfall data<br>
&gt;<br>
&gt; On Fri, Jul 9, 2010 at 2:53 PM, Sandile Gumede &lt;<a href="mailto:akasandile@gmail.com" target="_blank">akasandile@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;&gt; Is there any one who can help me?<br>
<br>
</div><div>I&#39;m away this week, so I can only add a quick response:<br>
<br>
I still see two &quot;glaring&quot; problems in your technique.<br>
1- You mentioned that you try to &quot;sort out the resolution&quot; between the two<br>
data sources. One source, the rainfall data, is a raster of 27 km. pixel<br>
size, while the other, the DEM is 90 m. pixel size. I don&#39;t believe that<br>
you can resolve this gap. You can not compare data with such a gap in<br>
resolution.  The only thing possible with rainfall data at that resolution<br>
is *continent scale* maps. You can get the gtopo30 DEM (1 km. resolution,<br>
I think) for all of Africa for example, and compare that with rainfall<br>
data for all of Africa.<br>
2- When you get to the step of watershed creation, you seem to be using<br>
illogical threshold values. Below you set threshold=1. That means every<br>
single cell in the dem will become a basin! That&#39;s certainly *not* what<br>
you want. Typical threshold values will be in the 1000&#39;s, even 10&#39;s of<br>
thousands.<br>
--<br>
Micha<br>
&gt;&gt;<br>
&gt;&gt;<br>
</div><div><div></div><div>&gt;&gt; On Wed, Jul 7, 2010 at 3:15 PM, Sandile Gumede<br>
&gt;&gt; &lt;<a href="mailto:akasandile@gmail.com" target="_blank">akasandile@gmail.com</a>&gt;wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;ve tried to sort out the issue of the region resolution. Now when I&#39;m<br>
&gt;&gt;&gt; running v.rast.stats it says:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ERROR: No categories found in raster map<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Here is the script I&#39;m running thats giving me that error:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; #!/bin/sh<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; #variable to customize:<br>
&gt;&gt;&gt; # path to GRASS software main directory<br>
&gt;&gt;&gt; GISBASE=/usr/lib/grass64<br>
&gt;&gt;&gt; # path to GRASS database<br>
&gt;&gt;&gt; GISDBASE=$HOME/grassdata/Cape_Town<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; LOCATION_NAME=SRTMDEM<br>
&gt;&gt;&gt; MAPSET=PERMANENT<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # nothing to change below<br>
&gt;&gt;&gt; MAP=$1<br>
&gt;&gt;&gt; LOCATION=$2<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # generate temporal LOCATION:<br>
&gt;&gt;&gt; TEMPDIR=FLOODS<br>
&gt;&gt;&gt; mkdir -p $GISDBASE/$LOCATION_NAME/$MAPSET<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # save existing $HOME/.grassrc6<br>
&gt;&gt;&gt; if test -e $HOME/.grassrc6 ; then<br>
&gt;&gt;&gt; mv $HOME/.grassrc6 /tmp/$TEMPDIR.grassrc6<br>
&gt;&gt;&gt; fi<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; echo &quot;LOCATION_NAME: $LOCATION_NAME&quot; &gt; $HOME/.grassrc6<br>
&gt;&gt;&gt; echo &quot;MAPSET:$MAPSET&quot;                &gt;&gt; $HOME/.grassrc6<br>
&gt;&gt;&gt; echo &quot;DIGITIZER: none&quot;               &gt;&gt; $HOME/.grassrc6<br>
&gt;&gt;&gt; echo &quot;GISDBASE: $GISDBASE&quot;           &gt;&gt; $HOME/.grassrc6<br>
&gt;&gt;&gt; export GISBASE=$GISBASE<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # Create a WIND file with minimal information and no projection:<br>
&gt;&gt;&gt; echo &quot;proj: 3<br>
&gt;&gt;&gt; zone:       0<br>
&gt;&gt;&gt; north:      1<br>
&gt;&gt;&gt; south:      0<br>
&gt;&gt;&gt; east:       1<br>
&gt;&gt;&gt; west:       0<br>
&gt;&gt;&gt; cols:       1<br>
&gt;&gt;&gt; rows:       1<br>
&gt;&gt;&gt; e-w resol:  1<br>
&gt;&gt;&gt; n-s resol:  1<br>
&gt;&gt;&gt; top:        1<br>
&gt;&gt;&gt; bottom:     0<br>
&gt;&gt;&gt; cols3:      1<br>
&gt;&gt;&gt; rows3:      1<br>
&gt;&gt;&gt; depths:     1<br>
&gt;&gt;&gt; e-w resol3: 1<br>
&gt;&gt;&gt; n-s resol3: 1<br>
&gt;&gt;&gt; t-b resol:  1<br>
&gt;&gt;&gt; &quot; &gt; $GISDBASE/$LOCATION_NAME/$MAPSET/WIND<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # Copy WIND-file to DEFAULT_WIND:<br>
&gt;&gt;&gt; cp $GISDBASE/$LOCATION_NAME/$MAPSET/WIND \<br>
&gt;&gt;&gt;  $GISDBASE/$LOCATION_NAME/$MAPSET/DEFAULT_WIND<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; echo &quot;name:      Latitude-Longitude<br>
&gt;&gt;&gt; datum:           wgs84<br>
&gt;&gt;&gt; towgs84:         0.000,0.000,0.000<br>
&gt;&gt;&gt; proj:            ll<br>
&gt;&gt;&gt; ellps:             wgs84<br>
&gt;&gt;&gt; &quot;&gt; $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_INFO<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; echo &quot;unit: degree<br>
&gt;&gt;&gt; ubits:      degrees<br>
&gt;&gt;&gt; meters:     1.0<br>
&gt;&gt;&gt; &quot;&gt; $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_UNITS<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH<br>
&gt;&gt;&gt; export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH<br>
&gt;&gt;&gt; export GIS_LOCK=$$<br>
&gt;&gt;&gt; export GISRC=$HOME/.grassrc6<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # this should print GRASS version used:<br>
&gt;&gt;&gt; g.version<br>
&gt;&gt;&gt; # other calculations go here....<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # import rainfall data set.<br>
&gt;&gt;&gt;  cd /home/tgumede1/grassdata/Cape_Town<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # rainfall data set.<br>
&gt;&gt;&gt; r.in.gdal input=$HOME/grassdata/Cape_Town/TRMMLast1day.tif<br>
&gt;&gt;&gt; output=rainfall<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # DEM data set.<br>
&gt;&gt;&gt; r.in.gdal input=$HOME/grassdata/Cape_Town/Dem_CF.tif target=SRTMDEM<br>
&gt;&gt;&gt; output=dem<br>
&gt;&gt;&gt;  g.region rast=dem -p<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # creating set of maps indicating flow acc, drainage dir, streams<br>
&gt;&gt;&gt; r.watershed --o elevation=dem@PERMANENT drainage=flow_direction<br>
&gt;&gt;&gt; basin=catch accumulation=acc threshold=1 memory=300 stream=str<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # convert catch raster to polygon vector<br>
&gt;&gt;&gt; r.to.vect in=catch@PERMANENT out=catchments feature=area<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  g.region rast=rainfall -p<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; # Calculate univariate statistics<br>
&gt;&gt;&gt; v.rast.stats -c vector=catchments@PERMANENT<br>
</div></div>&gt;&gt;&gt; raster=rainfall@PERMANENTcolpre=precp<br>
<div><div></div><div>&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Jul 7, 2010 at 9:18 AM, Sandile Gumede<br>
&gt;&gt;&gt; &lt;<a href="mailto:akasandile@gmail.com" target="_blank">akasandile@gmail.com</a>&gt;wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hi<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Which module do I use to change the resolutions?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 2010/7/6 &lt;<a href="mailto:micha@arava.co.il" target="_blank">micha@arava.co.il</a>&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hello Sandile:<br>
&gt;&gt;&gt;&gt;&gt; It seems you are importing two raster with vastly different<br>
&gt;&gt;&gt;&gt;&gt; resolutions.<br>
&gt;&gt;&gt;&gt;&gt; (I think we already came across this). See below...<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Hi<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Below is a step-by-step of what I have done but I&#39;m getting an<br>
&gt;&gt;&gt;&gt;&gt; error<br>
&gt;&gt;&gt;&gt;&gt; when<br>
&gt;&gt;&gt;&gt;&gt; &gt; running v.rast.stats vector=catchments raster=rainfall layer=1<br>
&gt;&gt;&gt;&gt;&gt; &gt; colprefix=area.<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; r.in.gdal<br>
&gt;&gt;&gt;&gt;&gt; &gt; in=/home/tgumede1/grassdata/Cape_Town/TRMMLast1day.tif out=rainfall<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Projection of input dataset and current location appear to match<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; r.in.gdal complete. Raster map &lt;rainfall&gt; created.<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; g.region rast=rainfall -p<br>
&gt;&gt;&gt;&gt;&gt; &gt; projection: 3 (Latitude-Longitude)<br>
&gt;&gt;&gt;&gt;&gt; &gt; zone:       0<br>
&gt;&gt;&gt;&gt;&gt; &gt; datum:      wgs84<br>
&gt;&gt;&gt;&gt;&gt; &gt; ellipsoid:  wgs84<br>
&gt;&gt;&gt;&gt;&gt; &gt; north:      33:30S<br>
&gt;&gt;&gt;&gt;&gt; &gt; south:      33:45S<br>
&gt;&gt;&gt;&gt;&gt; &gt; west:       18:15E<br>
&gt;&gt;&gt;&gt;&gt; &gt; east:       19E<br>
&gt;&gt;&gt;&gt;&gt; &gt; nsres:      0:15<br>
&gt;&gt;&gt;&gt;&gt; &gt; ewres:      0:15<br>
&gt;&gt;&gt;&gt;&gt; &gt; rows:       1<br>
&gt;&gt;&gt;&gt;&gt; &gt; cols:       3<br>
&gt;&gt;&gt;&gt;&gt; &gt; cells:      3<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Here, the rainfall data has a resolution of 0:15 = 15 minutes or 1/4<br>
&gt;&gt;&gt;&gt;&gt; degree. THat&#39;s approximately (at the equator) about 27 km. So *one*<br>
&gt;&gt;&gt;&gt;&gt; raster<br>
&gt;&gt;&gt;&gt;&gt; cell is 27 km X 27 km =~ 730 <a href="http://sq.km" target="_blank">sq.km</a>. Your region is covered by 3<br>
&gt;&gt;&gt;&gt;&gt; cells,<br>
&gt;&gt;&gt;&gt;&gt; 1<br>
&gt;&gt;&gt;&gt;&gt; row by 3 columns. Not very helpful data!<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Next...<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; r.in.gdal<br>
&gt;&gt;&gt;&gt;&gt; &gt; in=/home/tgumede1/grassdata/Cape_Town/Dem_CF.tif out=dem<br>
&gt;&gt;&gt;&gt;&gt; target=SRTMDEM<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Projection of input dataset and current location appear to match<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; r.in.gdal complete. Raster map &lt;dem&gt; created.<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; g.region rast=dem -p<br>
&gt;&gt;&gt;&gt;&gt; &gt; projection: 3 (Latitude-Longitude)<br>
&gt;&gt;&gt;&gt;&gt; &gt; zone:       0<br>
&gt;&gt;&gt;&gt;&gt; &gt; datum:      wgs84<br>
&gt;&gt;&gt;&gt;&gt; &gt; ellipsoid:  wgs84<br>
&gt;&gt;&gt;&gt;&gt; &gt; north:      33:40:46.499215S<br>
&gt;&gt;&gt;&gt;&gt; &gt; south:      34:00:52.499215S<br>
&gt;&gt;&gt;&gt;&gt; &gt; west:       18:17:55.500436E<br>
&gt;&gt;&gt;&gt;&gt; &gt; east:       19:10:16.500436E<br>
&gt;&gt;&gt;&gt;&gt; &gt; nsres:      0:00:03<br>
&gt;&gt;&gt;&gt;&gt; &gt; ewres:      0:00:03<br>
&gt;&gt;&gt;&gt;&gt; &gt; rows:       402<br>
&gt;&gt;&gt;&gt;&gt; &gt; cols:       1047<br>
&gt;&gt;&gt;&gt;&gt; &gt; cells:      420894<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Your DEM layer, on the other hand, is of resolution 3 arc seconds, or<br>
&gt;&gt;&gt;&gt;&gt; about 90 meters on a side. So each cell is 90 m. X 90 m = 8100 sq.m.<br>
&gt;&gt;&gt;&gt;&gt; =~<br>
&gt;&gt;&gt;&gt;&gt; 0.0081 <a href="http://sq.km" target="_blank">sq.km</a>.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; r.watershed elevation=dem<br>
&gt;&gt;&gt;&gt;&gt; &gt; accumulation=acc drainage=direction basin=catch stream=str<br>
&gt;&gt;&gt;&gt;&gt; threshold=200<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Here you chose a threshold of 200. That&#39;s 200 cells, so about 200 X<br>
&gt;&gt;&gt;&gt;&gt; 0.0081<br>
&gt;&gt;&gt;&gt;&gt; <a href="http://sq.km" target="_blank">sq.km</a>, or 1.6 sq km. As a result (see below, the output of r.to.vect)<br>
&gt;&gt;&gt;&gt;&gt; you<br>
&gt;&gt;&gt;&gt;&gt; are getting over 19,000 tiny little catchments. Are you sure that&#39;s<br>
&gt;&gt;&gt;&gt;&gt; what<br>
&gt;&gt;&gt;&gt;&gt; you want??<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Finally, you&#39;re trying to get raster values for 19,000 tiny vector<br>
&gt;&gt;&gt;&gt;&gt; areas<br>
&gt;&gt;&gt;&gt;&gt; where the raster (rainfall) is only 3 cells! You&#39;ll have 1000&#39;s of<br>
&gt;&gt;&gt;&gt;&gt; catchments with all the same values. And I guess that some of these<br>
&gt;&gt;&gt;&gt;&gt; catchments are extending outside of the three rainfall cells, and<br>
&gt;&gt;&gt;&gt;&gt; causing<br>
&gt;&gt;&gt;&gt;&gt; the  NULL value error.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; In short: I think you&#39;ll need to match the resolution of the DEM to<br>
&gt;&gt;&gt;&gt;&gt; that<br>
&gt;&gt;&gt;&gt;&gt; of the rainfall data. If the rainfall is only as accurate as 1 data<br>
&gt;&gt;&gt;&gt;&gt; value<br>
&gt;&gt;&gt;&gt;&gt; per 730 <a href="http://sq.km" target="_blank">sq.km</a>. then you will be able to do vector-raster analyses<br>
&gt;&gt;&gt;&gt;&gt; only<br>
&gt;&gt;&gt;&gt;&gt; at<br>
&gt;&gt;&gt;&gt;&gt; that resolution = i.e. continent scale maps.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; HTH<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Micha<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; SECTION 1a (of 5): Initiating Memory.<br>
&gt;&gt;&gt;&gt;&gt; &gt; SECTION 1b (of 5): Determining Offmap Flow.<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; SECTION 2: A * Search.<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; SECTION 3: Accumulating Surface Flow.<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; SECTION 4: Watershed determination.<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; SECTION 5: Closing Maps.<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; r.to.vect -s in=catch<br>
&gt;&gt;&gt;&gt;&gt; out=catchments<br>
&gt;&gt;&gt;&gt;&gt; &gt; feature=area<br>
&gt;&gt;&gt;&gt;&gt; &gt; Extracting areas...<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; Building topology for vector map &lt;catchments&gt;...<br>
&gt;&gt;&gt;&gt;&gt; &gt; Registering primitives...<br>
&gt;&gt;&gt;&gt;&gt; &gt; 60653 primitives registered<br>
&gt;&gt;&gt;&gt;&gt; &gt; 314051 vertices registered<br>
&gt;&gt;&gt;&gt;&gt; &gt; Building areas...<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; 19885 areas built<br>
&gt;&gt;&gt;&gt;&gt; &gt; 1 isles built<br>
&gt;&gt;&gt;&gt;&gt; &gt; Attaching islands...<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; Attaching centroids...<br>
&gt;&gt;&gt;&gt;&gt; &gt;  100%<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of nodes: 40769<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of primitives: 60653<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of points: 0<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of lines: 0<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of boundaries: 40768<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of centroids: 19885<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of areas: 19885<br>
&gt;&gt;&gt;&gt;&gt; &gt; Number of isles: 1<br>
&gt;&gt;&gt;&gt;&gt; &gt; r.to.vect complete.<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; GRASS 6.4.0RC5+39438 (SRTMDEM):~ &gt; v.rast.stats vector=catchments<br>
&gt;&gt;&gt;&gt;&gt; &gt; raster=rainfall layer=1 colprefix=precip<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; DBMI-DBF driver error:<br>
&gt;&gt;&gt;&gt;&gt; &gt; SQL parser error: syntax error, unexpected NULL_VALUE processing<br>
&gt;&gt;&gt;&gt;&gt; &#39;NULL&#39;<br>
&gt;&gt;&gt;&gt;&gt; &gt; in statement:<br>
&gt;&gt;&gt;&gt;&gt; &gt; UPDATE catchments SET precip_min=-NULL WHERE cat=10163<br>
&gt;&gt;&gt;&gt;&gt; &gt; Error in db_execute_immediate()<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; ERROR: Error while executing: &#39;UPDATE catchments SET<br>
&gt;&gt;&gt;&gt;&gt; precip_min=-NULL<br>
&gt;&gt;&gt;&gt;&gt; &gt; WHERE<br>
&gt;&gt;&gt;&gt;&gt; &gt;        cat=10163&#39;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Here is the output of gdalinfo TRMMLast1day.tif<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Origin = (18.250000000000000,-33.500000000000000)<br>
&gt;&gt;&gt;&gt;&gt; &gt; Pixel Size = (0.250000000000000,-0.250000000000000)<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; --------------------<br>
&gt;&gt;&gt;&gt;&gt; &gt; coordinates--------------------------------------------<br>
&gt;&gt;&gt;&gt;&gt; &gt; Corner Coordinates:<br>
&gt;&gt;&gt;&gt;&gt; &gt; Upper Left  (  18.2500000, -33.5000000)<br>
&gt;&gt;&gt;&gt;&gt; &gt; Lower Left  (  18.2500000, -33.7500000)<br>
&gt;&gt;&gt;&gt;&gt; &gt; Upper Right (  19.0000000, -33.5000000)<br>
&gt;&gt;&gt;&gt;&gt; &gt; Lower Right (  19.0000000, -33.7500000)<br>
&gt;&gt;&gt;&gt;&gt; &gt; Center      (  18.6250000, -33.6250000)<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Here is what I did to clip the region of interest.<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; gdal_translate -a_srs EPSG:4326 -projwin 18.2987501 -33.6795831<br>
&gt;&gt;&gt;&gt;&gt; 19.1712501<br>
&gt;&gt;&gt;&gt;&gt; &gt; -34.0141665 3B42RT.2010032900.1day.tif TRMMLast1day.tif<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; Is there something I have done wrong in these steps or there is<br>
&gt;&gt;&gt;&gt;&gt; something<br>
&gt;&gt;&gt;&gt;&gt; &gt; wrong with my coordinates?<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; 2010/7/6 &lt;<a href="mailto:micha@arava.co.il" target="_blank">micha@arava.co.il</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; Hi<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; Is it wrong to use  -a_ullr option in gdal_translate to clip a<br>
&gt;&gt;&gt;&gt;&gt; small<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; portion<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; of the region from the big geotiff file region?<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; The option -a_ullr will change the georeference of the resulting<br>
&gt;&gt;&gt;&gt;&gt; file,<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; so<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; you could say it&#39;s &quot;wrong&quot; if you want to keep the original<br>
&gt;&gt;&gt;&gt;&gt; referencing.<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; The way to clip a portion of the original and still maintain<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; geo-referencing is with the -projwin option.<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; Micha<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; --<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; Kind Regards<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; TS Gumede<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; CSIR, Meraka Institute<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; 072 258 1650<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt; This mail was received via Mail-SeCure System.<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; --<br>
&gt;&gt;&gt;&gt;&gt; &gt; Kind Regards<br>
&gt;&gt;&gt;&gt;&gt; &gt; TS Gumede<br>
&gt;&gt;&gt;&gt;&gt; &gt; CSIR, Meraka Institute<br>
&gt;&gt;&gt;&gt;&gt; &gt; 072 258 1650<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt; This mail was received via Mail-SeCure System.<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Kind Regards<br>
&gt;&gt;&gt;&gt; TS Gumede<br>
&gt;&gt;&gt;&gt; CSIR, Meraka Institute<br>
&gt;&gt;&gt;&gt; 072 258 1650<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Kind Regards<br>
&gt;&gt;&gt; TS Gumede<br>
&gt;&gt;&gt; CSIR, Meraka Institute<br>
&gt;&gt;&gt; 072 258 1650<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Kind Regards<br>
&gt;&gt; TS Gumede<br>
&gt;&gt; CSIR, Meraka Institute<br>
&gt;&gt; 072 258 1650<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Kind Regards<br>
&gt; TS Gumede<br>
&gt; CSIR, Meraka Institute<br>
&gt; 072 258 1650<br>
&gt;<br>
&gt; This mail was received via Mail-SeCure System.<br>
&gt;<br>
&gt;<br>
&gt;<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>