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

Markus Metz markus.metz.giswork at gmail.com
Mon Jul 9 10:31:24 PDT 2018


On Mon, Jul 9, 2018 at 6:11 PM, Rich Shepard <rshepard at appl-ecosys.com>
wrote:
>
> On Mon, 9 Jul 2018, Markus Metz wrote:
>
>> 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 at 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:
>
> # In source location:
>
first set the region to match the raster:

g.region raster=elwood_dem2013

now proceed as before:

> v.in.region -d out=elwood_region
>
> # In target location:
>
> v.proj in=elwood_region loc=elwood map=PERMANENT out=elwood_reproj
>
> g.region -g
> projection=99
> zone=0
> n=201663.78224162
> s=137006.09426117
> w=2314182.92402788
> e=2388673.19838691

this:
> nsres=0.99999517
> ewres=1.00000368

is probably not what you want, it is recommended to align the region to
exactly 1 map unit:
g.region -p -a res=1
before reprojection

> rows=64658
> cols=74490
> cells=4816374420
>
> g.region vect=elwood_reproj res=1 -a
>
> r.proj loc=elwood map=PERMANENT in=elwood_dem2013 res=1 method=lanczos
> ERROR: Input raster map is outside current region
>
>   Please point out what I missed or did incorrectly.

You should notice a difference when using the suggested g.region calls.

Markus M
>
>
> Best regards,
>
> Rich
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180709/98090bcd/attachment-0001.html>


More information about the grass-user mailing list