| 1496 | // --------------------------------------------------------------------------- |
| 1497 | |
| 1498 | void 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 |
no test coverage detected