Skip to content

Commit

Permalink
Fix transform for points being tested in multiple polygons.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 15, 2021
1 parent f5654b6 commit 58901f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions io/EptReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ void EptReader::initialize()
m_p->boundsXform = SrsTransform(m_p->info->srs(), boundsSrs);
m_queryBounds = m_args->m_bounds.to3d();

// Transform polygons and bounds to point source SRS.
std::vector <Polygon> exploded;
// Create transform from the point source SRS to the poly SRS.
for (Polygon& poly : m_args->m_polys)
{
if (!poly.valid())
Expand Down Expand Up @@ -685,13 +684,17 @@ bool EptReader::processPoint(PointRef& dst, const TileContents& tile)
return m_queryBounds.contains(x, y, z);
};

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

for (PolySrs& ps : m_p->polys)
{
double x = xo;
double y = yo;
double z = zo;

ps.xform.transform(x, y, z);
if (ps.poly.contains(x, y))
return true;
Expand Down

0 comments on commit 58901f4

Please sign in to comment.