[GRASS-user] preserving original resolution with r.in.gdal

Hello GRASS-Users:

While importing a raster map using “r.in.gdal” it uses the resolution of the current region for the resulting raster map. Is there a way to preserve the original resolution of the raster while importing it in irrespective of the settings of the current region.

I can check the resolution of the raster to be imported using “gdalinfo”, set my current region appropriately and then import it using “r.in.gdal”. But I was wondering if there’s a easier way to tell the import routine to preserve the original resolution. Same question applies while reprojecting a raster using “r.proj”.

Would appreciate any tips.

Thanks,
Jitu

On Thursday 07 of March 2013 12:08:48 Jitendra Kumar wrote:

Hello GRASS-Users:

Hello Jitu!

While importing a raster map using "r.in.gdal" it uses the resolution of
the current region for the resulting raster map.

Are you sure? What does r.info say about the imported map? Out of the top of
my head, I don't think that the current region settings affect a maps extent
and resolution while importing. They shouldn't.

Is there a way to preserve the original resolution of the raster while
importing it in irrespective of the settings of the current region.

I can check the resolution of the raster to be imported using "gdalinfo",
set my current region appropriately and then import it using "r.in.gdal".

I guess there is no need to do so.

But I was wondering if there's a easier way to tell the import routine to
preserve the original resolution. Same question applies while reprojecting
a raster using "r.proj".

r.proj is another beast -- there you can either depend on the current region
settings (in the Location/Mapset where you are reprojecting raster data to) or
use the "res=" parameter provided by the r.proj module.

Best, Nikos

Jitendra Kumar wrote:

> While importing a raster map using "r.in.gdal" it uses the resolution of
> the current region for the resulting raster map.

Nikos Alexandris wrote:

Are you sure? What does r.info say about the imported map? Out of the top
of my head, I don't think that the current region settings affect a maps
extent and resolution while importing. They shouldn't.

Note, one can "extend" (or read match?) the extent of the region to match the
extent of the imported map by using the "-e" flag. Not, however, that the
current region will alter a maps extent while importing.

Best, Nikos

On Thu, Mar 7, 2013 at 6:08 PM, Jitendra Kumar <jitendra.ncsu@gmail.com> wrote:

Hello GRASS-Users:

While importing a raster map using "r.in.gdal" it uses the resolution of the
current region for the resulting raster map.

No, this is not the case. It always imports the full map at original resolution.

Likely you have the computation region settings different so that it *appears*
to be different.

Simply:

r.in.gdal mymap.tif output=mymap
g.region rast=mymap -p

and you'll see that it matches. See also

http://grasswiki.osgeo.org/wiki/Computational_region

Cheers
Markus