The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Title: The Ramer-Douglas-Peucker Algorithm
Version: 0.3.0
Description: Pretty fast implementation of the Ramer-Douglas-Peucker algorithm for reducing the number of points on a 2D curve. Urs Ramer (1972), "An iterative procedure for the polygonal approximation of plane curves" <doi:10.1016/S0146-664X(72)80017-0>. David H. Douglas and Thomas K. Peucker (1973), "Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or its Caricature" <doi:10.3138/FM57-6770-U75U-7727>.
License: GPL-3
URL: https://github.com/robertdj/RDP
Encoding: UTF-8
RoxygenNote: 7.2.1
LinkingTo: Rcpp
Imports: Rcpp
Suggests: testthat, withr, zeallot
NeedsCompilation: yes
Packaged: 2023-07-05 21:57:55 UTC; robert
Author: Robert Dahl Jacobsen [aut, cre]
Maintainer: Robert Dahl Jacobsen <cran@dahl-jacobsen.dk>
Repository: CRAN
Date/Publication: 2023-07-05 22:13:04 UTC

RDP package

Description

Implementation of the Ramer-Douglas-Peucker algorithm.

Author(s)

Maintainer: Robert Dahl Jacobsen cran@dahl-jacobsen.dk

References

Urs Ramer (1972), "An iterative procedure for the polygonal approximation of plane curves". Computer Graphics and Image Processing 1, 244–256. doi:10.1016/S0146-664X(72)80017-0.

David H. Douglas and Thomas K. Peucker (1973), "Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or its Caricature". Cartographica 10, 112–122. doi:10.3138/FM57-6770-U75U-7727.

See Also

Useful links:


Simplify a curve using the Ramer-Douglas-Peucker algorithm.

Description

Implements the Ramer-Douglas-Peucker algorithm for reducing the number of points on a curve.

Usage

RamerDouglasPeucker(x, y, epsilon, keep_index = FALSE)

Arguments

x

⁠[numeric]⁠ The x values of the curve as a vector without NA values.

y

⁠[numeric]⁠ The y values of the curve as a vector without NA values.

epsilon

⁠[positive numeric(1)]⁠ The threshold for filtering outliers from the simplified curve.

keep_index

⁠[logical]⁠ If TRUE, returns a column called index with the index locations of points that are kept.

Details

If there are no more than two points it does not make sense to simplify. In this case the input is returned without further checks of x and y. In particular, the input is not checked for NA values.

Value

A data.frame with x and y values of the simplified curve.

Examples

RDP::RamerDouglasPeucker(x = c(0, 1, 3, 5), y = c(2, 1, 0, 1), epsilon = 0.5)
RDP::RamerDouglasPeucker(x = c(0, 1, 3, 5), y = c(2, 1, 0, 1), epsilon = 0.5, keep_index = TRUE)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.