24 #ifndef GEOS_SIMPLIFY_TAGGEDLINESTRINGSIMPLIFIER_H
25 #define GEOS_SIMPLIFY_TAGGEDLINESTRINGSIMPLIFIER_H
27 #include <geos/export.h>
34 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
40 class LineIntersector;
43 class CoordinateSequence;
47 class TaggedLineSegment;
48 class TaggedLineString;
49 class LineSegmentIndex;
63 class GEOS_DLL TaggedLineStringSimplifier {
67 TaggedLineStringSimplifier(LineSegmentIndex* inputIndex,
68 LineSegmentIndex* outputIndex);
78 void setDistanceTolerance(
double d);
86 void simplify(TaggedLineString* line);
92 LineSegmentIndex* inputIndex;
95 LineSegmentIndex* outputIndex;
97 std::unique_ptr<algorithm::LineIntersector> li;
100 TaggedLineString* line;
102 const geom::CoordinateSequence* linePts;
104 double distanceTolerance;
106 void simplifySection(std::size_t i, std::size_t j,
109 static std::size_t findFurthestPoint(
110 const geom::CoordinateSequence* pts,
111 std::size_t i, std::size_t j,
112 double& maxDistance);
114 bool hasBadIntersection(
const TaggedLineString* parentLine,
115 const std::pair<std::size_t, std::size_t>& sectionIndex,
116 const geom::LineSegment& candidateSeg);
118 bool hasBadInputIntersection(
const TaggedLineString* parentLine,
119 const std::pair<std::size_t, std::size_t>& sectionIndex,
120 const geom::LineSegment& candidateSeg);
122 bool hasBadOutputIntersection(
const geom::LineSegment& candidateSeg);
124 bool hasInteriorIntersection(
const geom::LineSegment& seg0,
125 const geom::LineSegment& seg1)
const;
127 std::unique_ptr<TaggedLineSegment> flatten(
128 std::size_t start, std::size_t end);
138 static bool isInLineSection(
139 const TaggedLineString* parentLine,
140 const std::pair<std::size_t, std::size_t>& sectionIndex,
141 const TaggedLineSegment* seg);
150 void remove(
const TaggedLineString* line,
159 distanceTolerance = d;
169 #endif // GEOS_SIMPLIFY_TAGGEDLINESTRINGSIMPLIFIER_H