/Src/Dependencies/Boost/libs/geometry/test/multi/algorithms/multi_simplify.cpp

http://hadesmem.googlecode.com/ · C++ · 58 lines · 38 code · 14 blank · 6 comment · 0 complexity · f65674d7866eea07f8c556a88b24748c MD5 · raw file

  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. //
  3. // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <geometry_test_common.hpp>
  8. #include <boost/geometry/multi/algorithms/simplify.hpp>
  9. #include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
  10. #include <boost/geometry/geometries/box.hpp>
  11. #include <boost/geometry/geometries/ring.hpp>
  12. #include <boost/geometry/geometries/linestring.hpp>
  13. #include <boost/geometry/geometries/point.hpp>
  14. #include <boost/geometry/geometries/polygon.hpp>
  15. #include <boost/geometry/geometries/point_xy.hpp>
  16. #include <boost/geometry/multi/geometries/multi_point.hpp>
  17. #include <boost/geometry/multi/geometries/multi_linestring.hpp>
  18. #include <boost/geometry/multi/geometries/multi_polygon.hpp>
  19. #include <algorithms/test_simplify.hpp>
  20. template <typename P>
  21. void test_all()
  22. {
  23. test_geometry<bg::model::multi_point<P> >(
  24. "MULTIPOINT((0 0),(1 1))",
  25. "MULTIPOINT((0 0),(1 1))", 1.0);
  26. test_geometry<bg::model::multi_linestring<bg::model::linestring<P> > >(
  27. "MULTILINESTRING((0 0,5 5,10 10))",
  28. "MULTILINESTRING((0 0,10 10))", 1.0);
  29. typedef bg::model::multi_polygon<bg::model::polygon<P> > mp;
  30. test_geometry<mp>(
  31. "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))",
  32. "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0)))", 1.0);
  33. test_geometry<mp>(
  34. "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3)))",
  35. "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0),(7 3,7 6,1 6,1 3,7 3)))", 1.0);
  36. }
  37. int test_main( int , char* [] )
  38. {
  39. test_all<bg::model::d2::point_xy<double> >();
  40. #ifdef HAVE_TTMATH
  41. test_all<bg::model::d2::point_xy<ttmath_big> >();
  42. #endif
  43. return 0;
  44. }