Skip to content
New issue

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

SimpleSTRtree use remove return true,but SimpleSTRtree data not change #1202

Open
daijie1991 opened this issue Dec 4, 2024 · 1 comment
Open

Comments

@daijie1991
Copy link

daijie1991 commented Dec 4, 2024

std::unique_ptr<geos::index::strtree::SimpleSTRtree> stRtree;
std::shared_ptr<AlgoGeoElement> algoGeoElement;
stRtree->insert(algoGeoElement->getJstGeometry()->getEnvelopeInternal(),geoElement);

 for (auto it = elementMap.begin(); it != elementMap.end();) {
        if (it->second.get()->getId() == id) {
            bool isRemove = stRtree->remove(it->second->getJstGeometry()->getEnvelopeInternal(),
                                            it->first);
            if (isRemove) {
                  for (auto &node: it->second->getPointMap()) {
                    for (std::size_t i = 0; i < node.second.get()->getSize(); ++i) {
                        kdTree->insert(node.second.get()->getAt(i), nullptr);
                    }
                }
}

isRemove is true,stRtree data not delete?
19
20

geos::geom::Envelope envelope;
    envelope.expandToInclude(x, y);
    envelope.expandBy(searchRadius);
    std::vector<void *> result;
    AlgoGeoManager::stRtree->query(&envelope, result);

result is empty

@dr-jts
Copy link
Contributor

dr-jts commented Dec 9, 2024

Does this only happen with specific data? If so, can you provide data which exhibits the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants