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

Glynn Clements glynn.clements at virgin.net
Mon Nov 26 20:11:34 EST 2001


Markus Neteler wrote:

> > 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.

Well, right or wrong, "resampling" involves "sampling" the data, i.e.
extracting "samples". In the absence of some mechanism to control the
sampling, you "get what you're given".

> O.K., I did not test for FP maps.

Even for FP maps, it might not be desirable to interpolate. 
Interpolation may "create" values which never occurred anywhere in the
original data.

If the original data was a sampling of a continuous "surface", then
interpolation is reasonable. But are all FP maps guaranteed to be
such? Or could they be tessellations (partitionings) where the
individal partitions have a constant FP value? If they could, then
interpolation would be the wrong thing to do here.

> > > 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).

I created an 6x6 X-Y location with a resolution of 1, then tested with
"g.region res=1" and "g.region res=2".

If you take a subregion of an existing region, the results might
depend on the alignment of the subregion within the region. Or, for a
geographically-correlated region, they might depend upon the region's
(or subregion's) geographic coordinates.

> 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.

I don't see anything in the above paragraph to suggest that behaviour. 
In particular, it doesn't say that the layers will be interpolated. 
"resampled" is ambiguous; it could refer to extracting samples either
from the existing values, or from some surface passing through (or
near) the existing values.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list