simplify.hpp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2018-2020.
  6. // Modifications copyright (c) 2018-2020 Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  10. // Use, modification and distribution is subject to the Boost Software License,
  11. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. #ifndef BOOST_GEOMETRY_ALGORITHMS_SIMPLIFY_HPP
  14. #define BOOST_GEOMETRY_ALGORITHMS_SIMPLIFY_HPP
  15. #include <cstddef>
  16. #include <set>
  17. #include <boost/core/ignore_unused.hpp>
  18. #include <boost/range/begin.hpp>
  19. #include <boost/range/end.hpp>
  20. #include <boost/range/size.hpp>
  21. #include <boost/range/value_type.hpp>
  22. #include <boost/variant/apply_visitor.hpp>
  23. #include <boost/variant/static_visitor.hpp>
  24. #include <boost/variant/variant_fwd.hpp>
  25. #include <boost/geometry/core/cs.hpp>
  26. #include <boost/geometry/core/closure.hpp>
  27. #include <boost/geometry/core/exterior_ring.hpp>
  28. #include <boost/geometry/core/interior_rings.hpp>
  29. #include <boost/geometry/core/mutable_range.hpp>
  30. #include <boost/geometry/core/tags.hpp>
  31. #include <boost/geometry/geometries/concepts/check.hpp>
  32. #include <boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp>
  33. #include <boost/geometry/strategies/concepts/simplify_concept.hpp>
  34. #include <boost/geometry/strategies/default_strategy.hpp>
  35. #include <boost/geometry/strategies/distance.hpp>
  36. #include <boost/geometry/algorithms/area.hpp>
  37. #include <boost/geometry/algorithms/clear.hpp>
  38. #include <boost/geometry/algorithms/convert.hpp>
  39. #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
  40. #include <boost/geometry/algorithms/not_implemented.hpp>
  41. #include <boost/geometry/algorithms/is_empty.hpp>
  42. #include <boost/geometry/algorithms/perimeter.hpp>
  43. #include <boost/geometry/algorithms/detail/distance/default_strategies.hpp>
  44. namespace boost { namespace geometry
  45. {
  46. #ifndef DOXYGEN_NO_DETAIL
  47. namespace detail { namespace simplify
  48. {
  49. template <typename Range, typename EqualsStrategy>
  50. inline bool is_degenerate(Range const& range, EqualsStrategy const& strategy)
  51. {
  52. return boost::size(range) == 2
  53. && detail::equals::equals_point_point(geometry::range::front(range),
  54. geometry::range::back(range),
  55. strategy);
  56. }
  57. struct simplify_range_insert
  58. {
  59. template<typename Range, typename Strategy, typename OutputIterator, typename Distance>
  60. static inline void apply(Range const& range, OutputIterator out,
  61. Distance const& max_distance, Strategy const& strategy)
  62. {
  63. typedef typename Strategy::distance_strategy_type::equals_point_point_strategy_type
  64. equals_strategy_type;
  65. boost::ignore_unused(strategy);
  66. if (is_degenerate(range, equals_strategy_type()))
  67. {
  68. std::copy(boost::begin(range), boost::begin(range) + 1, out);
  69. }
  70. else if (boost::size(range) <= 2 || max_distance < 0)
  71. {
  72. std::copy(boost::begin(range), boost::end(range), out);
  73. }
  74. else
  75. {
  76. strategy.apply(range, out, max_distance);
  77. }
  78. }
  79. };
  80. struct simplify_copy
  81. {
  82. template <typename RangeIn, typename RangeOut, typename Strategy, typename Distance>
  83. static inline void apply(RangeIn const& range, RangeOut& out,
  84. Distance const& , Strategy const& )
  85. {
  86. std::copy
  87. (
  88. boost::begin(range), boost::end(range),
  89. geometry::range::back_inserter(out)
  90. );
  91. }
  92. };
  93. template <std::size_t MinimumToUseStrategy>
  94. struct simplify_range
  95. {
  96. template <typename RangeIn, typename RangeOut, typename Strategy, typename Distance>
  97. static inline void apply(RangeIn const& range, RangeOut& out,
  98. Distance const& max_distance, Strategy const& strategy)
  99. {
  100. typedef typename Strategy::distance_strategy_type::equals_point_point_strategy_type
  101. equals_strategy_type;
  102. // For a RING:
  103. // Note that, especially if max_distance is too large,
  104. // the output ring might be self intersecting while the input ring is
  105. // not, although chances are low in normal polygons
  106. if (boost::size(range) <= MinimumToUseStrategy || max_distance < 0)
  107. {
  108. simplify_copy::apply(range, out, max_distance, strategy);
  109. }
  110. else
  111. {
  112. simplify_range_insert::apply
  113. (
  114. range, geometry::range::back_inserter(out), max_distance, strategy
  115. );
  116. }
  117. // Verify the two remaining points are equal. If so, remove one of them.
  118. // This can cause the output being under the minimum size
  119. if (is_degenerate(out, equals_strategy_type()))
  120. {
  121. range::resize(out, 1);
  122. }
  123. }
  124. };
  125. struct simplify_ring
  126. {
  127. private :
  128. template <typename Area>
  129. static inline int area_sign(Area const& area)
  130. {
  131. return area > 0 ? 1 : area < 0 ? -1 : 0;
  132. }
  133. template <typename Strategy, typename Ring>
  134. static std::size_t get_opposite(std::size_t index, Ring const& ring)
  135. {
  136. typename Strategy::distance_strategy_type distance_strategy;
  137. // Verify if it is NOT the case that all points are less than the
  138. // simplifying distance. If so, output is empty.
  139. typename Strategy::distance_type max_distance(-1);
  140. typename geometry::point_type<Ring>::type point = range::at(ring, index);
  141. std::size_t i = 0;
  142. for (typename boost::range_iterator<Ring const>::type
  143. it = boost::begin(ring); it != boost::end(ring); ++it, ++i)
  144. {
  145. // This actually is point-segment distance but will result
  146. // in point-point distance
  147. typename Strategy::distance_type dist = distance_strategy.apply(*it, point, point);
  148. if (dist > max_distance)
  149. {
  150. max_distance = dist;
  151. index = i;
  152. }
  153. }
  154. return index;
  155. }
  156. public :
  157. template <typename Ring, typename Strategy, typename Distance>
  158. static inline void apply(Ring const& ring, Ring& out,
  159. Distance const& max_distance, Strategy const& strategy)
  160. {
  161. std::size_t const size = boost::size(ring);
  162. if (size == 0)
  163. {
  164. return;
  165. }
  166. int const input_sign = area_sign(geometry::area(ring));
  167. std::set<std::size_t> visited_indexes;
  168. // Rotate it into a copied vector
  169. // (vector, because source type might not support rotation)
  170. // (duplicate end point will be simplified away)
  171. typedef typename geometry::point_type<Ring>::type point_type;
  172. std::vector<point_type> rotated(size);
  173. // Closing point (but it will not start here)
  174. std::size_t index = 0;
  175. // Iterate (usually one iteration is enough)
  176. for (std::size_t iteration = 0; iteration < 4u; iteration++)
  177. {
  178. // Always take the opposite. Opposite guarantees that no point
  179. // "halfway" is chosen, creating an artefact (very narrow triangle)
  180. // Iteration 0: opposite to closing point (1/2, = on convex hull)
  181. // (this will start simplification with that point
  182. // and its opposite ~0)
  183. // Iteration 1: move a quarter on that ring, then opposite to 1/4
  184. // (with its opposite 3/4)
  185. // Iteration 2: move an eight on that ring, then opposite (1/8)
  186. // Iteration 3: again move a quarter, then opposite (7/8)
  187. // So finally 8 "sides" of the ring have been examined (if it were
  188. // a semi-circle). Most probably, there are only 0 or 1 iterations.
  189. switch (iteration)
  190. {
  191. case 1 : index = (index + size / 4) % size; break;
  192. case 2 : index = (index + size / 8) % size; break;
  193. case 3 : index = (index + size / 4) % size; break;
  194. }
  195. index = get_opposite<Strategy>(index, ring);
  196. if (visited_indexes.count(index) > 0)
  197. {
  198. // Avoid trying the same starting point more than once
  199. continue;
  200. }
  201. std::rotate_copy(boost::begin(ring), range::pos(ring, index),
  202. boost::end(ring), rotated.begin());
  203. // Close the rotated copy
  204. rotated.push_back(range::at(ring, index));
  205. simplify_range<0>::apply(rotated, out, max_distance, strategy);
  206. // Verify that what was positive, stays positive (or goes to 0)
  207. // and what was negative stays negative (or goes to 0)
  208. int const output_sign = area_sign(geometry::area(out));
  209. if (output_sign == input_sign)
  210. {
  211. // Result is considered as satisfactory (usually this is the
  212. // first iteration - only for small rings, having a scale
  213. // similar to simplify_distance, next iterations are tried
  214. return;
  215. }
  216. // Original is simplified away. Possibly there is a solution
  217. // when another starting point is used
  218. geometry::clear(out);
  219. if (iteration == 0
  220. && geometry::perimeter(ring) < 3 * max_distance)
  221. {
  222. // Check if it is useful to iterate. A minimal triangle has a
  223. // perimeter of a bit more than 3 times the simplify distance
  224. return;
  225. }
  226. // Prepare next try
  227. visited_indexes.insert(index);
  228. rotated.resize(size);
  229. }
  230. }
  231. };
  232. struct simplify_polygon
  233. {
  234. private:
  235. template
  236. <
  237. typename IteratorIn,
  238. typename InteriorRingsOut,
  239. typename Distance,
  240. typename Strategy
  241. >
  242. static inline void iterate(IteratorIn begin, IteratorIn end,
  243. InteriorRingsOut& interior_rings_out,
  244. Distance const& max_distance, Strategy const& strategy)
  245. {
  246. typedef typename boost::range_value<InteriorRingsOut>::type single_type;
  247. for (IteratorIn it = begin; it != end; ++it)
  248. {
  249. single_type out;
  250. simplify_ring::apply(*it, out, max_distance, strategy);
  251. if (! geometry::is_empty(out))
  252. {
  253. range::push_back(interior_rings_out, out);
  254. }
  255. }
  256. }
  257. template
  258. <
  259. typename InteriorRingsIn,
  260. typename InteriorRingsOut,
  261. typename Distance,
  262. typename Strategy
  263. >
  264. static inline void apply_interior_rings(
  265. InteriorRingsIn const& interior_rings_in,
  266. InteriorRingsOut& interior_rings_out,
  267. Distance const& max_distance, Strategy const& strategy)
  268. {
  269. range::clear(interior_rings_out);
  270. iterate(
  271. boost::begin(interior_rings_in), boost::end(interior_rings_in),
  272. interior_rings_out,
  273. max_distance, strategy);
  274. }
  275. public:
  276. template <typename Polygon, typename Strategy, typename Distance>
  277. static inline void apply(Polygon const& poly_in, Polygon& poly_out,
  278. Distance const& max_distance, Strategy const& strategy)
  279. {
  280. // Note that if there are inner rings, and distance is too large,
  281. // they might intersect with the outer ring in the output,
  282. // while it didn't in the input.
  283. simplify_ring::apply(exterior_ring(poly_in), exterior_ring(poly_out),
  284. max_distance, strategy);
  285. apply_interior_rings(interior_rings(poly_in),
  286. interior_rings(poly_out), max_distance, strategy);
  287. }
  288. };
  289. template<typename Policy>
  290. struct simplify_multi
  291. {
  292. template <typename MultiGeometry, typename Strategy, typename Distance>
  293. static inline void apply(MultiGeometry const& multi, MultiGeometry& out,
  294. Distance const& max_distance, Strategy const& strategy)
  295. {
  296. range::clear(out);
  297. typedef typename boost::range_value<MultiGeometry>::type single_type;
  298. for (typename boost::range_iterator<MultiGeometry const>::type
  299. it = boost::begin(multi); it != boost::end(multi); ++it)
  300. {
  301. single_type single_out;
  302. Policy::apply(*it, single_out, max_distance, strategy);
  303. if (! geometry::is_empty(single_out))
  304. {
  305. range::push_back(out, single_out);
  306. }
  307. }
  308. }
  309. };
  310. }} // namespace detail::simplify
  311. #endif // DOXYGEN_NO_DETAIL
  312. #ifndef DOXYGEN_NO_DISPATCH
  313. namespace dispatch
  314. {
  315. template
  316. <
  317. typename Geometry,
  318. typename Tag = typename tag<Geometry>::type
  319. >
  320. struct simplify: not_implemented<Tag>
  321. {};
  322. template <typename Point>
  323. struct simplify<Point, point_tag>
  324. {
  325. template <typename Distance, typename Strategy>
  326. static inline void apply(Point const& point, Point& out,
  327. Distance const& , Strategy const& )
  328. {
  329. geometry::convert(point, out);
  330. }
  331. };
  332. // Linestring, keep 2 points (unless those points are the same)
  333. template <typename Linestring>
  334. struct simplify<Linestring, linestring_tag>
  335. : detail::simplify::simplify_range<2>
  336. {};
  337. template <typename Ring>
  338. struct simplify<Ring, ring_tag>
  339. : detail::simplify::simplify_ring
  340. {};
  341. template <typename Polygon>
  342. struct simplify<Polygon, polygon_tag>
  343. : detail::simplify::simplify_polygon
  344. {};
  345. template
  346. <
  347. typename Geometry,
  348. typename Tag = typename tag<Geometry>::type
  349. >
  350. struct simplify_insert: not_implemented<Tag>
  351. {};
  352. template <typename Linestring>
  353. struct simplify_insert<Linestring, linestring_tag>
  354. : detail::simplify::simplify_range_insert
  355. {};
  356. template <typename Ring>
  357. struct simplify_insert<Ring, ring_tag>
  358. : detail::simplify::simplify_range_insert
  359. {};
  360. template <typename MultiPoint>
  361. struct simplify<MultiPoint, multi_point_tag>
  362. : detail::simplify::simplify_copy
  363. {};
  364. template <typename MultiLinestring>
  365. struct simplify<MultiLinestring, multi_linestring_tag>
  366. : detail::simplify::simplify_multi<detail::simplify::simplify_range<2> >
  367. {};
  368. template <typename MultiPolygon>
  369. struct simplify<MultiPolygon, multi_polygon_tag>
  370. : detail::simplify::simplify_multi<detail::simplify::simplify_polygon>
  371. {};
  372. } // namespace dispatch
  373. #endif // DOXYGEN_NO_DISPATCH
  374. namespace resolve_strategy
  375. {
  376. struct simplify
  377. {
  378. template <typename Geometry, typename Distance, typename Strategy>
  379. static inline void apply(Geometry const& geometry,
  380. Geometry& out,
  381. Distance const& max_distance,
  382. Strategy const& strategy)
  383. {
  384. dispatch::simplify<Geometry>::apply(geometry, out, max_distance, strategy);
  385. }
  386. template <typename Geometry, typename Distance>
  387. static inline void apply(Geometry const& geometry,
  388. Geometry& out,
  389. Distance const& max_distance,
  390. default_strategy)
  391. {
  392. typedef typename point_type<Geometry>::type point_type;
  393. typedef typename strategy::distance::services::default_strategy
  394. <
  395. point_tag, segment_tag, point_type
  396. >::type ds_strategy_type;
  397. typedef strategy::simplify::douglas_peucker
  398. <
  399. point_type, ds_strategy_type
  400. > strategy_type;
  401. BOOST_CONCEPT_ASSERT(
  402. (concepts::SimplifyStrategy<strategy_type, point_type>)
  403. );
  404. apply(geometry, out, max_distance, strategy_type());
  405. }
  406. };
  407. struct simplify_insert
  408. {
  409. template
  410. <
  411. typename Geometry,
  412. typename OutputIterator,
  413. typename Distance,
  414. typename Strategy
  415. >
  416. static inline void apply(Geometry const& geometry,
  417. OutputIterator& out,
  418. Distance const& max_distance,
  419. Strategy const& strategy)
  420. {
  421. dispatch::simplify_insert<Geometry>::apply(geometry, out, max_distance, strategy);
  422. }
  423. template <typename Geometry, typename OutputIterator, typename Distance>
  424. static inline void apply(Geometry const& geometry,
  425. OutputIterator& out,
  426. Distance const& max_distance,
  427. default_strategy)
  428. {
  429. typedef typename point_type<Geometry>::type point_type;
  430. typedef typename strategy::distance::services::default_strategy
  431. <
  432. point_tag, segment_tag, point_type
  433. >::type ds_strategy_type;
  434. typedef strategy::simplify::douglas_peucker
  435. <
  436. point_type, ds_strategy_type
  437. > strategy_type;
  438. BOOST_CONCEPT_ASSERT(
  439. (concepts::SimplifyStrategy<strategy_type, point_type>)
  440. );
  441. apply(geometry, out, max_distance, strategy_type());
  442. }
  443. };
  444. } // namespace resolve_strategy
  445. namespace resolve_variant {
  446. template <typename Geometry>
  447. struct simplify
  448. {
  449. template <typename Distance, typename Strategy>
  450. static inline void apply(Geometry const& geometry,
  451. Geometry& out,
  452. Distance const& max_distance,
  453. Strategy const& strategy)
  454. {
  455. resolve_strategy::simplify::apply(geometry, out, max_distance, strategy);
  456. }
  457. };
  458. template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
  459. struct simplify<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
  460. {
  461. template <typename Distance, typename Strategy>
  462. struct visitor: boost::static_visitor<void>
  463. {
  464. Distance const& m_max_distance;
  465. Strategy const& m_strategy;
  466. visitor(Distance const& max_distance, Strategy const& strategy)
  467. : m_max_distance(max_distance)
  468. , m_strategy(strategy)
  469. {}
  470. template <typename Geometry>
  471. void operator()(Geometry const& geometry, Geometry& out) const
  472. {
  473. simplify<Geometry>::apply(geometry, out, m_max_distance, m_strategy);
  474. }
  475. };
  476. template <typename Distance, typename Strategy>
  477. static inline void
  478. apply(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry,
  479. boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>& out,
  480. Distance const& max_distance,
  481. Strategy const& strategy)
  482. {
  483. boost::apply_visitor(
  484. visitor<Distance, Strategy>(max_distance, strategy),
  485. geometry,
  486. out
  487. );
  488. }
  489. };
  490. } // namespace resolve_variant
  491. /*!
  492. \brief Simplify a geometry using a specified strategy
  493. \ingroup simplify
  494. \tparam Geometry \tparam_geometry
  495. \tparam Distance A numerical distance measure
  496. \tparam Strategy A type fulfilling a SimplifyStrategy concept
  497. \param strategy A strategy to calculate simplification
  498. \param geometry input geometry, to be simplified
  499. \param out output geometry, simplified version of the input geometry
  500. \param max_distance distance (in units of input coordinates) of a vertex
  501. to other segments to be removed
  502. \param strategy simplify strategy to be used for simplification, might
  503. include point-distance strategy
  504. \image html svg_simplify_country.png "The image below presents the simplified country"
  505. \qbk{distinguish,with strategy}
  506. */
  507. template<typename Geometry, typename Distance, typename Strategy>
  508. inline void simplify(Geometry const& geometry, Geometry& out,
  509. Distance const& max_distance, Strategy const& strategy)
  510. {
  511. concepts::check<Geometry>();
  512. geometry::clear(out);
  513. resolve_variant::simplify<Geometry>::apply(geometry, out, max_distance, strategy);
  514. }
  515. /*!
  516. \brief Simplify a geometry
  517. \ingroup simplify
  518. \tparam Geometry \tparam_geometry
  519. \tparam Distance \tparam_numeric
  520. \note This version of simplify simplifies a geometry using the default
  521. strategy (Douglas Peucker),
  522. \param geometry input geometry, to be simplified
  523. \param out output geometry, simplified version of the input geometry
  524. \param max_distance distance (in units of input coordinates) of a vertex
  525. to other segments to be removed
  526. \qbk{[include reference/algorithms/simplify.qbk]}
  527. */
  528. template<typename Geometry, typename Distance>
  529. inline void simplify(Geometry const& geometry, Geometry& out,
  530. Distance const& max_distance)
  531. {
  532. concepts::check<Geometry>();
  533. geometry::simplify(geometry, out, max_distance, default_strategy());
  534. }
  535. #ifndef DOXYGEN_NO_DETAIL
  536. namespace detail { namespace simplify
  537. {
  538. /*!
  539. \brief Simplify a geometry, using an output iterator
  540. and a specified strategy
  541. \ingroup simplify
  542. \tparam Geometry \tparam_geometry
  543. \param geometry input geometry, to be simplified
  544. \param out output iterator, outputs all simplified points
  545. \param max_distance distance (in units of input coordinates) of a vertex
  546. to other segments to be removed
  547. \param strategy simplify strategy to be used for simplification,
  548. might include point-distance strategy
  549. \qbk{distinguish,with strategy}
  550. \qbk{[include reference/algorithms/simplify.qbk]}
  551. */
  552. template<typename Geometry, typename OutputIterator, typename Distance, typename Strategy>
  553. inline void simplify_insert(Geometry const& geometry, OutputIterator out,
  554. Distance const& max_distance, Strategy const& strategy)
  555. {
  556. concepts::check<Geometry const>();
  557. resolve_strategy::simplify_insert::apply(geometry, out, max_distance, strategy);
  558. }
  559. /*!
  560. \brief Simplify a geometry, using an output iterator
  561. \ingroup simplify
  562. \tparam Geometry \tparam_geometry
  563. \param geometry input geometry, to be simplified
  564. \param out output iterator, outputs all simplified points
  565. \param max_distance distance (in units of input coordinates) of a vertex
  566. to other segments to be removed
  567. \qbk{[include reference/algorithms/simplify_insert.qbk]}
  568. */
  569. template<typename Geometry, typename OutputIterator, typename Distance>
  570. inline void simplify_insert(Geometry const& geometry, OutputIterator out,
  571. Distance const& max_distance)
  572. {
  573. // Concept: output point type = point type of input geometry
  574. concepts::check<Geometry const>();
  575. concepts::check<typename point_type<Geometry>::type>();
  576. simplify_insert(geometry, out, max_distance, default_strategy());
  577. }
  578. }} // namespace detail::simplify
  579. #endif // DOXYGEN_NO_DETAIL
  580. }} // namespace boost::geometry
  581. #endif // BOOST_GEOMETRY_ALGORITHMS_SIMPLIFY_HPP