17 #include <geos/export.h>
19 #include <geos/operation/buffer/BufferParameters.h>
20 #include <geos/geom/GeometryFactory.h>
21 #include <geos/constants.h>
27 class CoordinateSequence;
34 class OffsetCurveSection;
96 bool isJoined =
false;
104 std::unique_ptr<Geometry> computeCurve(
107 std::vector<std::unique_ptr<OffsetCurveSection>> computeSections(
110 std::unique_ptr<LineString> offsetSegment(
113 static std::unique_ptr<Polygon> getBufferOriented(
127 void computeCurveSections(
130 std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
144 std::size_t matchSegments(
146 std::size_t rawCurveIndex,
147 SegmentMCIndex& bufferSegIndex,
149 std::vector<double>& rawCurvePos);
151 static double segmentMatchFrac(
154 double matchDistance);
167 void extractSections(
169 std::vector<double>& rawCurveLoc,
170 std::size_t startIndex,
171 std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
173 std::size_t findSectionStart(
174 const std::vector<double>& loc,
177 std::size_t findSectionEnd(
178 const std::vector<double>& loc,
180 std::size_t firstStartIndex);
182 static std::size_t nextIndex(std::size_t i, std::size_t size);
183 static std::size_t prevIndex(std::size_t i, std::size_t size);
189 static constexpr
int MATCH_DISTANCE_FACTOR = 10000;
195 static constexpr
int MIN_QUADRANT_SEGMENTS = 8;
210 , matchDistance(std::abs(dist)/MATCH_DISTANCE_FACTOR)
211 , geomFactory(geom.getFactory())
213 if (!std::isfinite(dist)) {
230 , matchDistance(std::abs(dist)/MATCH_DISTANCE_FACTOR)
231 , geomFactory(geom.getFactory())
233 if (!std::isfinite(dist)) {
243 if (quadSegs < MIN_QUADRANT_SEGMENTS) {
244 quadSegs = MIN_QUADRANT_SEGMENTS;
261 static std::unique_ptr<Geometry> getCurve(
268 static std::unique_ptr<Geometry> getCurve(
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Definition: LineString.h:66
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Contains the parameters which describe how a buffer should be constructed.
Definition: BufferParameters.h:56
double getMitreLimit() const
Definition: BufferParameters.h:236
void setMitreLimit(double limit)
Definition: BufferParameters.h:255
JoinStyle getJoinStyle() const
Definition: BufferParameters.h:211
void setJoinStyle(JoinStyle style)
Sets the join style for outside (reflex) corners between line segments.
Definition: BufferParameters.h:226
int getQuadrantSegments() const
Definition: BufferParameters.h:137
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet.
JoinStyle
Join styles.
Definition: BufferParameters.h:74
Definition: OffsetCurve.h:83
OffsetCurve(const Geometry &geom, double dist, BufferParameters &bp)
Definition: OffsetCurve.h:227
std::unique_ptr< Geometry > getCurve()
static std::unique_ptr< CoordinateSequence > rawOffset(const LineString &line, double distance)
void setJoined(bool pIsJoined)
static std::unique_ptr< CoordinateSequence > rawOffsetCurve(const LineString &line, double distance, BufferParameters &bufParams)
static std::unique_ptr< Geometry > getCurveJoined(const Geometry &geom, double dist)
OffsetCurve(const Geometry &geom, double dist)
Definition: OffsetCurve.h:207
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25