[GRASS-user] interpolate raster map

On Thu, May 22, 2008 at 2:17 PM, Hamish <hamish_b@yahoo.com> wrote:

[ah, it dumped the server-error email in my draft folder. here it is]

Rainer Krug:

I have two raster maps, one (mapA) based on a raster map of
a much lower resolution (see attached picture) and the other
one is in the MASK (pink). I would like to do two things:

1) "smooth" mapA, so that it is not as grainy as
it is now. I know that that will introduce error,
but the error will be less important then the edges
based on the coarser resolution.

set resolution to that of the MASK and use r.resamp.interp or r.resamp.rst.
then reapply the MASK with r.mapcalc "croped=interped"

Thanks for the answer - I am in the process of trying it out. But:
When I try to use r.resamp.rst, I get the error message "Input map
resolution differs from current region resolution!". I thought that
r.resamp.rst is doing exactly that - changing the resolution?

2) extrapolate to the areas not covered by mapA, but part
of MASK. again - I am aware that this will introduce considerable
error, but the same applies as in the previous case. So what I would
like to do here, is essentially fill the edges with the values of the
adjacend cells which have values.

r.grow for that, but r.resamp.rst may do a nice job around the edges and maybe it is good enough to keep.

I looked at resampling (for (1)), but it increases the edge
without data, which is not acceptable for me.

which method?
you could always use the original low res map as a mask.

Hamish

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Thanks for the answer - I am in the process of trying it
out. But:
When I try to use r.resamp.rst, I get the error message
"Input map
resolution differs from current region resolution!". I
thought that
r.resamp.rst is doing exactly that - changing the
resolution?

hmmm, not sure. you are right it should be built for changing the resolution. or maybe the result looks ok anyway.

I don't know the module very well, maybe ask on the main grass list?

good luck,
Hamish

On Thu, 22 May 2008, Hamish wrote:

Thanks for the answer - I am in the process of trying it
out. But:
When I try to use r.resamp.rst, I get the error message
"Input map
resolution differs from current region resolution!". I
thought that
r.resamp.rst is doing exactly that - changing the
resolution?

hmmm, not sure. you are right it should be built for changing the resolution. or maybe the result looks ok anyway.

As far as I know it works "the wrong way round", i.e. different from the other resampling modules - you actually run it with the resolution set to that of the original map (g.region rast=mapname), and set the desired new resolution using command-line options.

Paul

On Thu, May 22, 2008 at 4:02 PM, Paul Kelly
<paul-grass@stjohnspoint.co.uk> wrote:

On Thu, 22 May 2008, Hamish wrote:

Thanks for the answer - I am in the process of trying it
out. But:
When I try to use r.resamp.rst, I get the error message
"Input map
resolution differs from current region resolution!". I
thought that
r.resamp.rst is doing exactly that - changing the
resolution?

hmmm, not sure. you are right it should be built for changing the
resolution. or maybe the result looks ok anyway.

As far as I know it works "the wrong way round", i.e. different from the
other resampling modules - you actually run it with the resolution set to
that of the original map (g.region rast=mapname), and set the desired new
resolution using command-line options.

That's what I figured out just now as well. Thanks Hamish and Paul and
Nikos - I will come back to you if I still have questions.

Rainer

Paul

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa