| 458 | |
| 459 | |
| 460 | QuickInfo EptReader::inspect() |
| 461 | { |
| 462 | QuickInfo qi; |
| 463 | |
| 464 | initialize(); |
| 465 | |
| 466 | qi.m_bounds = m_p->info->boundsConforming(); |
| 467 | qi.m_srs = m_p->info->srs(); |
| 468 | qi.m_pointCount = m_p->info->points(); |
| 469 | |
| 470 | for (auto& el : m_p->info->dims()) |
| 471 | qi.m_dimNames.push_back(el.first); |
| 472 | |
| 473 | // If there is a spatial filter from an explicit --bounds, an origin query, |
| 474 | // or polygons, then we'll limit our number of points to be an upper bound, |
| 475 | // and clip our bounds to the selected region. |
| 476 | if (m_p->hasSpatialFilter()) |
| 477 | { |
| 478 | log()->get(LogLevel::Debug) << |
| 479 | "Determining overlapping point count" << std::endl; |
| 480 | |
| 481 | m_p->hierarchy.reset(new ept::Hierarchy); |
| 482 | overlaps(); |
| 483 | |
| 484 | // If we've passed a spatial filter, determine an upper bound on the |
| 485 | // point count based on the hierarchy. |
| 486 | qi.m_pointCount = 0; |
| 487 | for (const ept::Overlap& overlap : *m_p->hierarchy) |
| 488 | qi.m_pointCount += overlap.m_count; |
| 489 | |
| 490 | //ABELL - This is wrong since we're not transforming the tile bounds to the |
| 491 | // SRS of each clip region, but that seems like a lot of mess for |
| 492 | // little value. Wait until someone complains. (Note that's it's a bit |
| 493 | // different from queryOverlaps or we'd just call that.) |
| 494 | // Clip the resulting bounds to the intersection of: |
| 495 | // - the query bounds (from an explicit bounds or an origin query) |
| 496 | // - the extents of the polygon selection |
| 497 | BOX3D b; |
| 498 | b.grow(m_p->bounds.box); |
| 499 | for (const auto& poly : m_args->m_polys) |
| 500 | b.grow(poly.bounds()); |
| 501 | |
| 502 | if (b.valid()) |
| 503 | qi.m_bounds.clip(b); |
| 504 | } |
| 505 | qi.m_valid = true; |
| 506 | |
| 507 | return qi; |
| 508 | } |
| 509 | |
| 510 | |
| 511 | void EptReader::addDimensions(PointLayoutPtr layout) |