19 #ifndef GEOS_IDX_CHAIN_MONOTONECHAIN_H 20 #define GEOS_IDX_CHAIN_MONOTONECHAIN_H 22 #include <geos/export.h> 23 #include <geos/geom/CoordinateSequence.h> 24 #include <geos/geom/Envelope.h> 25 #include <geos/geom/LineSegment.h> 33 class CoordinateSequence;
100 std::size_t start, std::size_t end,
void* context);
106 const geom::Envelope& getEnvelope(
double expansionDistance)
const;
109 getStartIndex()
const 125 pts->
getAt(index, ls.p0);
134 std::unique_ptr<geom::CoordinateSequence> getCoordinates()
const;
146 void computeOverlaps(
const MonotoneChain* mc,
double overlapTolerance,
160 MonotoneChainSelectAction& mcs)
const;
162 void computeOverlaps(std::size_t start0, std::size_t end0,
const MonotoneChain& mc,
163 std::size_t start1, std::size_t end1,
164 double overlapTolerance,
165 MonotoneChainOverlapAction& mco)
const;
167 bool overlaps(std::size_t start0, std::size_t end0,
168 const MonotoneChain& mc, std::size_t start1, std::size_t end1,
169 double overlapTolerance)
const {
170 if (overlapTolerance > 0.0) {
171 return overlaps(pts->
getAt(start0), pts->
getAt(end0),
172 mc.pts->getAt(start1), mc.pts->getAt(end1), overlapTolerance);
175 mc.pts->getAt(start1), mc.pts->getAt(end1));
178 static bool overlaps(
const geom::Coordinate& p1,
const geom::Coordinate& p2,
179 const geom::Coordinate& q1,
const geom::Coordinate& q2,
180 double overlapTolerance);
183 const geom::CoordinateSequence* pts;
195 mutable geom::Envelope env;
202 #endif // GEOS_IDX_CHAIN_MONOTONECHAIN_H Definition: LineSegment.h:59
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
Coordinate p1
Segment start.
Definition: LineSegment.h:66
static bool intersects(const Coordinate &p1, const Coordinate &p2, const Coordinate &q)
Test the point q to see whether it intersects the Envelope defined by p1-p2.
void getLineSegment(std::size_t index, geom::LineSegment &ls) const
Set given LineSegment with points of the segment starting at the given index.
Definition: index/chain/MonotoneChain.h:124
The action for the internal iterator for performing overlap queries on a MonotoneChain.
Definition: MonotoneChainOverlapAction.h:43
Definition: MonotoneChainSelectAction.h:45
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26
Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of...
Definition: index/chain/MonotoneChain.h:86
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
virtual const Coordinate & getAt(std::size_t i) const =0
Returns a read-only reference to Coordinate at position i.