GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::simplify::TaggedLineStringSimplifier Class Reference

Simplifies a TaggedLineString, preserving topology (in the sense that no new intersections are introduced). Uses the recursive Douglas-Peucker algorithm. More...

#include <TaggedLineStringSimplifier.h>

Collaboration diagram for geos::simplify::TaggedLineStringSimplifier:
[legend]

Public Member Functions

 TaggedLineStringSimplifier (LineSegmentIndex *inputIndex, LineSegmentIndex *outputIndex)
 
void setDistanceTolerance (double d)
 Sets the distance tolerance for the simplification. More...
 
void simplify (TaggedLineString *line)
 

Private Member Functions

void simplifySection (std::size_t i, std::size_t j, std::size_t depth)
 
bool hasBadIntersection (const TaggedLineString *parentLine, const std::pair< std::size_t, std::size_t > &sectionIndex, const geom::LineSegment &candidateSeg)
 
bool hasBadInputIntersection (const TaggedLineString *parentLine, const std::pair< std::size_t, std::size_t > &sectionIndex, const geom::LineSegment &candidateSeg)
 
bool hasBadOutputIntersection (const geom::LineSegment &candidateSeg)
 
bool hasInteriorIntersection (const geom::LineSegment &seg0, const geom::LineSegment &seg1) const
 
std::unique_ptr< TaggedLineSegmentflatten (std::size_t start, std::size_t end)
 
void remove (const TaggedLineString *line, std::size_t start, std::size_t end)
 Remove the segs in the section of the line. More...
 

Static Private Member Functions

static std::size_t findFurthestPoint (const geom::CoordinateSequence *pts, std::size_t i, std::size_t j, double &maxDistance)
 
static bool isInLineSection (const TaggedLineString *parentLine, const std::pair< std::size_t, std::size_t > &sectionIndex, const TaggedLineSegment *seg)
 Tests whether a segment is in a section of a TaggedLineString. More...
 

Private Attributes

LineSegmentIndexinputIndex
 
LineSegmentIndexoutputIndex
 
std::unique_ptr< algorithm::LineIntersectorli
 
TaggedLineStringline
 non-const as segments are possibly added to it More...
 
const geom::CoordinateSequencelinePts
 
double distanceTolerance
 

Detailed Description

Simplifies a TaggedLineString, preserving topology (in the sense that no new intersections are introduced). Uses the recursive Douglas-Peucker algorithm.

Definition at line 63 of file TaggedLineStringSimplifier.h.

Constructor & Destructor Documentation

geos::simplify::TaggedLineStringSimplifier::TaggedLineStringSimplifier ( LineSegmentIndex inputIndex,
LineSegmentIndex outputIndex 
)

Member Function Documentation

static std::size_t geos::simplify::TaggedLineStringSimplifier::findFurthestPoint ( const geom::CoordinateSequence pts,
std::size_t  i,
std::size_t  j,
double &  maxDistance 
)
staticprivate
std::unique_ptr<TaggedLineSegment> geos::simplify::TaggedLineStringSimplifier::flatten ( std::size_t  start,
std::size_t  end 
)
private
bool geos::simplify::TaggedLineStringSimplifier::hasBadInputIntersection ( const TaggedLineString parentLine,
const std::pair< std::size_t, std::size_t > &  sectionIndex,
const geom::LineSegment candidateSeg 
)
private
bool geos::simplify::TaggedLineStringSimplifier::hasBadIntersection ( const TaggedLineString parentLine,
const std::pair< std::size_t, std::size_t > &  sectionIndex,
const geom::LineSegment candidateSeg 
)
private
bool geos::simplify::TaggedLineStringSimplifier::hasBadOutputIntersection ( const geom::LineSegment candidateSeg)
private
bool geos::simplify::TaggedLineStringSimplifier::hasInteriorIntersection ( const geom::LineSegment seg0,
const geom::LineSegment seg1 
) const
private
static bool geos::simplify::TaggedLineStringSimplifier::isInLineSection ( const TaggedLineString parentLine,
const std::pair< std::size_t, std::size_t > &  sectionIndex,
const TaggedLineSegment seg 
)
staticprivate

Tests whether a segment is in a section of a TaggedLineString.

Parameters
parentLine
sectionIndex
seg
Returns
void geos::simplify::TaggedLineStringSimplifier::remove ( const TaggedLineString line,
std::size_t  start,
std::size_t  end 
)
private

Remove the segs in the section of the line.

Parameters
line
start
end
void geos::simplify::TaggedLineStringSimplifier::setDistanceTolerance ( double  d)
inline

Sets the distance tolerance for the simplification.

All vertices in the simplified geometry will be within this distance of the original geometry.

Parameters
dthe approximation tolerance to use

Definition at line 157 of file TaggedLineStringSimplifier.h.

void geos::simplify::TaggedLineStringSimplifier::simplify ( TaggedLineString line)

Simplifies the given TaggedLineString using the distance tolerance specified.

Parameters
linethe linestring to simplify
void geos::simplify::TaggedLineStringSimplifier::simplifySection ( std::size_t  i,
std::size_t  j,
std::size_t  depth 
)
private

Member Data Documentation

double geos::simplify::TaggedLineStringSimplifier::distanceTolerance
private

Definition at line 104 of file TaggedLineStringSimplifier.h.

LineSegmentIndex* geos::simplify::TaggedLineStringSimplifier::inputIndex
private

Definition at line 92 of file TaggedLineStringSimplifier.h.

std::unique_ptr<algorithm::LineIntersector> geos::simplify::TaggedLineStringSimplifier::li
private

Definition at line 97 of file TaggedLineStringSimplifier.h.

TaggedLineString* geos::simplify::TaggedLineStringSimplifier::line
private

non-const as segments are possibly added to it

Definition at line 100 of file TaggedLineStringSimplifier.h.

const geom::CoordinateSequence* geos::simplify::TaggedLineStringSimplifier::linePts
private

Definition at line 102 of file TaggedLineStringSimplifier.h.

LineSegmentIndex* geos::simplify::TaggedLineStringSimplifier::outputIndex
private

Definition at line 95 of file TaggedLineStringSimplifier.h.


The documentation for this class was generated from the following file: