[GRASS-user] Re: Import question

Hermann Peifer peifer at gmx.eu
Fri Sep 24 04:32:18 EDT 2010


Thanks for all the explanations. Now I know better. Below [1], I tried 
to bring all relevant snippets together. Wouldn't it make sense to add 
some of these details to g.region.html, or so?

Hermann


[1] Glynn and Hamish gave these helpful explanations:

 > to sum up:
 >
 > * r.in.gdal differs from most raster modules in that it imports
 > the entire map and ignores the current region.
 >
 > * gdal_translate can be used to crop out an area of interest
 > before import with its -projwin or -srcwin options.
 >
 > * after import any subsequent raster module will respect the
 > region settings, so in effect crop to the current region. The
 > most basic example of this is: "r.mapcalc "cropped = imported".
 >

 > Hermann:
 >> By the way: is there a convenient overview of raster
 >> modules that do NOT respect the current region?
 >
 > no, but the general theme is that raster modules which import
 > pre-existing datasets (r.in.*) preserve that data arrays; while
 > modules which create new raster maps (r.* including v.to.rast,
 > r.in.poly, r.in.xyz, and r.proj) will respect the region.
 >
 > and then of course there will always be an exception or two to
 > the rule, but you can pretty much trust the above.
 >

 >
 > r.reclass doesn't read or write raster data, so the region doesn't
 > come into it.
 >
 > Similar issues apply to r.info, r.support, r.compress, r.null,
 > r.timestamp etc.
 >
 > The region only matters for modules which read or write raster data.
 > This includes most (but not all) r.* and i.* modules, as well as some
 > other modules (e.g. v.what.rast).
 >

 > In general: r.in.* ignore the region, and import rasters
 > cell-for-cell. r.resamp.* and r.proj ignore the region for reading but
 > honour it for writing.
 >

 >
 > A reclass map is just a reference to the base map and a list of
 > category mappings. It doesn't have a region of its own; e.g. if you
 > change the bounds of the base map via r.region, the bounds of the
 > reclass map will change to match.
 >


More information about the grass-user mailing list