Skip to content

Commit

Permalink
Note that an epsilon <= 0 returns an unaltered copy of the input
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed Nov 13, 2020
1 parent e2465c7 commit 59ebadf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions geo/src/algorithm/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ where
/// rings. This may result in invalid Polygons, and has no guarantee of preserving topology.
///
/// Multi* objects are simplified by simplifing all their constituent geometries individually.
///
/// An epsilon less than or equal to zero will return an unaltered version of the geometry.
pub trait Simplify<T, Epsilon = T> {
/// Returns the simplified representation of a geometry, using the [Ramer–Douglas–Peucker](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) algorithm
///
Expand Down Expand Up @@ -128,6 +130,8 @@ pub trait Simplify<T, Epsilon = T> {
///
/// This operation uses the [Ramer–Douglas–Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm)
/// and does not guarantee that the returned geometry is valid.
///
/// An epsilon less than or equal to zero will return an unaltered version of the geometry.
pub trait SimplifyIdx<T, Epsilon = T> {
/// Returns the simplified indices of a geometry, using the [Ramer–Douglas–Peucker](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) algorithm
///
Expand Down
6 changes: 6 additions & 0 deletions geo/src/algorithm/simplifyvw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ where
/// Polygons are simplified by running the algorithm on all their constituent rings. This may
/// result in invalid Polygons, and has no guarantee of preserving topology. Multi* objects are
/// simplified by simplifying all their constituent geometries individually.
///
/// An epsilon less than or equal to zero will return an unaltered version of the geometry.
pub trait SimplifyVW<T, Epsilon = T> {
/// Returns the simplified representation of a geometry, using the [Visvalingam-Whyatt](http://www.tandfonline.com/doi/abs/10.1179/000870493786962263) algorithm
///
Expand Down Expand Up @@ -467,6 +469,8 @@ pub trait SimplifyVW<T, Epsilon = T> {
///
/// This operation uses the Visvalingam-Whyatt algorithm,
/// and does **not** guarantee that the returned geometry is valid.
///
/// An epsilon less than or equal to zero will return an unaltered version of the geometry.
pub trait SimplifyVwIdx<T, Epsilon = T> {
/// Returns the simplified representation of a geometry, using the [Visvalingam-Whyatt](http://www.tandfonline.com/doi/abs/10.1179/000870493786962263) algorithm
///
Expand Down Expand Up @@ -502,6 +506,8 @@ pub trait SimplifyVwIdx<T, Epsilon = T> {
}

/// Simplifies a geometry, preserving its topology by removing self-intersections
///
/// An epsilon less than or equal to zero will return an unaltered version of the geometry.
pub trait SimplifyVWPreserve<T, Epsilon = T> {
/// Returns the simplified representation of a geometry, using a topology-preserving variant of the
/// [Visvalingam-Whyatt](http://www.tandfonline.com/doi/abs/10.1179/000870493786962263) algorithm.
Expand Down

0 comments on commit 59ebadf

Please sign in to comment.