Home | Trees | Indices | Help |
|
---|
|
Six different functions to simplify or linearize a path given as a list, sequence or tuple of LatLon points.
Each of the simplify functions is based on a different algorithm and produces different simplified results in (very) different run times for the same path of LatLon points.
Function simplify1 eliminates points based on edge length. Function simplify2 slides a pipe over each edge, removing subsequent points up to the first point outside the pipe.
The functions simplifyRDP and simplifyRDPm use the original, respectively modified Ramer-Douglas-Peucker (RDP) algorithm, recursively finding the points farthest from each path edge. The difference is that function simplifyRDP exhaustively searches the single, most distant point in each iteration, while function simplifyRDPm stops at the first point exceeding the distance tolerance.
Functions simplifyVW and simplifyVWm are based on the original, respectively modified Visvalingam-Whyatt (VW) method using the area of the triangle formed by three neigboring points. The original simplifyVW method removes only a single point per iteration, while the modified simplifyVWm removes all points with areas not exceeding the tolerance in each iteration.
Functions simplify2, simplifyRDP and simplifyRDPm provide keyword shortest to select the computation of the distance between a point and a path edge. If True, use the shortest distance to the path edge or path end points, False use the perpendicular distance to the extended path edge line.
For all functions, keyword adjust scales the longitudinal distance between two points by the cosine of the mean of the latitudes.
See:
Tested with 64-bit Python 2.6.9, 2.7.13, 3.5.3 and 3.6.0 on macOS 10.12.3, 10.12.4 and 10.12.5 Sierra.
Version: 17.06.04
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Function Details |
Basic simplification of a path of LatLon points. Eliminates any points closer together than the given distance tolerance.
|
Pipe simplification of a path of LatLon points. Eliminates any points too close together or within the given pipe tolerance along an edge.
|
Ramer-Douglas-Peucker (RDP) simplification of a path of LatLon points. Eliminates any points too close together or closer to an edge than the given distance tolerance. This RDP method exhaustively searches for the point with the largest distance, resulting in worst-case complexity O(n**2) where n is the number of points.
|
Modified Ramer-Douglas-Peucker (RDP) simplification of a path of LatLon points. Eliminates any points too close together or closer to an edge than the given distance tolerance. This RDP method stops at the first point farther than the given distance tolerance, significantly reducing the run time (but producing results different from the original RDP method).
|
Visvalingam-Whyatt (VW) simplification of a path of LatLon points. Eliminates any points too close together or with a triangular area not exceeding the given area tolerance (squared). This VW method exhaustively searches for the single point with the smallest triangular area, resulting in worst-case complexity O(n**2) where n is the number of points.
|
Modified Visvalingam-Whyatt (VW) simplification of a path of LatLon points. Eliminates any points too close together or with a triangular area not exceeding the given area tolerance (squared). This VW method removes all points with a triangular area below the tolerance per iteration, significantly reducing the run time (but producing results different from the original VW method).
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jun 27 17:08:33 2017 | http://epydoc.sourceforge.net |