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

Maciek Sieczka werchowyna at epf.pl
Wed Dec 14 14:28:51 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.

See the attached picture and notes below. I'm not doing anything
unusuall. Why are these two rasters shifted? I don't think they should
be. I guess that when importing data like SRTM (BIL), where the
coordinates are of the cell centre, into Grass, where coordinates are of
the cell ll corner, shuch data should shifted to conform to Grass grid.
Correct me please if this is rubbish what I suppose, but I'm puzzled
that I have two rasters of the same res in Grass and they don't fit each
other.



# 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 

# 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

# display the Grass raster and overlay an SRTM
d.erase; d.rast test; d.rast N49E023 -o

# here's the shift

See the attachment - grey is the SRTM, r.mapcalc ouput in random colors.

Maciek


--------------------
,,Kuchnia polska PWE"  -   Idealny prezent pod choinkê! 
Najs³ynniejsza ksi±¿ka kucharska, która pomo¿e na nowo odkryæ przysmaki polskiej kuchni
Z okazji ¶wi±t 10% zni¿ki na stronie http://www.pwe.com.pl/51552.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SRTMvsGRASSshift.png
Type: image/png
Size: 4703 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20051214/e06cbe5a/SRTMvsGRASSshift.png


More information about the grass-user mailing list