18#include <geos/algorithm/BoundaryNodeRule.h>
19#include <geos/algorithm/locate/PointOnGeometryLocator.h>
20#include <geos/operation/relateng/AdjacentEdgeLocator.h>
21#include <geos/operation/relateng/LinearBoundary.h>
22#include <geos/geom/Coordinate.h>
23#include <geos/geom/Location.h>
24#include <geos/export.h>
75class GEOS_DLL RelatePointLocator {
79 using CoordinateXY = geos::geom::CoordinateXY;
90 bool isPrepared =
false;
91 const BoundaryNodeRule& boundaryRule;
92 std::unique_ptr<AdjacentEdgeLocator> adjEdgeLocator;
93 Coordinate::ConstXYSet points;
94 std::vector<const LineString *> lines;
95 std::vector<const Geometry *> polygons;
96 std::vector<std::unique_ptr<PointOnGeometryLocator>> polyLocator;
97 std::unique_ptr<LinearBoundary> lineBoundary;
105 RelatePointLocator(
const Geometry* p_geom)
109 RelatePointLocator(
const Geometry* p_geom,
bool p_isPrepared,
const BoundaryNodeRule& p_bnRule)
111 , isPrepared(p_isPrepared)
112 , boundaryRule(p_bnRule)
117 void init(
const Geometry* p_geom);
119 bool hasBoundary()
const;
121 void extractElements(
const Geometry* geom);
123 void addPoint(
const Point* pt);
125 void addLine(
const LineString* line);
127 void addPolygonal(
const Geometry* polygonal);
129 Location locate(
const CoordinateXY* p);
131 int locateLineEndWithDim(
const CoordinateXY* p);
141 Location locateNode(
const CoordinateXY* p,
const Geometry* parentPolygonal);
184 int locateWithDim(
const CoordinateXY* p,
bool isNode,
const Geometry* parentPolygonal);
186 int computeDimLocation(
const CoordinateXY* p,
bool isNode,
const Geometry* parentPolygonal);
188 Location locateOnPoints(
const CoordinateXY* p)
const;
190 Location locateOnLines(
const CoordinateXY* p,
bool isNode);
192 Location locateOnLine(
const CoordinateXY* p,
const LineString* l);
194 Location locateOnPolygons(
const CoordinateXY* p,
bool isNode,
const Geometry* parentPolygonal);
196 Location locateOnPolygonal(
const CoordinateXY* p,
198 const Geometry* parentPolygonal,
201 PointOnGeometryLocator * getLocator(std::size_t
index);
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition BoundaryNodeRule.h:52
static const BoundaryNodeRule & getBoundaryRuleMod2()
The Mod-2 Boundary Node Rule (which is the rule specified in the OGC SFS).
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
Definition LineString.h:66
int locateNodeWithDim(const CoordinateXY *p, const Geometry *parentPolygonal)
int locateWithDim(const CoordinateXY *p)
Classes which determine the Location of points in geometries.
Definition IndexedPointInAreaLocator.h:40
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
Basic namespace for all GEOS functionalities.
Definition geos.h:38