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

Jamie Adams jaadfoo at gmail.com
Mon Oct 13 19:13:39 EDT 2008


Thanks for the suggestions.  I opened the image up in python using gdal,
looked at the geotransform and found that the image is ever-so-slightly
shifted west (-180.00000000012497).  Hence the negative W-E center.  Maybe
this is why GRASS thinks it has a 180E origin also, though I don't know.

I checked the region - same problem - then set it manually and re-imported.
Same results.  In the end I was able to assign correct extents using
r.region.  Though the boundary isn't exactly at 180W, I think nine 0s after
the decimal point is a bit much.  :-)

Thanks again.

-Jamie

On Mon, Oct 13, 2008 at 1:35 PM, Nikos Alexandris <
nikos.alexandris at felis.uni-freiburg.de> wrote:

> On Mon, 2008-10-13 at 12:41 -0700, Jamie Adams wrote:
> > Hello all,
> >
> > When I import a global elevation dataset with extents 180w 90n 180e
> > 90s using r.in.gdal, the GRASS raster shows up with w-e extents both
> > showing 180E.  While this doesn't seem to be affecting raster
> > calculations, afaik, it's causing issues with QGIS.  It displays it
> > with it's origin at 180E and extends to 540E.  Has anyone run into
> > this problem?
> >
> > gdalinfo:
> >
> > Driver: GTiff/GeoTIFF
> > Files: 2_00-res/out-2_00-nozero-res.tif
> > Size is 43200, 21600
> > Coordinate System is:
> > GEOGCS["WGS 84",
> >     DATUM["WGS_1984",
> >         SPHEROID["WGS 84",6378137,298.2572235630016,
> >             AUTHORITY["EPSG","7030"]],
> >         AUTHORITY["EPSG","6326"]],
> >     PRIMEM["Greenwich",0],
> >     UNIT["degree",0.0174532925199433],
> >     AUTHORITY["EPSG","4326"]]
> > Origin = (-180.000000000124970,90.000000000000000)
> > Pixel Size = (0.008333333333333,-0.008333333333333)
> > Metadata:
> >   AREA_OR_POINT=Area
> > Image Structure Metadata:
> >   INTERLEAVE=BAND
> > Corner Coordinates:
> > Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N)
> > Lower Left  (-180.0000000, -90.0000000) (180d 0'0.00"W, 90d 0'0.00"S)
> > Upper Right ( 180.0000000,  90.0000000) (180d 0'0.00"E, 90d 0'0.00"N)
> > Lower Right ( 180.0000000, -90.0000000) (180d 0'0.00"E, 90d 0'0.00"S)
> > Center      (  -0.0000000,   0.0000000) (  0d 0'0.00"W,  0d 0'0.00"N)
> > Band 1 Block=43200x1 Type=Float32, ColorInterp=Gray
> >   NoData Value=10
> >
> > r.info:
> >
> >
> +----------------------------------------------------------------------------+
> > | Layer:    2_00_res                       Date: Fri Oct 10 17:45:37
> > 2008
> > | Mapset:   PERMANENT                      Login of Creator: jamie
> >
> > | Location: Bathy
> >
> > | DataBase: /work/grass
> >
> > | Title:     ( 2_00_res )
> >
> > | Timestamp: none
> >
> >
> |----------------------------------------------------------------------------
> > |
> >
> > |   Type of Map:  raster               Number of Categories: 255
> >
> > |   Data Type:    FCELL
> >
> > |   Rows:         21600
> >
> > |   Columns:      43200
> >
> > |   Total Cells:  933120000
> >
> > |        Projection: Latitude-Longitude
> >
> > |            N:        90N    S:        90S   Res: 0:00:30
> >
> > |            E:       180E    W:       180E   Res: 0:00:30
> >
> > |   Range of data:    min = -10814.000000  max = -0.010000
> >
> > |
> >
> > |   Data Description:
> >
> > |    generated by r.in.gdal
> >
> > |
> >
> > |   Comments:
> >
> > |    r.in.gdal input="out-2_00-nozero-res.tif" output="2_00_res"
> >
> > |
> >
> >
> +----------------------------------------------------------------------------+
> >
>
> 1. I am not 100% sure but I think the line "Center      (  -0.0000000,
> 0.0000000) (  0d 0'0.00"W,  0d 0'0.00"N)" in the geo-metadata should
> read enter      (  0.0000000,   -0.0000000) (  0d 0'0.00"W,  0d
> 0'0.00"N)
>
> (Could it be that the file is not ok?)
>
> 2. What doeas g.region -p say? If you get the same value for east and
> west it's wrong I guess. west should be, well... west: 180W and east:
> 180E.
>
> 3. Try to set "g.region e=180 s=-90 w=-180 n=90 -p". Re-import again and
> check for errors.
>
> Regards, Nikos
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20081013/b1664b81/attachment.html


More information about the grass-user mailing list