Modifier and Type | Field and Description |
---|---|
(package private) List<Point2D> |
point2DList |
Constructor and Description |
---|
MTBPoint2DSet()
Standard constructor.
|
MTBPoint2DSet(List<Point2D> point2DList)
Constructs a MTBPoint2DSet from a list of points.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Point2D point2D) |
boolean |
addAll(MTBPoint2DSet point2DSet) |
MTBPoint2DSet |
applyRamerDouglasPeuckerAlgorithm(double epsilon)
Calls
applyRamerDouglasPeuckerAlgorithm(int, int, double) with the first and last point of the point list. |
MTBPoint2DSet |
applyRamerDouglasPeuckerAlgorithm(int startIndex,
int lastIndex,
double epsilon)
Algorithm idea:
- Urs Ramer, "An iterative procedure for the polygonal approximation of plane curves",
Computer Graphics and Image Processing, 1(3), 244–256 (1972) doi:10.1016/S0146-664X(72)80017-0
- David Douglas & Thomas Peucker, "Algorithms for the reduction of the number of points required to represent a digitized line
or its caricature", The Canadian Cartographer 10(2), 112–122 (1973) doi:10.3138/FM57-6770-U75U-7727
Implementation according to: https://www.namekdev.net/2014/06/iterative-version-of-ramer-douglas-peucker-line-simplification-algorithm/
|
private double |
calculatePointLineDistance(double px,
double py,
double sx,
double sy,
double lx,
double ly)
Calculates the distance between a point and a line.
|
MTBPoint2DSet |
clone() |
Point2D |
get(int i) |
Iterator<Point2D> |
iterator() |
Point2D |
remove(int i) |
boolean |
remove(Point2D point2D) |
int |
size() |
String |
toString() |
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public MTBPoint2DSet()
public MTBPoint2DSet clone()
public int size()
public boolean add(Point2D point2D)
public boolean addAll(MTBPoint2DSet point2DSet)
public boolean remove(Point2D point2D)
public Point2D remove(int i)
public Point2D get(int i)
public MTBPoint2DSet applyRamerDouglasPeuckerAlgorithm(int startIndex, int lastIndex, double epsilon)
startIndex
- Index in line of the current starting pointlastIndex
- Index in line of the current ending pointepsilon
- Distance dimension. Keep the point if the distance is greater than epsilon.
The greater the epsilon the coarser the approximation.public MTBPoint2DSet applyRamerDouglasPeuckerAlgorithm(double epsilon)
applyRamerDouglasPeuckerAlgorithm(int, int, double)
with the first and last point of the point list.epsilon
- Distance dimension. Keep the point if the distance is greater than epsilon.
The greater the epsilon the coarser the approximation.private double calculatePointLineDistance(double px, double py, double sx, double sy, double lx, double ly)
px
- x-coordinate of current pointpy
- y-coordinate of current pointsx
- x-coordinate of start pointsy
- y-coordinate of start pointlx
- x-coordinate of end pointly
- y-coordinate of end pointCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.