[GRASSLIST:5880] Observations about r.proj

Victor Wren vwren at timension.com
Wed Mar 26 17:02:06 EST 2003


I've been playing around with r.proj for a couple of days, now.  I've noticed 
some things that explain unusual behavior that I was seeing in projected DEM 
maps.  I was noticing that they didn't meet up at the edges quite right after 
projection.  I figured out what was going on when I decided to see if I could 
find a simple way to shrink maps down if the -n flag is necessary.  Using 
g.region rast={map} zoom={map} was not yielding a map with dimensions equal 
to the source map (being that both maps were UTM, they should have been).  It 
seemed to grow a cell or two in all directions.

What I think is happening is that using any interpolation method will cause 
boundary effects, where the edges are being interpolated with nulls 
(interpreted as zero?).  This has the effect of creating cells where there 
were none before (if the region is larger than the source map, and the -n 
switch is used), but more importantly, it causes distortions at the edge of 
any maps, even when the -n switch isn't used.  I've decided for my 
application, bilinear interpolation was unnecessary, but in a general case it 
might not be (such as projecting from geo coordinates to UTM)

Is there a way to overcome this?  I'm a mathematical idiot, but it seems to 
me that if any of the cell values in the interpolation group is null (the 
four cells of the bilinear group, or the 16 cells of the cubic group), the 
interpolation should not be done, or perhaps should be "faked" by repeating 
the edge cells out until a legitimate group can be created, which may be no 
more valid, but at least will keep the edge from dropping away).  If the 
center cell is a null, does it get filled in by interpolated data?  My 
experience would suggest that it does (that would also distort data in 
adjacent that is depending on that null cell as one of its bilinear or cubic 
group).  Should "no-data" be treated as zero for the purpose of 
interpolation?  I can think of arguments both ways.  Does this matter to 
anybody?

Victor Wren





More information about the grass-user mailing list