19 #include <geos/geom/LineSegment.h>
20 #include <geos/algorithm/locate/PointOnGeometryLocator.h>
21 #include <geos/index/ItemVisitor.h>
22 #include <geos/index/strtree/TemplateSTRtree.h>
29 class RayCrossingCounter;
34 class CoordinateSequence;
57 SegmentView(
const geom::CoordinateXY* p0,
const geom::CoordinateXY* p1) {
64 std::size_t os =
static_cast<std::size_t
>(
reinterpret_cast<const double*
>(p1) -
reinterpret_cast<const double*
>(p0)) - 2u;
65 m_p0 =
reinterpret_cast<std::size_t
>(p0) | os;
67 assert(&this->p0() == p0);
68 assert(&this->p1() == p1);
71 const geom::CoordinateXY& p0()
const {
72 auto ret =
reinterpret_cast<const geom::CoordinateXY*
>(m_p0 >> 2 << 2);
76 const geom::CoordinateXY& p1()
const {
77 auto offset = (m_p0 & 0x03) + 2;
78 auto ret =
reinterpret_cast<const geom::CoordinateXY*
>(
reinterpret_cast<double*
>(m_p0 >> 2 << 2) + offset);
85 class IntervalIndexedGeometry {
88 index::strtree::TemplateSTRtree<SegmentView, index::strtree::IntervalTraits> index;
96 template<
typename Visitor>
97 void query(
double min,
double max, Visitor&& f) {
103 std::unique_ptr<IntervalIndexedGeometry> index;
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency.
Definition: IndexedPointInAreaLocator.h:54
IndexedPointInAreaLocator(const geom::Geometry &g)
Creates a new locator for a given Geometry.
geom::Location locate(const geom::CoordinateXY *p) override
Determines the Location of a point in an areal Geometry.
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:36
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
A contiguous portion of 1D-space. Used internally by SIRtree.
Definition: strtree/Interval.h:30
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25