[GRASS-user] r.proj manual clarification

   In the Notes section of the 7.5 r.proj manual the second and third
paragraphs read,

"To avoid excessive time consumption when reprojecting a map the region and
resolution of the target location should be set appropriately beforehand."

   Isn't the target's location and region set when that location is created?
What happens to other maps (vector and raster) in that location if the
region and resolution are changed to match that of the source map? I thought
that r.proj was the tool to convert the source's region and resolution to
that of the target.

"A simple way to do this is to check the projected bounds of the input map
in the current location's projection using the -p flag. The -g flag reports
the same thing, but in a form which can be directly cut and pasted into a
g.region command. After setting the region in that way you might check the
cell resolution with "g.region -p" then snap it to a regular grid with
g.region's -a flag. E.g. g.region -a res=5 -p. Note that this is just a
rough guide."

   The first sentence checks the source (current) location's projection. The
third sentence suggests snapping the source grid's region and resolution to
a regular grid. Two questions about this: 1) aren't all raster maps on a
regular grid? and 2) how does this change affect the source location?

   I'm working on understanding how to correct r.proj failures because the
source map/location is outside the bounds of the target location.

TIA,

Rich

I'm working on understanding how to correct r.proj failures because the
source map/location is outside the bounds of the target location.

gdalwarp - Warp an image into a new coordinate system
(http://www.gdal.org/gdalwarp.html)

try gdalwarp to see how the raster is re-projected there and then compare
the settings in GRASS.

What happens to other maps (vector and raster) in that location if the
region and resolution are changed to match that of the source map?

the real strength of GRASS in raster is, that you can change the computional
region of interest to extent and resolution to what fits best for your
analysis. you can change back to resolution and extend to your original
data.

https://grass.osgeo.org/grass75/manuals/g.region.html tells:

" The user can create, modify, and store as many geographic region
definitions as desired for any given mapset. "

https://grass.osgeo.org/grass75/manuals/rasterintro.html tells:

"GRASS raster map processing is always performed in the current region
settings (see g.region), i.e. the current region extent and current raster
resolution is used. If the resolution differs from that of the input raster
map(s), on-the-fly resampling is performed (nearest neighbor resampling). If
this is not desired, the input map(s) has/have to be resampled beforehand
with one of the dedicated modules.

The built-in nearest-neighbour resampling of raster data calculates the
centre of each region cell, and takes the value of the raster cell in which
that point falls.

If the point falls exactly upon a grid line, the exact result will be
determined by the direction of any rounding error. One consequence of this
is that downsampling by a factor which is an even integer will always sample
exactly on the boundary between cells, meaning that the result is
ill-defined. "

what is missing in the manuals?

-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html

Yes, but you can change both anytime you need a different extent or resolution. Nothing No, r.proj transforms a raster from one projection (location) to a different projection (location) You should be only in the target location. First run: Then copy/paste the output to the command. Then rerun r.proj without the -g flag. Yes, but every projection transform creates a new regular grid, requiring a “warp” of the original regular grid cells. That’s why it’s a good idea to use the ‘-a’ flag to g.region to align the cells and extent settings. None whatsoever As Markus said, the source region settings are irrelevant here. One final comment: I noticed in a previous post: > This I did: > > r.proj loc=elwood map=PERMANENT in=elwood_dem2013 -g > WARNING: Input and output locations are the same <<==== ??? Obviously, the source and target locations must be different. HTH,

···

On 07/09/2018 06:43 PM, Rich Shepard wrote:

In the Notes section of the 7.5 r.proj manual the second and third
paragraphs read,

“To avoid excessive time consumption when reprojecting a map the region and
resolution of the target location should be set appropriately beforehand.”

Isn’t the target’s location and region set when that location is created?

What happens to other maps (vector and raster) in that location if the

region and resolution are changed to match that of the source map? I thought
that r.proj was the tool to convert the source’s region and resolution to

that of the target.

“A simple way to do this is to check the projected bounds of the input map
in the current location’s projection using the -p flag. The -g flag reports
the same thing, but in a form which can be directly cut and pasted into a
g.region command. After setting the region in that way you might check the
cell resolution with “g.region -p” then snap it to a regular grid with
g.region’s -a flag. E.g. g.region -a res=5 -p. Note that this is just a
rough guide.”

The first sentence checks the source (current) location’s projection. The

r.proj -g location=<source location> mapset=<source mapset> input=<source raster>

g.region -ap

third sentence suggests snapping the source grid’s region and resolution to
a regular grid. Two questions about this: 1) aren’t all raster maps on a
regular grid?

and 2) how does this change affect the source location?

I’m working on understanding how to correct r.proj failures because the
source map/location is outside the bounds of the target location.

TIA,

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

On Mon, 9 Jul 2018, Micha Silver wrote:

Yes, but you can change both anytime you need a different extent or resolution.

   Thanks for clarifying, Micha.

Rich

On Mon, 9 Jul 2018, Helmut Kudrnovsky wrote:

gdalwarp - Warp an image into a new coordinate system
(http://www.gdal.org/gdalwarp.html)

try gdalwarp to see how the raster is re-projected there and then compare
the settings in GRASS.

   ...

the real strength of GRASS in raster is, that you can change the computional
region of interest to extent and resolution to what fits best for your
analysis. you can change back to resolution and extend to your original
data.

   Thanks, Helmut. Working through the r.proj process clarified most of my
confusion.

   What remains for me to better understand is the relation of raster regions
and vector regions. I'm working on this.

Best regards,

Rich