[GRASS-dev] [bug #4452] (grass) r.patch makes mosaics slowly

this bug's URL: http://intevation.de/rt/webrt?serial_num=4452
-------------------------------------------------------------------------

Subject: r.patch makes mosaics slowly

r.patch currently takes current_region_rows * current_region_columns *
number_of_input_maps time to compile mosaics. It has some reasonable
optimizations for patching an existing large map with many small patches, but
is quite unsuited to mosaics.

For mosaics the fast thing to do would be to iterate over input maps (bounds
of input, resolution of current region), copying values to nulls in the
output. (and non-zero values to zeros or nulls in the output with the -z switch).

-------------------------------------------- Managed by Request Tracker

this bug's URL: http://intevation.de/rt/webrt?serial_num=4452
---------------------------------------------------------------------

Subject: r.patch makes mosaics slowly

r.patch currently takes current_region_rows * current_region_columns *
number_of_input_maps time to compile mosaics. It has some reasonable
optimizations for patching an existing large map with many small
patches, but is quite unsuited to mosaics.

For mosaics the fast thing to do would be to iterate over input maps
(bounds of input, resolution of current region), copying values to
nulls in the output. (and non-zero values to zeros or nulls in the
output with the -z switch).

isn't this just the r.mapcalc solution?

Eric wrote:

r.mapcalc "$OUTPUT=if(isnull(Map_A), Map_B, Map_A)"

hint:

g.region rast=map1,map2,map3,map4

extends the region to enclose all listed maps. Helpful for r.patch.

I think in the end you will spend lots of time for little gain on this
problem- no matter how you frame it, you still have to read each cell of
each map. Just set the thing to run from a script before you leave for
the day & the result will wait for you in the morning. (unless you have
10,000 maps to patch or want real time availablility)

Hamish