| 1232 | // --------------------------------------------------------------------------- |
| 1233 | |
| 1234 | void GTiffVGrid::insertGrid(PJ_CONTEXT *ctx, |
| 1235 | std::unique_ptr<GTiffVGrid> &&subgrid) { |
| 1236 | bool gridInserted = false; |
| 1237 | const auto &extent = subgrid->extentAndRes(); |
| 1238 | for (const auto &candidateParent : m_children) { |
| 1239 | const auto &candidateParentExtent = candidateParent->extentAndRes(); |
| 1240 | if (candidateParentExtent.contains(extent)) { |
| 1241 | static_cast<GTiffVGrid *>(candidateParent.get()) |
| 1242 | ->insertGrid(ctx, std::move(subgrid)); |
| 1243 | gridInserted = true; |
| 1244 | break; |
| 1245 | } else if (candidateParentExtent.intersects(extent)) { |
| 1246 | pj_log(ctx, PJ_LOG_DEBUG, "Partially intersecting grids found!"); |
| 1247 | } |
| 1248 | } |
| 1249 | if (!gridInserted) { |
| 1250 | m_children.emplace_back(std::move(subgrid)); |
| 1251 | } |
| 1252 | } |
| 1253 | |
| 1254 | // --------------------------------------------------------------------------- |
| 1255 |
no test coverage detected