]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp
bump version to 18.2.4-pve3
[ceph.git] / ceph / src / boost / boost / geometry / strategies / agnostic / simplify_douglas_peucker.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 1995, 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 1995 Maarten Hilferink, Amsterdam, the Netherlands
5
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
10
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
13
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)
17
18 #ifndef BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP
19 #define BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP
20
21
22 #include <boost/geometry/strategies/distance.hpp>
23
24
25 namespace boost { namespace geometry
26 {
27
28 namespace strategy { namespace simplify
29 {
30
31
32 // NOTE: Left here for backward compatibility.
33
34
35 /*!
36 \brief Implements the simplify algorithm.
37 \ingroup strategies
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
43 can be specified
44 \author Barend and Maarten, 1995/1996
45 \author Barend, revised for Generic Geometry Library, 2008
46 */
47
48 /*
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
52 */
53 template
54 <
55 typename Point,
56 typename PointDistanceStrategy
57 >
58 class douglas_peucker
59 {
60 public :
61
62 typedef PointDistanceStrategy distance_strategy_type;
63
64 typedef typename strategy::distance::services::return_type
65 <
66 distance_strategy_type,
67 Point, Point
68 >::type distance_type;
69
70 template <typename Range, typename OutputIterator>
71 static inline OutputIterator apply(Range const& ,
72 OutputIterator out,
73 distance_type const& )
74 {
75 return out;
76 }
77 };
78
79 }} // namespace strategy::simplify
80
81
82 }} // namespace boost::geometry
83
84 #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP