|
Geometry : |
Subject: Re: [geometry] rtree crash when used with inter process
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-05-24 06:46:01
Hi,
Gongyiling_boost wrote:
> that's great! Adam, i tried all the solutions you mentioned above,
> the my_linear_tag method failed to compile the insert method,
> compiler complains:
> D:\boost\boost_1_54_0\boost/geometry/index/rtree.hpp(1048): error C2664: "boost::geometry::index::detail::rtree::visitors::insert<Element,Value,Options,Translator,Box,Allocators,InsertTag>::insert(boost::interprocess::offset_ptr<PointedType,DifferenceType,OffsetType,OffsetAlignment> &,size_t &,const Value &,const boost::geometry::index::linear<MaxElements,MinElements> &,const Translator &,Allocators &,size_t)": cannot convert parameter 5 from "params_t" to "const boost::geometry::index::linear<MaxElements,MinElements> &"
Ah sorry about that! This should work:
template<size_tMax,size_tMin>
struct my_linear : bgi::linear<Max, Min> {};
namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree {
template <size_t MaxElements, size_t MinElements>
struct options_type< my_linear<MaxElements, MinElements> >
{
typedef options<
my_linear<MaxElements, MinElements>,
insert_default_tag,
choose_by_content_diff_tag,
split_default_tag,
linear_tag,
node_s_mem_static_tag
> type;
};
}}}}}
/*...*/
typedefmy_linear<32,8>params_t;
/*...*/
typedefbgi::rtree<rtree_value_type,params_t,indexable_t,equal_to_t,rtree_allocator_t>rtree_t;
So this slightly more complicated but also more flexible since you may
define Max/Min in the place where the rtree is created.
But it probably should also be possible to use the tag-based approach.
I'll think about it and maybe prepare a patch...
> then i modified the boost/geometry/index/detail/rtree/options.hpp according to github, and it worked perfectly!
I'm glad it's ok.
Regards,
Adam
Geometry list run by mateusz at loskot.net