1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 1995, 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 1995 Maarten Hilferink, Amsterdam, the Netherlands
6 // This file was modified by Oracle on 2015-2021.
7 // Modifications copyright (c) 2015-2021, Oracle and/or its affiliates.
8 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
14 // Use, modification and distribution is subject to the Boost Software License,
15 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP
19 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP
22 #include <boost/geometry/strategies/distance.hpp>
25 namespace boost { namespace geometry
28 namespace strategy { namespace simplify
32 // NOTE: Left here for backward compatibility.
36 \brief Implements the simplify algorithm.
38 \details The douglas_peucker strategy simplifies a linestring, ring or
39 vector of points using the well-known Douglas-Peucker algorithm.
40 \tparam Point the point type
41 \tparam PointDistanceStrategy point-segment distance strategy to be used
42 \note This strategy uses itself a point-segment-distance strategy which
44 \author Barend and Maarten, 1995/1996
45 \author Barend, revised for Generic Geometry Library, 2008
49 For the algorithm, see for example:
50 - http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
51 - http://www2.dcs.hull.ac.uk/CISRG/projects/Royal-Inst/demos/dp.html
56 typename PointDistanceStrategy
62 typedef PointDistanceStrategy distance_strategy_type;
64 typedef typename strategy::distance::services::return_type
66 distance_strategy_type,
68 >::type distance_type;
70 template <typename Range, typename OutputIterator>
71 static inline OutputIterator apply(Range const& ,
73 distance_type const& )
79 }} // namespace strategy::simplify
82 }} // namespace boost::geometry
84 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP