[GRASS-user] How to shift a raster map?

Markus Metz markus.metz.giswork at googlemail.com
Thu Dec 8 02:20:31 EST 2011

On Wed, Dec 7, 2011 at 10:41 AM, Andres Kuusk <andres at aai.ee> wrote:
> Hi!
> I have a high-res satellite image which has a positioning error about 5 m.
> A previous GRASS version had a simple shift of coordinates however in the
> GRASS-7 I cannot find such a tool.
> A workaround is to use i.rectify. It seems to me that there could be a more
> simple possibility for such a simple operation.
> The image is large and i.rectify returns ERROR: Error writing segment file.
> I get this error even after splitting the image and trying to rectify a
> small piece of the large image. The procedures I did were:
> - defined a small region
> - with r.resample made a copy of the small region of the original large map
> - r.info reports the correct new region and the correct size of the small
> map
> - i.rectify of the new small map reported in the output window the previous
> large region and I got the same error: Error writing segment
> file.
> I could to run i.rectify on another PC which has a bit more memory (4G, my
> PC can use 3.2G, both are Linux), but anyway, to shift a raster should be
> more simple.

Memory has nothing to do with the error "ERROR: Error writing segment
file", this is an error while writing to disk (not enough disk
space?). i.rectify has a separate option controlling memory usage,
default is 300MB; this does not affect disk space requirements.

As Moritz suggested, try r.region to shift a raster map:

g.region rast=my_map -p
# shift 5m to north and 5m to east, g.region understands n=n+5 etc
g.region n=n+5 s=s+5 e=e+5 w=w+5 -p
r.region map=my_map -c

Markus M
> Thanks for suggestions!
> Andres Kuusk
> Tartu Observatory, Estonia
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

More information about the grass-user mailing list