MCPcopy Create free account
hub / github.com/OSGeo/PROJ / insertGrid

Method insertGrid

src/grids.cpp:1498–1516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1496// ---------------------------------------------------------------------------
1497
1498void GTiffVGrid::insertGrid(PJ_CONTEXT *ctx,
1499 std::unique_ptr<GTiffVGrid> &&subgrid) {
1500 bool gridInserted = false;
1501 const auto &extent = subgrid->extentAndRes();
1502 for (const auto &candidateParent : m_children) {
1503 const auto &candidateParentExtent = candidateParent->extentAndRes();
1504 if (candidateParentExtent.contains(extent)) {
1505 static_cast<GTiffVGrid *>(candidateParent.get())
1506 ->insertGrid(ctx, std::move(subgrid));
1507 gridInserted = true;
1508 break;
1509 } else if (candidateParentExtent.intersects(extent)) {
1510 pj_log(ctx, PJ_LOG_DEBUG, "Partially intersecting grids found!");
1511 }
1512 }
1513 if (!gridInserted) {
1514 m_children.emplace_back(std::move(subgrid));
1515 }
1516}
1517
1518// ---------------------------------------------------------------------------
1519

Callers 1

insertIntoHierarchyFunction · 0.80

Calls 4

pj_logFunction · 0.85
containsMethod · 0.45
getMethod · 0.45
intersectsMethod · 0.45

Tested by

no test coverage detected