[GRASS5] [bug #859] (grass) raster data at lower resolution: no resampling...

Markus Neteler neteler at itc.it
Mon Nov 26 19:41:57 EST 2001


Thanks Helena and Glynn,

On Mon, Nov 26, 2001 at 11:56:31PM +0000, Glynn Clements wrote:
> 
> Request Tracker wrote:
> 
> > (sorry to be so chatty)
> > 
> > from the GRASS prog's manual I understand that raster data
> > are resampled on the fly when looking at them in lower resolution.
> 
> Yes. Note: "resampled" does not imply "interpolated"; you can't
> meaningfully interpolate category values.

yes, I agree in general. But.. 
 
> > I have tested this and found, that the maximum value is used
> > instead...
> 
> Incorrect. When rescaling 2:1, the lower-right cell of each 2x2 block
> will be used.
yes, that's what I also see.

> that's wrong in my opinion.
I agree - using the lower-right cell is as wrong as using any other
cell falling into the 2x2. That's why I expected an average on the fly.
O.K., I did not test for FP maps.

> > 
> > An example
> > 
> > #use g.region to select a 6x6 subregion, say, at 30m resolution
> > g.region
> > #calculate a test map
> > r.mapcalc test="row() + col()"
> 
> Try a different example:
> 
>   r.mapcalc test="14 - row() - col()"
> 
> This "flips" the output diagonally, so the values decrease from
> top-left to bottom-right. This time, the resampled version gets the
> minimum value.
Mhh, here I get the middle value (either upper right or lower left).

So, what's the right representation for this case?
 
> > The last years I thought that the programmer's manual is right.
> > Obviously not (or not any more).
> 
> To which part of the manual are you referring?
I found it on page 61 (the printed page number) of the current version.

"Users expect map layers to be resampled into the current region. This
implies that raster maps must be extended with no data for portions of the
region which do not cover the map layer, and that the raster map data be
resampled to the region resolution if the raster map resolution is
different. Users also expect new map layers to be created with exactly the
same boundaries and resolution as the current region.
"

Maybe I am on the wrong path, but I understand from above that both
FP and int maps are averaged at lower resolution. Some month ago
I did the same test with int maps, that time, if I recall correctly,
the values were averaged.

Best regards

 Markus



More information about the grass-dev mailing list