[GRASS-user] g.copy several map layers into one layer without overwriting .....

Glynn Clements glynn at gclements.plus.com
Wed Dec 12 16:59:57 PST 2012

Markus Neteler wrote:

> > There isn't currently an efficient way to join "slices" either using
> > commands or the public C API.
> I wonder if the segment lib could be (ab)used for this?


You could improve upon r.patch/r.mapcalc by querying each input map's
bounds and not bothering to read rows which are bound to be all-null
due to lying outside of the map's bounds. And if you only have one
non-null input row for a given output row, there's no need to "patch"
rows together.

But that still decompresses then re-compresses each row (unless you're
generating an uncompressed output map). A low-level utility (or
library function) which copies the compressed rows verbatim (rather
than using the get_row/put_row functions) could avoid this.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list