[GRASS-user] r.resamp observations

Hamish hamish_nospam at yahoo.com
Wed Dec 20 07:41:43 EST 2006


Hi,

after resampling some maps, some observations-

highlights:
* apparent data bug in r.resamp.stats
* r.resamp* modules are inconsistent in usage
* there seems to be some inter-module spatial bias going on
* message bug in r.resamp.rst
* g.region+"r.mapcalc new=old" shows the least spatial bias WRT null/
   non-NULL (use to make coverage masks for other more sloppy methods)


original map: 10m, 4150x2900 cells
target res: 50m, 100m, 200m (,500m).
(Modules may be assuming target is finer than original, but I'm going
the other way)


inconsistency:
r.resamp.interp propagates nulls by default
  # shrinks map

r.resamp.stats  doesn't propagate nulls by default (-n flag)
  # grows map (maybe just an artifact of southward bug? [see below])

r.resamp.rst  doesn't propogate nulls by default
  # 50m resample grows map by 2-3 cells.
  # if 50m resample MASKed to original extent it looks good
  # as the res->500m, it only grows towards North East (?)
  # for ->500m it seems to shift the data NE too, but that may
  #   just be a trick of the eye


To get the "best" resampled null-edge: (no growth, cells stradle vect edge)
g.region res=50
r.mapcalc "50m_mask=if(isnull(original.10m), null(), 1)"


r.resamp.interp method=bilinear and bicubic will shrink the map when
it sees a null (which makes sense). This means that it is not much use
to folks who need info at the edges. (unless using some trick like
r.patch'ing the edges back in from another method :-/)


bug:
r.resamp.stats seems to shift the data southward by ~ 1 cell vs.
r.resamp.interp, r.resamp.rst, and g.region+r.mapcalc methods.


inconsistency:
r.resamp.rst must be run in the source resolution, while the other
methods are run from the target resolution.


bug:
r.resamp.rst from 10m to 100m:
ew_res=100 ns_res=100
Processing all selected output files will require
1444200 bytes of disk space for temp files.
Temporarily changing the region to desired resolution ...
Changing back to the original region ...
Percent complete:
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
Not enough disk space--cannot write files
...

(many gigs free)

trying it with
   2>&1 | grep -v "Not enough disk space"
it finishes, results look ok. Same command 10m->50m worked fine.
I also see the warnings with res=200.

For .rst with res=500 the north-east shift is more obvious.


.. and finally: at 100m,200m,+ resolutions there seems to be a northward
bias in g.region+r.mapcalc method vs. resamp.rst and resamp.interp/bicubic.
?


Hamish




More information about the grass-user mailing list