Skip to content

Commit

Permalink
Fix spatial filter checks when filters are not present.
Browse files Browse the repository at this point in the history
  • Loading branch information
connormanning committed Jul 17, 2021
1 parent 41f196e commit 9b0652b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions io/EptReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ bool EptReader::passesSpatialFilter(const BOX3D& tileBounds) const
auto boxOverlaps = [this, &reproject, &tileBounds]() -> bool
{
if (!m_p->bounds.box.valid())
return false;
return true;

// If the reprojected source bounds doesn't overlap our query bounds, we're done.
return reproject(tileBounds, m_p->bounds.xform).overlaps(m_p->bounds.box);
Expand All @@ -566,6 +566,9 @@ bool EptReader::passesSpatialFilter(const BOX3D& tileBounds) const
// we can skip
auto polysOverlap = [this, &reproject, &tileBounds]() -> bool
{
if (m_p->polys.empty())
return true;

for (auto& ps : m_p->polys)
if (!ps.poly.disjoint(reproject(tileBounds, ps.xform)))
return true;
Expand Down Expand Up @@ -675,13 +678,16 @@ bool EptReader::processPoint(PointRef& dst, const TileContents& tile)
auto passesBoundsFilter = [this](double x, double y, double z)
{
if (!m_p->bounds.box.valid())
return false;
return true;
m_p->bounds.xform.transform(x, y, z);
return m_p->bounds.box.contains(x, y, z);
};

auto passesPolyFilter = [this](double xo, double yo, double zo)
{
if (m_p->polys.empty())
return true;

for (PolyXform& ps : m_p->polys)
{
double x = xo;
Expand Down

0 comments on commit 9b0652b

Please sign in to comment.