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

Markus Neteler neteler at itc.it
Tue Nov 27 04:54:38 EST 2001


On Mon, Nov 26, 2001 at 06:37:26PM -0600, Helena wrote:
> 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. That's why I expected an average on the fly.
> > O.K., I did not test for FP maps.
> 
> If you do an average, for example when you have
> e.g. categories 1 (say forest) and 9(corn)  you get a category 5(grass)
> which is not there at at all. Category and "field" maps are very different
> in what you can do with them.

I agree - in this case we can get a pretty wrong result. 
What about using the dominant value (mhhh, if there is non what then?).

> > "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.
> 
> this just says resampled - it does not say averaged or reinterpolated

O.k. - the problem is that I have no idea what "resampled" means in
this case. It seems that we have to study the related sources.I just want
to understand what's happening.
 
> > 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.
> 
> resampled does not really means averaged and averaging is not a good
> solution for every case of resampling (especially if you have categories
> but it is not good for fields either). From what I remember the resampling
> just assigns the same value which is within that cell to all the cells it
> is split into, when the resolution is lower, then you probably have to
> look at the source code what kind of rule

Yes, for the first case (higher resolution) the values are dublicated.
But for the lower resolution case I don't understand the method. I
try to find it in the code.
 
> it is using. Somebody might have changed it but originally resampling did not
> do any computations.
> 
> >... maybe I am too tired right now, but how shall GRASS detect if
> >the raster represents a continuous field (in INT) or a categories map?
> 
> User should know it and handle it appropriately. It would be hard to cover
> all possible cases (especially if you have large number of categories )
> and you would have to run analysis for continuity - which can be done, but
> even if you know it, it very much depends on the pnenomemon that you are
> working with and on the application what you should use for resampling.

Does it make sense print a warning in this case? To make the user
aware that the resolution doesn't match?
At least when exporting data or using r.mapcalc this is quite important.

> What is the correct way to do it for imagery?
> 
> >Currently GRASS seems to silently do something.
> 
> You can have g.region write out a warning that all maps with diferent
> resolution will be resampled on the fly and users should check whether it
> won't affect their application (and if yes, use appropriate GRASS module
> to reinterpolate or resample). We were thinking (especially for 3D) to
> give an option for the user to select which resampling method to use when
> running g.region, but it got messy pretty quickly, as there were just too
> many options and possibilities.
> 
> Helena

Markus



More information about the grass-dev mailing list