[GRASSLIST:2249] Re: r.resamp.rst and r.resample

Eric G. Miller egm2 at jps.net
Thu Aug 2 21:44:44 EDT 2001

On Thu, Aug 02, 2001 at 10:47:26AM -0700, Rich Shepard wrote:
>   I have some DEMs where the e-w and n-s resolutions are 30 meters and I
> want to resample them to 10 meter cell size. Reading the man pages for the
> two modules suggests to me that r.resample essentially moves the input map
> bounds to the current region's bounds and re-writes it to the output map.
>   So, it appears that r.resamp.rst will do the job for me. Except, ... I
> also need to change the elvation values from 1 meter to 0.1 meter to
> accompany the altered cell size. While the output is named 'elev', I read
> nothing in the options on the man page that allow me to resample a 1-m
> height assigned to a 30 x 30 m cell into 0.1-m heights each assigned to
> nine, 10 x 10 m cells.
>   The reason this is important is that the area I need to map is covered by
> a 3x3 array of DEMs. Six of the nine are already 10 m cells with 0.1 m
> elevation resolution while the other three are the lower resolution data.
> Thoughts?

Poor man's method.

 1.  Adjust the region so it matches the extents of the dem(s) and
 change the cell resolution to 10x10.

   $ g.region rast=dem1,dem2,dem3,...
   $ g.region
     Select 1 to adjust the CELL resolutions (don't change the

 2.  I'm not clear, but do you actually want to scale the values of the
 dems to dekameters?

   $ echo 'newdem = float( olddem / 10.0)' | r.mapcalc

   (I don't think the float(..) is necessary -- the decimal point in the
   division certainly is).

Second poor mans method.

 1.  Export the dems to site_list files.
 2.  Adjust the region like above to 10x10m
 3.  Use s.surf.idw or s.surf.rst to generate new dems.
 4.  Use r.mapcalc to scale the cell values (like above).

Remember, almost all raster modules are sensitive to the region settings
(including the resolution) so you can often manipulate output results
simply by twiddling the cell resolution.

Eric G. Miller <egm2 at jps.net>

More information about the grass-user mailing list