| 494 | } |
| 495 | |
| 496 | bool BuildTree() |
| 497 | { |
| 498 | #if GEOS_VERSION_MAJOR > 3 || \ |
| 499 | (GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR >= 12) |
| 500 | GEOSSTRtree_build_r(m_geosContext, m_poTree); |
| 501 | #else |
| 502 | if (m_store->Size() > 0) |
| 503 | { |
| 504 | // Perform a dummy query to force tree construction. |
| 505 | OGREnvelope oExtent; |
| 506 | oExtent.MinX = oExtent.MaxX = oExtent.MinY = oExtent.MaxY = 0; |
| 507 | GEOSGeometry *poEnv = CreateGEOSEnvelope(oExtent); |
| 508 | if (poEnv == nullptr) |
| 509 | { |
| 510 | return false; |
| 511 | } |
| 512 | GEOSSTRtree_query_r( |
| 513 | m_geosContext, m_poTree, poEnv, [](void *, void *) {}, nullptr); |
| 514 | GEOSGeom_destroy_r(m_geosContext, poEnv); |
| 515 | } |
| 516 | #endif |
| 517 | return true; |
| 518 | } |
| 519 | |
| 520 | std::vector<size_t> ReadTreeIndices() |
| 521 | { |
nothing calls this directly
no test coverage detected