|
Geometry : |
Subject: Re: [geometry] [index] support for serialization and external memory?
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2013-07-13 22:16:57
Hi,
Adam Wulkiewicz wrote:
> Mateusz Loskot wrote:
>> On 11 July 2013 15:58, feverzsj <feverzsj_at_[hidden]> wrote:
>>> hi, list
>>> Is it possible for the index to serialize its internal tree
>>> structure(and
>>> user data), so that the index can be rebuilt without reinsert?
>>
>> There is no such mechanism provided. AFAIK, it's planned in future.
>>
>
> Currently you can't do it without using hidden internals. There are
> plans to expose some mechanisms or provide new ones to allow users
> handling arbitrary serialization routine, along with incremental and
> automatic saving of modified nodes. But I don't know when they'll be
> available.
>
After some thinking I realized that serialization should probably be
separated from external/persistent memory storage functionality. I've
added a preliminary, experimental support for Boost.Serialization. To
use it you must define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL, see
libs/geometry/index/example/serialize.cpp. There are some things that
should probably be improved but it is something you can play with. So
the rtree may be saved in/loaded from various archives already
implemented in Boost. The tree is saved and loaded depth-first. Do you
think that it's enough or would you like to have more control over
serialization process? Theoretically you may implement your version of
archive but I didn't played with it enough to say what can be done with it.
Btw, what do you think about supporting serialization of Geometries?
Regards,
Adam
Geometry list run by mateusz at loskot.net