[GRASS-user] r.in.gdal global raster incorrect extents
Nikos Alexandris
nikos.alexandris at felis.uni-freiburg.de
Mon Oct 13 20:21:19 EDT 2008
On Mon, 2008-10-13 at 16:59 -0700, Jamie Adams wrote:
> Sure, python w/ gdal is great for doing these sanity checks. Assuming
> you are using a FWTools install or have the python-gdal plugin:
>
> python
>
> >>> import gdal
>
> or newer version:
> >>> from osgeo import gdal
>
> >>> image = gdal.Open('/the/path/to/my/raster.tif',gdal.GA_ReadOnly)
>
> ****or if your version of gdal has Grass support ****
> >>> image =
> gdal.Open('/grassdir/location/mapset/cellhd/rastername',gdal.GA_ReadOnly)
>
> >>> image.GetGeoTransform()
> (-180.0, 0.0083333333333333332, 0.0, 90.0, 0.0,
> -0.0083333333333333332)
>
> In my case, the source GeoTiff had a geotransform of:
> (-180.00000000012497, 0.0083333333333333297, 0.0, 90.0, 0.0,
> -0.0083333333333333297)
>
> One strange thing was, the original grass import (west coordinate of
> 180E) had the same geotransform as the corrected raster I ran r.region
> on. According to gdal, they were the same.
>
> Looks like I need to file a bug report.
>
> Enjoy.
>
> -Jamie
Great!! Thanks again, Nikos
More information about the grass-user
mailing list