I am trying to add additional DEM maps to the project location. There is
one DEM overlaid on a soil mapping unit map for the county in the attached
screenshot. My reading of the g.region manual page did not let me find the
answers I need.
The computational region is set to the soil map. Attempting to re-project
the DEM to the immediate west of the existing one fails; grass7.5svn tells
me, "ERROR: Input raster map is outside current region." I don't understand
why this is since the soil map is much larger than the DEMs and I used
'g.region vect=soils' to set the size.
Another question is how I can expand the region to add a DEM immediately
below the one on the attached map. The eastern edge of the DEM is beyond the
limit of the soil map.
Learning more about manipulating regions while assembling project maps
will help me now and in the future. Pointers to more resources for me to
read will be very helpful.
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= map= input=``
then run r.proj without the -g flag and you should get the reprojected raster.
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.
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.
Regards,
Micha
···
On 07/06/2018 08:25 PM, Rich Shepard wrote:
I am trying to add additional DEM maps to the project location. There is
one DEM overlaid on a soil mapping unit map for the county in the attached
screenshot. My reading of the g.region manual page did not let me find the
answers I need.
The computational region is set to the soil map. Attempting to re-project
the DEM to the immediate west of the existing one fails; grass7.5svn tells
me, “ERROR: Input raster map is outside current region.” I don’t understand
why this is since the soil map is much larger than the DEMs and I used
‘g.region vect=soils’ to set the size.
Another question is how I can expand the region to add a DEM immediately
below the one on the attached map. The eastern edge of the DEM is beyond the
limit of the soil map.
Learning more about manipulating regions while assembling project maps
will help me now and in the future. Pointers to more resources for me to
read will be very helpful.
Rich
_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)
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.
On Sat, Jul 7, 2018 at 10:51 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Sat, 7 Jul 2018, Micha Silver wrote:
...
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.
I _thought_ that r.patch would do the job yet did not get this from
reading the manual page. The description and example show cell-by-cell
combinations, not tiling two or more rasters. The keywords include
'mosaicking' but neither the blurb after the module name nor the description
include this ability. However, the first Note tells me, "Frequently, this
program is used to patch together adjacent map layers which have been
digitized separately. The program v.mkgrid can be used to make adjacent maps
align neatly." and I admit to not reading the notes before now, having not
seen mention of mosaicking in the module synopsis or description.
A related issue: when I want to reproject raster DEMs from their source
location to a common target location r.proj fails because the source's
region is outside the target's region. How this can be makes no sense as the
target's region is an entire state and the DEMs are 7.5' topographic quads.
But, that's what r.proj tells me.
I've not found how to resolve this issue.
Example: the target location's (OR) default region is:
I _thought_ that r.patch would do the job yet did not get this from
reading the manual page. The description and example show cell-by-cell
combinations, not tiling two or more rasters. The keywords include
'mosaicking' but neither the blurb after the module name nor the description
include this ability.
The source's region does not matter, what matters are the extents of the
source raster map.
Markus,
I should have remembered that they're different.
Apparently the input raster, when reprojected to the current region in the
location/mapset, does not overlap with the current region.
You can check the reprojected extents of the input raster with r.proj -g.
This I did:
r.proj loc=elwood map=PERMANENT in=elwood_dem2013 -g
WARNING: Input and output locations are the same
Input map <elwood_dem2013@PERMANENT> in location <elwood>:
n=1281118.49999997 s=1235035.49999995 w=828457.49999998 e=861685.49999999 rows=15361 cols=11076
Then I followed the 'box' map method of setting the target region as shown
in the manual page's Notes, paragraph 4:
The source’s region does not matter, what matters are the extents of the
source raster map.
Markus,
I should have remembered that they’re different.
Apparently the input raster, when reprojected to the current region in the
location/mapset, does not overlap with the current region.
You can check the reprojected extents of the input raster with r.proj -g.
This I did:
r.proj loc=elwood map=PERMANENT in=elwood_dem2013 -g
WARNING: Input and output locations are the same
Input map elwood_dem2013@PERMANENT in location :
n=1281118.49999997 s=1235035.49999995 w=828457.49999998 e=861685.49999999 rows=15361 cols=11076
Then I followed the ‘box’ map method of setting the target region as shown
in the manual page’s Notes, paragraph 4: