We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using PackedRTree as spatial index, demo code:
struct GeojsonWithAutoSpatialIndex { std::vector<int> query_by_bbox(double xmin, double ymin, double ymin, double ymax) const { auto &tree = this->tree(); // rebuild spatial index if needed auto hits = tree.search(...); // not working, always empty hits ... } void add_feature(...) { // ... tree_.reset(); // reset spatial index } void remove_feature(...); private: FeatureCollection features; // auto spatial index mutable std::optional<PackedRtree> tree_; PackedRtree &tree() const { if (!tree_) { // code to build rtree from features here // ... tree_ = PackedRTree(nodes, extent); // BAD CODE HERE } return *tree_; } };
I've already tested PackedRTree in other projects and it works well. But in this case, it's not working.
Strugged for a while, I find that PackedRTree violates rule of three.
PackedRTree
PackedRTree should disable copy (like boost:noncopyable), or implement proper deepcopy (handle NodeItem *_nodeItems).
boost:noncopyable
NodeItem *_nodeItems
Or make it value semantic (cubao/headers#17).
The text was updated successfully, but these errors were encountered:
Thanks for noticing @district10, I think prefer the value semantic fix.
Sorry, something went wrong.
No branches or pull requests
I'm using PackedRTree as spatial index, demo code:
I've already tested PackedRTree in other projects and it works well. But in this case, it's not working.
Strugged for a while, I find that
PackedRTree
violates rule of three.PackedRTree should disable copy (like
boost:noncopyable
), or implement proper deepcopy (handleNodeItem *_nodeItems
).Or make it value semantic (cubao/headers#17).
The text was updated successfully, but these errors were encountered: