Boost C++ Libraries: Ticket #11247: More useful rtree API (public apply_visitor, ...) https://svn.boost.org/trac10/ticket/11247 <p> I would like to use geometry::index::rtree to create rtree in memory and then export whole structure to custom database. For that I need access to all nodes not only leaf values. </p> <p> Proposed changes:<br /> </p> <ul><li>make rtree::apply_visitor public </li><li>make rtree::depth public (optional but makes sense imho) </li><li>make second rtree typedef section (box_type, allocators, internal_node, leaf, node_pointer etc.) public </li></ul><p> Using that I can conveniently create my own visitor and traverse all nodes in a tree </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11247 Trac 1.4.3 awulkiew Wed, 13 May 2015 13:18:53 GMT type, summary changed; keywords set https://svn.boost.org/trac10/ticket/11247#comment:1 https://svn.boost.org/trac10/ticket/11247#comment:1 <ul> <li><strong>keywords</strong> rtree serialization added </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>summary</strong> <span class="trac-field-old">More useful rtree API</span> → <span class="trac-field-new">More useful rtree API (public apply_visitor, ...)</span> </li> </ul> <p> Unfortunately I plan to change the internals: simplify it, support more lightweight type of nodes, serialization and persistent memory. They are not ready for making them public. </p> <p> AFAIU what you want to do would be to save the whole rtree into the database. So basically what you need is the serialization support. I started working on it using Boost.Serialization, are you familiar with it? Would it be possible to write a custom Boost.Serialization Archive for your database in case if the serialization was supported by the rtree? Maybe would you like to finish the Serialization support and contribute it to the Boost.Geometry? I stopped at some point because I realized that I should use a different approach. </p> <p> For now you could of course use the details but have in mind that in the future they can be changed, though probably to something similar. Basically you could use the interface which is there for the experimental Serialization support so: </p> <ul><li>enable it by defining <code>BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL</code> </li><li>use <code>detail::rtree::private_view&lt;rtree&gt;</code> and <code>detail::rtree::const_private_view&lt;rtree&gt;</code> to access depth and apply_visitor </li></ul><p> If you had any problems the Boost.Geometry mailing list is a good place to ask questions. </p> Ticket Tomas P <pecholt@…> Thu, 14 May 2015 10:11:27 GMT <link>https://svn.boost.org/trac10/ticket/11247#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11247#comment:2</guid> <description> <p> I don't know much about boost serialization but I don't think it can help me. The database I am writing to has a certain format given by consortium which I have to follow. And it's not a 1:1 match with rtree nodes f.e. I have to serialize several nodes into single database blob but when the blob exceeds a size limit I have to allocate another blob and then nodes in the first blob change their types to be able to reference child nodes from different blob. So I really need access to individual tree nodes and custom visitors to do the transformation. </p> <p> My motivation for using geometry::rtree was that I get properly balanced r-tree with optimal depth so I don't need to hack r* algorithm myself. I didn't know it is being reworked. Anyway thanks for bringing this library into boost. I am confident it will evolve into something useful also for this type of usage. It's just not there yet. </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11247#comment:1" title="Comment 1">awulkiew</a>: </p> <blockquote class="citation"> <p> Unfortunately I plan to change the internals: simplify it, support more lightweight type of nodes, serialization and persistent memory. They are not ready for making them public. </p> <p> AFAIU what you want to do would be to save the whole rtree into the database. So basically what you need is the serialization support. I started working on it using Boost.Serialization, are you familiar with it? Would it be possible to write a custom Boost.Serialization Archive for your database in case if the serialization was supported by the rtree? Maybe would you like to finish the Serialization support and contribute it to the Boost.Geometry? I stopped at some point because I realized that I should use a different approach. </p> <p> For now you could of course use the details but have in mind that in the future they can be changed, though probably to something similar. Basically you could use the interface which is there for the experimental Serialization support so: </p> <ul><li>enable it by defining <code>BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL</code> </li><li>use <code>detail::rtree::private_view&lt;rtree&gt;</code> and <code>detail::rtree::const_private_view&lt;rtree&gt;</code> to access depth and apply_visitor </li></ul><p> If you had any problems the Boost.Geometry mailing list is a good place to ask questions. </p> </blockquote> </description> <category>Ticket</category> </item> </channel> </rss>