[GRASS-user] r.in.gdal global raster incorrect extents

Jamie Adams jaadfoo at gmail.com
Tue Oct 14 12:31:28 EDT 2008


> but why then does it work fine for me?
> I downloaded a 180W tile, that looks fine too:
> ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3/Australia/S20W180.hgt.zip
> ....
> Origin = (-180.000416666666666,-18.999583333333334)
> Pixel Size = (0.000833333333333,-0.000833333333333)
>

I grabbed the same tile and imported it into GRASS using r.in.srtm and am
having the same issue:

> gdalinfo S20W180.hgt

Origin = (-180.000416666666666,-18.999583333333334)
Pixel Size = (0.000833333333333,-0.000833333333333)

> r.in.srtm input=S20W180 output=S20W180

> cat /location/mapset/cellhd/S20W180

proj:       3
zone:       0
north:      18:59:58.5S
south:      20:00:01.5S
east:       178:59:58.5W
west:       179:59:58.5E
cols:       1201
rows:       1201
e-w resol:  0:00:03
n-s resol:  0:00:03
format:     3
compressed: 1

> gdalinfo /location/mapset/cellhd/S20W180

Origin = (179.999583333333334,-18.999583333333334)
Pixel Size = (0.000833333333333,-0.000833333333333)

r.out.gdal outputs a GeoTiff consistent with this gdalinfo output - so
shifted 180E.


where do your .tif files come from?


I wrote a python script that creates these as equal divisions of an input
area (in this case the world).  I wanted to use them along with srtm, so I
used the same res and pixel registration scheme.  I looked into it a bit
further and noticed that my script is using a truncated version of the res
variable (initialized to 1/1200):

geotransform:
(-180.000416667, 0.00083333333333299999, 0.0, 10.0004166667, 0.0,
-0.00083333333333299999)

cat cellhd/W180N10

proj:       3
zone:       0
north:      10:00:01.5N
south:      10:00:01.5S
east:       159:59:58.500001W
west:       179:59:58.499999E
cols:       24001
rows:       24001
e-w resol:  0:00:03
n-s resol:  0:00:03
format:     0
compressed: 1

I fixed this and the precision issue went away.  But as with the srtm tile,
it doesn't fix the e-w region issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20081014/2a1ba309/attachment.html


More information about the grass-user mailing list