[GRASS-user] A resolution problem with r.patch + r.proj

Glynn Clements glynn at gclements.plus.com
Thu Aug 21 12:56:30 EDT 2008


Silvia Simoni wrote:

> I 'm trying to reproject a raster map from a location Gauss-Boaga to  
> UTM-WGS84.
> The map in Gauss Boaga was created using r.patch from 4 maps imported  
> from a geotif file.
> 
> I describe the procedure below to be more precise:
> from the GB location
> - r.in.gdal on the 4 tif files (the tfw was 0.25, 0, 0, -0.25, East,  
> North)
> - g.region -p to check that the resolution of the imported map was 0.25
> - g.region rast=map1, map2,map3,map4
> - g.region -p  to check if the resolution was still 0.25m; I noticed  
> it changed to nsres 0.2499987 and ewres 0.2499915
> - r.patch map=map1, map2, map3, map4
> from the UTM location
> -r.proj .....  res=?
> 
> I read that the resolution should be kept the same when reprojecting.
> 
> 1st question: can I force the resolution to remain 0.25m when  
> launching r.patch?

Use:

	g.region -a res=0.25 rast=map1,map2,map3,map4

This will enlarge the bounds slightly in order to avoid having to
adjust the resolution.

> 2nd question: when launching r.proj I am asked only one value for the  
> resolution, what should I write in my case?

You are probably better off just setting the target location's region
to whatever is convenient, and omitting the resolution= option to
r.proj.

If you want more control over the resampling, at the expense of
increased processing time, you can use a significantly finer
resolution for the output then resample manually with e.g. 
r.resamp.interp, r.resamp.stats or r.resamp.rst, possibly after
filtering with r.mfilter[.fp].

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list