Skip to content

Commit

Permalink
Lazily build index in IndexedPointInAreaLocator
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaston committed Mar 10, 2020
1 parent 17110ec commit 6b12bcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Changes in 3.8.1
(#1013, Dan Baston)
- Fix missing vtable for LineString and CoordinateArraySequenceFactory
(#299 and #1016, Evgen Bodunov)
- Reduce performance regression in GEOSBuffer (#1020)

Changes in 3.8.0
2019-10-10
Expand Down
6 changes: 4 additions & 2 deletions src/algorithm/locate/IndexedPointInAreaLocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ IndexedPointInAreaLocator::IndexedPointInAreaLocator(const geom::Geometry& g)
&& areaGeomId != typeid(geom::LinearRing)) {
throw util::IllegalArgumentException("Argument must be Polygonal or LinearRing");
}

buildIndex(areaGeom);
}

geom::Location
IndexedPointInAreaLocator::locate(const geom::Coordinate* /*const*/ p)
{
if (index == nullptr) {
buildIndex(areaGeom);
}

algorithm::RayCrossingCounter rcc(*p);

IndexedPointInAreaLocator::SegmentVisitor visitor(&rcc);
Expand Down

0 comments on commit 6b12bcc

Please sign in to comment.