[GRASSLIST:9493] Re: SRTM shifted 0.5 the res in X and Y axis from the r.mapcalc output

Hamish hamish_nospam at yahoo.com
Thu Dec 15 04:08:32 EST 2005


> This might be connected with my [GRASSLIST:9409].
> 
> SRTM tiles imported with r.in.srtm are shifted 0.5 the resolution in X
> and Y axis from the native Grass rasters cretaed with r.mapcalc in the
> same location.
..
> # 1. import a 3" SRTM tile
> r.in.srtm input=/home/maciek/gis/dane/srtm2/N49E023.hgt.zip
> output=N49E023
> 
> g.region rast=N49E023 -p projection: 3 (Latitude-Longitude)
> zone:       0
> datum:      wgs84
> ellipsoid:  wgs84
> north:      50:00:01.5N
> south:      48:59:58.5N
> west:       22:59:58.5E
> east:       24:00:01.5E
> nsres:      0:00:03
> ewres:      0:00:03
> rows:       1201
> cols:       1201
> 
> # colour it and zoom to the top-right corner of the tile to see single
> # cells
> r.colors N49E023 col=grey.eq
> d.rast N49E023
> d.zoom 

Markus and William are correct to suspect d.zoom. What happens is that
you pick a spot on the screen with the mouse and d.zoom aligns itself to
the nearest 0:00:03 resolution click. Maybe this is a bug, maybe it is a
feature which needs a new flag to turn off. I don't know.

e.g. in UTM try setting your extent to 200075,220025 with res=50 and try
d.zoom. It will end up on xxxx50,xxx100.


> # create a GRASS raster there, in the same resolution
> r.mapcalc 'test=rand(0,1000)'
> 
> # increase the resolution so that any small shift is visible
> g.region res=0:0:0.1 -p
> projection: 3 (Latitude-Longitude)
> zone:       0
> datum:      wgs84
> ellipsoid:  wgs84
> north:      50:00:09N
> south:      49:59:48N
> west:       23:59:54E
> east:       24:00:12E
> nsres:      0:00:00.1
> ewres:      0:00:00.1
> rows:       210
> cols:       180

try changing the res before d.zoom and it should be ok.



regards,
Hamish




More information about the grass-user mailing list