MCPcopy Create free account
hub / github.com/OSGeo/gdal / BuildTree

Method BuildTree

apps/gdalalg_vector_sort.cpp:496–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

CreateGEOSEnvelopeFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected