[GRASS-user] g.copy several map layers into one layer without overwriting .....
andranik.h89 at gmail.com
Thu Dec 6 04:26:47 PST 2012
In order not to confuse you, I'd like to inform that my last post was
wrong, I have some mistakes in my script and came across wrong results.
Actually making group of chunks and exporting it making multiband image.
It is working slow, as it is filling nodata of each chunk with 0, and not
concatenating them together.
So as I understand the only way to concatenate chunks of compressed image
On Thu, Dec 6, 2012 at 12:48 PM, Andranik Hayrapetyan <
andranik.h89 at gmail.com> wrote:
> Thank you for your response,
> I found an alternative way to avoid r.patch. But it is only for special
> cases when you need to output image after calculation at once.
> I put all chunks into a group with i.group and after it export the group
> with r.out.gdal . It is much more faster then when I r.patch chunks and
> export after it.
> I think this is also not bad approach.
> On Wed, Dec 5, 2012 at 8:54 PM, Glynn Clements <glynn at gclements.plus.com>wrote:
>> Andranik Hayrapetyan wrote:
>> > I am trying to make a script which will split a raster map into chunks,
>> > the calculation on every chunk separately ( in parallel way ), and
>> > together all the peaces.
>> > So I am cutting the region into peaces, doing the calculation, restoring
>> > region to default region and finally get small peaces of raster map in
>> > default location and in default mapset.
>> > Here is the problem of gathering the peaces together arises...
>> > If I do it with r.patch, it is taking too long, and the whole meaning of
>> > parallelism is disappearing.
>> > So I thought about g.copy .
>> > Is there a way to copy all the peaces into one layer without overwriting
>> > the other peaces.
>> > For example I have chunk_1 and chunk_2, which are the parts of one map.
>> > How can I copy them into another map, so that they don't overwrite each
>> > other ?
>> For an uncompressed map, you can simply concatenate the cell/fcell
>> files (you still need to generate the metadata files, e.g. cellhd,
>> range, etc).
>> A compressed map starts with an array of row indices, and the rows
>> typically won't all have the same length (or necessarily be in order
>> and/or contiguous).
>> If you know that the individual maps are disjoint, it would be
>> possible to improve upon r.patch even while using the raster I/O API.
>> In the case where the maps are disjoint vertical slices of the same
>> region, it would be possible to improve significantly upon the raster
>> I/O API by copying the compressed rows verbatim from the input
>> cell/fcell files to the output file. That would avoid decompression,
>> resampling and compression.
>> Glynn Clements <glynn at gclements.plus.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user