[GRASS-user] Setting region to add map to location

Rich Shepard rshepard at appl-ecosys.com
Sat Jul 7 13:51:33 PDT 2018


On Sat, 7 Jul 2018, Micha Silver wrote:

> If I understand, you have DEM tiles in one projection (location) and
> you're trying to use r.proj to transform the tiles into a different
> location. If that's the case, typically you would use the r.proj flag '-g'
> to get the region settings in the target location from the raster extent
> in it's source location. So you might do something like:  g.region -p
> `r.proj -g loc=<source location> map=<source mapset> input=<source dem>`

Micha,

   I have no problems using r.proj to transform the DEMs from one location to
another one. My question is why, when g.region is set to that of a
county-wide vector map I cannot load a newly re-projected DEM that is the
immediate neighbor of another DEM and both are within the county boundary
and, assumably, in the same region. I don't understand how a raster map's
region can change so drastically when reprojected from one location to
another one.

> Finally, once you have all the tiles reprojected, use g.list raster
> pattern=<....> sep=comma to get a list of all the tiles, then g.region -p
> rast=<list of tiles> to set the computational region to cover all tiles.

   This assumes I can display the second tile. When I get that working I'll
do this, but the county vector map's region should certainly encompass both.

> One additional point: consider to patch all DEM tiles together in their
> native projection *first* then project the single patched DEM once to the
> target projection.

   This would be a good idea, and I think I did this many years ago. But,
when I read the r.patch manual page I see that it uses file B to fill in
null cells in file A. What I want to do is join them by a common border,
like laying tiles on a floor. If there's a r.patch option for this I've not
recognized it, and I don't see another r.* module for assembling adjacent
raster maps into a single one.

Best regards,

Rich


More information about the grass-user mailing list