From e4f47a7a2570a023474bb762a8d876ec9f19669b Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 28 Nov 2010 13:28:09 +0000 Subject: [PATCH] Major update: Adaptions to test with respect to new namespace model Removed GMP/CLN and, where it was present, replaced by TTMATH Small fix in comparable_distance test All testfiles use bg as alias now [SVN r66811] --- test/algorithms/append.cpp | 23 +- test/algorithms/area.cpp | 60 +++-- test/algorithms/assign.cpp | 135 ++++++----- test/algorithms/buffer.cpp | 16 +- test/algorithms/centroid.cpp | 34 ++- test/algorithms/combine.cpp | 39 ++-- test/algorithms/comparable_distance.cpp | 17 +- test/algorithms/convert.cpp | 69 +++--- test/algorithms/convex_hull.cpp | 27 +-- test/algorithms/correct.cpp | 62 +++-- .../detail/sections/sectionalize.cpp | 21 +- test/algorithms/difference.cpp | 10 +- test/algorithms/disjoint.cpp | 21 +- test/algorithms/dissolve.cpp | 102 ++++----- test/algorithms/distance.cpp | 41 ++-- test/algorithms/envelope.cpp | 19 +- test/algorithms/equals.cpp | 21 +- test/algorithms/for_each.cpp | 8 +- test/algorithms/intersection.cpp | 47 ++-- test/algorithms/intersection_segment.cpp | 76 +++---- test/algorithms/intersects.cpp | 13 +- test/algorithms/is_convex.cpp | 39 ++-- test/algorithms/length.cpp | 20 +- test/algorithms/make.cpp | 47 ++-- test/algorithms/overlaps.cpp | 29 ++- test/algorithms/overlay/assemble.cpp | 9 +- test/algorithms/overlay/ccw_traverse.cpp | 29 +-- test/algorithms/overlay/dissolver.cpp | 9 +- .../overlay/enrich_intersection_points.cpp | 16 +- test/algorithms/overlay/get_turn_info.cpp | 39 ++-- test/algorithms/overlay/get_turns.cpp | 43 ++-- test/algorithms/overlay/overlay_cases.hpp | 8 + test/algorithms/overlay/overlay_common.hpp | 14 +- test/algorithms/overlay/relative_order.cpp | 9 +- .../overlay/robustness/intersection_pies.cpp | 215 ++++++++++++------ .../overlay/robustness/intersection_stars.cpp | 40 ++-- .../robustness/random_ellipses_stars.cpp | 21 +- .../overlay/robustness/recursive_boxes.cpp | 19 +- .../overlay/robustness/test_overlay_p_q.hpp | 32 +-- .../overlay/self_intersection_points.cpp | 11 +- test/algorithms/overlay/split_rings.cpp | 35 ++- test/algorithms/overlay/traverse.cpp | 38 ++-- test/algorithms/overlay/traverse_gmp.cpp | 31 +-- test/algorithms/perimeter.cpp | 23 +- test/algorithms/reverse.cpp | 14 +- test/algorithms/simplify.cpp | 26 +-- test/algorithms/test_area.hpp | 22 +- test/algorithms/test_centroid.hpp | 37 ++- test/algorithms/test_combine.hpp | 12 +- test/algorithms/test_convex_hull.hpp | 46 ++-- test/algorithms/test_difference.hpp | 50 ++-- test/algorithms/test_dissolve.hpp | 47 ++-- test/algorithms/test_distance.hpp | 32 +-- test/algorithms/test_envelope.hpp | 36 +-- test/algorithms/test_equals.hpp | 6 +- test/algorithms/test_for_each.hpp | 56 ++--- test/algorithms/test_intersection.hpp | 42 ++-- test/algorithms/test_intersects.hpp | 10 +- test/algorithms/test_length.hpp | 10 +- test/algorithms/test_overlaps.hpp | 6 +- test/algorithms/test_perimeter.hpp | 10 +- test/algorithms/test_reverse.hpp | 6 +- test/algorithms/test_simplify.hpp | 32 +-- test/algorithms/test_union.hpp | 36 +-- test/algorithms/test_unique.hpp | 6 +- test/algorithms/test_within.hpp | 6 +- test/algorithms/transform.cpp | 70 +++--- test/algorithms/union.cpp | 26 +-- test/algorithms/unique.cpp | 16 +- test/algorithms/within.cpp | 19 +- test/arithmetic/arithmetic.cpp | 88 ++++--- test/arithmetic/cross_product.cpp | 49 ++-- test/arithmetic/dot_product.cpp | 14 +- test/compile_test.cpp | 102 ++++----- test/core/access.cpp | 62 ++--- test/core/coordinate_dimension.cpp | 22 +- test/core/coordinate_system.cpp | 70 +++--- test/core/coordinate_type.cpp | 24 +- test/core/geometry_id.cpp | 22 +- test/core/point_type.cpp | 22 +- test/core/radian_access.cpp | 36 +-- test/core/reverse_dispatch.cpp | 22 +- test/core/ring.cpp | 22 +- test/core/tag.cpp | 46 ++-- test/core/topological_dimension.cpp | 22 +- .../algorithms/buffer/linestring_buffer.cpp | 12 +- .../algorithms/buffer/polygon_buffer.cpp | 16 +- .../algorithms/buffer/test_buffer.hpp | 92 ++++---- test/extensions/algorithms/connect.cpp | 50 ++-- test/extensions/algorithms/midpoints.cpp | 12 +- test/extensions/algorithms/offset.cpp | 18 +- .../extensions/algorithms/remove_holes_if.cpp | 26 +-- test/extensions/algorithms/remove_spikes.cpp | 28 ++- test/extensions/algorithms/selected.cpp | 52 ++--- test/extensions/gis/io/wkb/read_wkb.cpp | 24 +- test/extensions/gis/io/wkt/multi_wkt.cpp | 10 +- test/extensions/gis/io/wkt/wkt.cpp | 85 +++---- test/extensions/gis/latlong/andoyer.cpp | 11 +- test/extensions/gis/latlong/area_ll.cpp | 71 +++--- .../extensions/gis/latlong/distance_mixed.cpp | 37 ++- test/extensions/gis/latlong/parse.cpp | 18 +- test/extensions/gis/latlong/parse_dms.cpp | 10 +- test/extensions/gis/latlong/point_ll.cpp | 30 +-- test/extensions/gis/latlong/vincenty.cpp | 11 +- .../extensions/gis/projections/projection.cpp | 24 +- .../gis/projections/projection_epsg.cpp | 30 +-- .../gis/projections/projections.cpp | 52 ++--- test/extensions/index/rtree.cpp | 6 +- test/extensions/nsphere/access.cpp | 20 +- test/extensions/nsphere/area.cpp | 10 +- test/extensions/nsphere/circle.cpp | 52 ++--- test/extensions/nsphere/multi_within.cpp | 12 +- test/extensions/nsphere/point_type.cpp | 22 +- test/extensions/nsphere/within.cpp | 15 +- test/geometries/adapted.cpp | 22 +- test/geometries/boost_array_as_point.cpp | 11 +- test/geometries/box.cpp | 49 ++-- test/geometries/concepts/check.cpp | 10 +- test/geometries/custom_linestring.cpp | 28 +-- test/geometries/segment.cpp | 34 +-- test/geometry_test_common.hpp | 6 + test/iterators/box_iterator.cpp | 12 +- test/iterators/circular_iterator.cpp | 18 +- test/iterators/closing_iterator.cpp | 16 +- test/iterators/ever_circling_iterator.cpp | 22 +- test/iterators/segment_range_iterator.cpp | 8 +- test/iterators/segment_returning_iterator.cpp | 14 +- test/multi/algorithms/multi_area.cpp | 4 +- test/multi/algorithms/multi_centroid.cpp | 20 +- test/multi/algorithms/multi_convex_hull.cpp | 12 +- test/multi/algorithms/multi_correct.cpp | 10 +- test/multi/algorithms/multi_dissolve.cpp | 7 +- test/multi/algorithms/multi_distance.cpp | 34 +-- test/multi/algorithms/multi_envelope.cpp | 14 +- test/multi/algorithms/multi_equals.cpp | 12 +- test/multi/algorithms/multi_for_each.cpp | 8 +- test/multi/algorithms/multi_intersection.cpp | 29 ++- test/multi/algorithms/multi_length.cpp | 4 +- test/multi/algorithms/multi_perimeter.cpp | 4 +- test/multi/algorithms/multi_reverse.cpp | 10 +- test/multi/algorithms/multi_simplify.cpp | 8 +- test/multi/algorithms/multi_union.cpp | 15 +- test/multi/algorithms/multi_unique.cpp | 10 +- test/multi/algorithms/multi_within.cpp | 13 +- .../overlay/multi_overlay_common.hpp | 4 +- .../algorithms/overlay/multi_svg_mapper.hpp | 8 +- .../algorithms/overlay/multi_traverse.cpp | 11 +- test/point_concept/concept_checker.cpp | 6 +- .../function_asserting_a_point.hpp | 8 +- .../function_requiring_a_point.hpp | 8 +- .../point_with_incorrect_dimension.cpp | 4 +- .../point_without_coordinate_type.cpp | 4 +- .../point_concept/point_without_dimension.cpp | 4 +- test/point_concept/point_without_getter.cpp | 4 +- test/point_concept/point_without_setter.cpp | 4 +- .../well_formed_point_traits.cpp | 4 +- test/policies/compare.cpp | 102 ++++----- test/ranges/box_range.cpp | 9 +- test/ranges/segment_range.cpp | 13 +- test/strategies/cross_track.cpp | 14 +- test/strategies/haversine.cpp | 22 +- test/strategies/projected_point.cpp | 38 ++-- test/strategies/pythagoras.cpp | 37 ++- test/strategies/segment_intersection.cpp | 38 ++-- .../segment_intersection_collinear.cpp | 5 +- test/strategies/side_by_cross_track.cpp | 10 +- test/strategies/transformer.cpp | 46 ++-- test/strategies/within.cpp | 19 +- test/test_common/test_point.hpp | 2 +- test/test_common/with_pointer.hpp | 2 +- test/test_geometries/custom_segment.hpp | 2 +- test/test_geometries/wrapped_boost_array.hpp | 2 +- test/util/as_range.cpp | 18 +- test/util/closeable_view.cpp | 25 +- test/util/copy.cpp | 16 +- test/util/for_each_coordinate.cpp | 13 +- test/util/reversible_closeable.cpp | 64 +++--- test/util/reversible_view.cpp | 22 +- test/util/select_most_precise.cpp | 2 +- test/util/write_dsv.cpp | 6 +- 180 files changed, 2391 insertions(+), 2464 deletions(-) diff --git a/test/algorithms/append.cpp b/test/algorithms/append.cpp index 318317ea7..ac93cd730 100644 --- a/test/algorithms/append.cpp +++ b/test/algorithms/append.cpp @@ -24,26 +24,27 @@ #include #include + template void test_geometry() { G geometry; - typedef typename boost::geometry::point_type::type P; + typedef typename bg::point_type::type P; - boost::geometry::append(geometry, boost::geometry::make_zero

()); - BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 1u); + bg::append(geometry, bg::make_zero

()); + BOOST_CHECK_EQUAL(bg::num_points(geometry), 1u); - boost::geometry::clear(geometry); - BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 0u); + bg::clear(geometry); + BOOST_CHECK_EQUAL(bg::num_points(geometry), 0u); //P p = boost::range::front(geometry); } template void test_all() { - test_geometry >(); - test_geometry >(); - test_geometry >(); + test_geometry >(); + test_geometry >(); + test_geometry >(); test_geometry >(); test_geometry >(); @@ -55,9 +56,9 @@ void test_all() int test_main(int, char* []) { test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/area.cpp b/test/algorithms/area.cpp index 91834e6eb..f4a1be22e 100644 --- a/test/algorithms/area.cpp +++ b/test/algorithms/area.cpp @@ -19,56 +19,55 @@ //#define GEOMETRY_TEST_DEBUG - - template void test_all() { - test_geometry >("POLYGON((0 0,2 2))", 4.0); - test_geometry >("POLYGON((2 2,0 0))", 4.0); + test_geometry >("POLYGON((0 0,2 2))", 4.0); + test_geometry >("POLYGON((2 2,0 0))", 4.0); // Rotated square, length=sqrt(2) -> area=2 - test_geometry >("POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0); + test_geometry >("POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0); // clockwise rings (second is wrongly ordered) - test_geometry >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); - test_geometry >("POLYGON((0 0,2 0,4 2,0 7,0 0))", -16.0); + test_geometry >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); + test_geometry >("POLYGON((0 0,2 0,4 2,0 7,0 0))", -16.0); - test_geometry >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); - test_geometry >("POLYGON((1 1,2 1,2 2,1 2,1 1))", -1.0); - test_geometry > + test_geometry >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); + test_geometry >("POLYGON((1 1,2 1,2 2,1 2,1 1))", -1.0); + test_geometry > ("POLYGON((0 0,0 7,4 2,2 0,0 0), (1 1,2 1,2 2,1 2,1 1))", 15.0); - test_geometry > + // ccw + test_geometry > ("POLYGON((0 0,0 7,4 2,2 0,0 0), (1 1,2 1,2 2,1 2,1 1))", -15.0); } template void test_spherical() { - boost::geometry::polygon geometry; + bg::model::polygon geometry; // unit-sphere has area of 4-PI. Polygon covering 1/8 of it: double expected = 4.0 * boost::math::constants::pi() / 8.0; - boost::geometry::read_wkt("POLYGON((0 0,0 90,90 0,0 0))", geometry); + bg::read_wkt("POLYGON((0 0,0 90,90 0,0 0))", geometry); - double area = boost::geometry::area(geometry); + double area = bg::area(geometry); BOOST_CHECK_CLOSE(area, expected, 0.0001); // With strategy, radius 2 -> 4 pi r^2 - boost::geometry::strategy::area::huiller + bg::strategy::area::huiller < - typename boost::geometry::point_type::type + typename bg::point_type::type > strategy(2.0); - area = boost::geometry::area(geometry, strategy); + area = bg::area(geometry, strategy); BOOST_CHECK_CLOSE(area, 2.0 * 2.0 * expected, 0.0001); } template void test_ccw() { - typedef boost::geometry::polygon ccw_polygon; + typedef bg::model::polygon ccw_polygon; // counterclockwise rings (second is wrongly ordered) test_geometry("POLYGON((1 1,2 2,3 1,2 0,1 1))", -2.0); test_geometry("POLYGON((1 1,2 0,3 1,2 2,1 1))", +2.0); @@ -79,7 +78,7 @@ void test_ccw() template void test_open() { - typedef boost::geometry::polygon open_polygon; + typedef bg::model::polygon open_polygon; test_geometry("POLYGON((1 1,2 2,3 1,2 0))", 2.0); // Note the triangular testcase used in CCW is not sensible for open/close } @@ -87,7 +86,7 @@ void test_open() template void test_open_ccw() { - typedef boost::geometry::polygon open_polygon; + typedef bg::model::polygon open_polygon; test_geometry("POLYGON((1 1,2 0,3 1,2 2))", 2.0); // Note the triangular testcase used in CCW is not sensible for open/close } @@ -96,21 +95,18 @@ void test_open_ccw() int test_main(int, char* []) { - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); - test_spherical > >(); + test_spherical > >(); - test_ccw >(); - test_open >(); - test_open_ccw >(); + test_ccw >(); + test_open >(); + test_open_ccw >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - test_all >(); +#ifdef HAVE_TTMATH + test_all >(); #endif return 0; diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index a0c8c9f18..69a8d8a26 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -16,44 +16,43 @@ #include #include -using namespace boost::geometry; template void check_linestring_2d(const L& line) { BOOST_CHECK((boost::size(line) == 3)); - BOOST_CHECK((boost::geometry::num_points(line) == 3)); + BOOST_CHECK((bg::num_points(line) == 3)); - typedef typename point_type::type P; - const P& p0 = line[0]; - BOOST_CHECK(get<0>(p0) == 1); - BOOST_CHECK(get<1>(p0) == 2); + typedef typename bg::point_type::type point_type; + point_type const& p0 = line[0]; + BOOST_CHECK(bg::get<0>(p0) == 1); + BOOST_CHECK(bg::get<1>(p0) == 2); - const P& p1 = line[1]; - BOOST_CHECK(get<0>(p1) == 3); - BOOST_CHECK(get<1>(p1) == 4); + point_type const& p1 = line[1]; + BOOST_CHECK(bg::get<0>(p1) == 3); + BOOST_CHECK(bg::get<1>(p1) == 4); - const P& p2 = line[2]; - BOOST_CHECK(get<0>(p2) == 5); - BOOST_CHECK(get<1>(p2) == 6); + point_type const& p2 = line[2]; + BOOST_CHECK(bg::get<0>(p2) == 5); + BOOST_CHECK(bg::get<1>(p2) == 6); } template void test_assign_linestring_2d() { - boost::geometry::linestring

line; + bg::model::linestring

line; // Test assignment of plain array (note that this is only possible if adapted c-array is included! const double coors[3][2] = { {1, 2}, {3, 4}, {5, 6} }; - boost::geometry::assign(line, coors); + bg::assign(line, coors); check_linestring_2d(line); // Test assignment of point array P points[3]; - boost::geometry::assign(points[0], 1, 2); - boost::geometry::assign(points[1], 3, 4); - boost::geometry::assign(points[2], 5, 6); - boost::geometry::assign(line, points); + bg::assign(points[0], 1, 2); + bg::assign(points[1], 3, 4); + bg::assign(points[2], 5, 6); + bg::assign(line, points); check_linestring_2d(line); // Test assignment of array with different point-type @@ -61,7 +60,7 @@ void test_assign_linestring_2d() tuples[0] = boost::make_tuple(1, 2); tuples[1] = boost::make_tuple(3, 4); tuples[2] = boost::make_tuple(5, 6); - boost::geometry::assign(line, tuples); + bg::assign(line, tuples); check_linestring_2d(line); } @@ -69,25 +68,25 @@ template void test_assign_box_2d() { - typedef box

B; + typedef bg::model::box

B; B b; - boost::geometry::assign(b, 1, 2, 3, 4); - BOOST_CHECK((get(b) == 1)); - BOOST_CHECK((get(b) == 2)); - BOOST_CHECK((get(b) == 3)); - BOOST_CHECK((get(b) == 4)); + bg::assign(b, 1, 2, 3, 4); + BOOST_CHECK((bg::get(b) == 1)); + BOOST_CHECK((bg::get(b) == 2)); + BOOST_CHECK((bg::get(b) == 3)); + BOOST_CHECK((bg::get(b) == 4)); - boost::geometry::assign_zero(b); - BOOST_CHECK((get(b) == 0)); - BOOST_CHECK((get(b) == 0)); - BOOST_CHECK((get(b) == 0)); - BOOST_CHECK((get(b) == 0)); + bg::assign_zero(b); + BOOST_CHECK((bg::get(b) == 0)); + BOOST_CHECK((bg::get(b) == 0)); + BOOST_CHECK((bg::get(b) == 0)); + BOOST_CHECK((bg::get(b) == 0)); - boost::geometry::assign_inverse(b); - BOOST_CHECK((get(b) > 9999)); - BOOST_CHECK((get(b) > 9999)); - BOOST_CHECK((get(b) < 9999)); - BOOST_CHECK((get(b) < 9999)); + bg::assign_inverse(b); + BOOST_CHECK((bg::get(b) > 9999)); + BOOST_CHECK((bg::get(b) > 9999)); + BOOST_CHECK((bg::get(b) < 9999)); + BOOST_CHECK((bg::get(b) < 9999)); } @@ -95,20 +94,20 @@ template void test_assign_point_3d() { P p; - boost::geometry::assign(p, 1, 2, 3); - BOOST_CHECK(get<0>(p) == 1); - BOOST_CHECK(get<1>(p) == 2); - BOOST_CHECK(get<2>(p) == 3); + bg::assign(p, 1, 2, 3); + BOOST_CHECK(bg::get<0>(p) == 1); + BOOST_CHECK(bg::get<1>(p) == 2); + BOOST_CHECK(bg::get<2>(p) == 3); - boost::geometry::detail::assign::assign_value(p, 123); - BOOST_CHECK(get<0>(p) == 123); - BOOST_CHECK(get<1>(p) == 123); - BOOST_CHECK(get<2>(p) == 123); + bg::detail::assign::assign_value(p, 123); + BOOST_CHECK(bg::get<0>(p) == 123); + BOOST_CHECK(bg::get<1>(p) == 123); + BOOST_CHECK(bg::get<2>(p) == 123); - boost::geometry::assign_zero(p); - BOOST_CHECK(get<0>(p) == 0); - BOOST_CHECK(get<1>(p) == 0); - BOOST_CHECK(get<2>(p) == 0); + bg::assign_zero(p); + BOOST_CHECK(bg::get<0>(p) == 0); + BOOST_CHECK(bg::get<1>(p) == 0); + BOOST_CHECK(bg::get<2>(p) == 0); } @@ -116,17 +115,17 @@ template void test_assign_point_2d() { P p; - boost::geometry::assign(p, 1, 2); - BOOST_CHECK(get<0>(p) == 1); - BOOST_CHECK(get<1>(p) == 2); + bg::assign(p, 1, 2); + BOOST_CHECK(bg::get<0>(p) == 1); + BOOST_CHECK(bg::get<1>(p) == 2); - boost::geometry::detail::assign::assign_value(p, 123); - BOOST_CHECK(get<0>(p) == 123); - BOOST_CHECK(get<1>(p) == 123); + bg::detail::assign::assign_value(p, 123); + BOOST_CHECK(bg::get<0>(p) == 123); + BOOST_CHECK(bg::get<1>(p) == 123); - boost::geometry::assign_zero(p); - BOOST_CHECK(get<0>(p) == 0); - BOOST_CHECK(get<1>(p) == 0); + bg::assign_zero(p); + BOOST_CHECK(bg::get<0>(p) == 0); + BOOST_CHECK(bg::get<1>(p) == 0); } int test_main(int, char* []) @@ -135,27 +134,27 @@ int test_main(int, char* []) test_assign_point_3d(); test_assign_point_3d(); test_assign_point_3d(); - test_assign_point_3d >(); - test_assign_point_3d >(); - test_assign_point_3d >(); + test_assign_point_3d >(); + test_assign_point_3d >(); + test_assign_point_3d >(); test_assign_point_2d(); test_assign_point_2d(); test_assign_point_2d(); - test_assign_point_2d >(); - test_assign_point_2d >(); - test_assign_point_2d >(); + test_assign_point_2d >(); + test_assign_point_2d >(); + test_assign_point_2d >(); test_assign_box_2d(); test_assign_box_2d(); test_assign_box_2d(); - test_assign_box_2d >(); - test_assign_box_2d >(); - test_assign_box_2d >(); + test_assign_box_2d >(); + test_assign_box_2d >(); + test_assign_box_2d >(); - test_assign_linestring_2d >(); - test_assign_linestring_2d >(); - test_assign_linestring_2d >(); + test_assign_linestring_2d >(); + test_assign_linestring_2d >(); + test_assign_linestring_2d >(); return 0; diff --git a/test/algorithms/buffer.cpp b/test/algorithms/buffer.cpp index eb349ea50..a94c1df2b 100644 --- a/test/algorithms/buffer.cpp +++ b/test/algorithms/buffer.cpp @@ -22,25 +22,25 @@ template void test_all() { - typedef typename boost::geometry::coordinate_type

::type coordinate_type; + typedef typename bg::coordinate_type

::type coordinate_type; P p1(0, 0); P p2(2, 2); - boost::geometry::box

b1(p1, p2); + bg::model::box

b1(p1, p2); - boost::geometry::box

b2; - boost::geometry::buffer(b1, b2, coordinate_type(2)); + bg::model::box

b2; + bg::buffer(b1, b2, coordinate_type(2)); // TODO: Check if buffer is correct - // using boost::geometry::equals to compare boxes + // using bg::equals to compare boxes // (TODO: implement that) } int test_main(int, char* []) { - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index 559daa8c1..e7386dd01 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -12,24 +12,25 @@ #include #include + template void test_2d() { - test_centroid >("LINESTRING(1 1, 2 2, 3 3)", 2.0, 2.0); - test_centroid >("LINESTRING(0 0,0 4, 4 4)", 1.0, 3.0); - test_centroid >("LINESTRING(0 0,3 3,0 6,3 9,0 12)", 1.5, 6.0); + test_centroid >("LINESTRING(1 1, 2 2, 3 3)", 2.0, 2.0); + test_centroid >("LINESTRING(0 0,0 4, 4 4)", 1.0, 3.0); + test_centroid >("LINESTRING(0 0,3 3,0 6,3 9,0 12)", 1.5, 6.0); - test_centroid >( + test_centroid >( "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", 4.06923363095238, 1.65055803571429); - test_centroid >( + test_centroid >( "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", 4.06923363095238, 1.65055803571429); // with holes - test_centroid >( + test_centroid >( "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)" ",(4 2,4.2 1.4,4.8 1.9,4.4 2.2,4 2))" @@ -38,18 +39,18 @@ void test_2d() // ccw - test_centroid >( + test_centroid >( "POLYGON((2 1.3,2.9 0.7,4.9 0.8,5.4 1.2,5.3 2.6,4.1 3,3.4 2" ",3.7 1.6,3.4 1.2,2.8 1.8,2.4 1.7,2 1.3))", 4.06923363095238, 1.65055803571429); // open / closed - test_centroid >( + test_centroid >( "POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0, 1.0); - test_centroid >( + test_centroid >( "POLYGON((1 1,2 2,3 1,2 0))", 2.0, 1.0); - test_centroid >("POLYGON((1 2,3 4))", 2, 3); + test_centroid >("POLYGON((1 2,3 4))", 2, 3); test_centroid

("POINT(3 3)", 3, 3); } @@ -57,24 +58,21 @@ void test_2d() template void test_3d() { - test_centroid >("POLYGON((1 2 3,5 6 7))", 3, 4, 5); + test_centroid >("POLYGON((1 2 3,5 6 7))", 3, 4, 5); test_centroid

("POINT(1 2 3)", 1, 2, 3); } int test_main(int, char* []) { - test_2d >(); + test_2d >(); test_2d >(); - test_2d >(); + test_2d >(); test_3d >(); -#if defined(HAVE_CLN) - //test_2d >(); -#endif -#if defined(HAVE_GMP) - //test_2d >(); +#if defined(HAVE_TTMATH) + test_2d >(); #endif return 0; diff --git a/test/algorithms/combine.cpp b/test/algorithms/combine.cpp index bba035341..58ca7124f 100644 --- a/test/algorithms/combine.cpp +++ b/test/algorithms/combine.cpp @@ -18,11 +18,10 @@ #include - template void test_point_3d() { - boost::geometry::box b = boost::geometry::make_inverse >(); + bg::model::box b = bg::make_inverse >(); test_combine(b, "POINT(1 2 5)", "(1,2,5),(1,2,5)"); test_combine(b, "POINT(3 4 6)", "(1,2,5),(3,4,6)"); @@ -44,8 +43,8 @@ void test_point_3d() template void test_box_3d() { - typedef boost::geometry::box box_type; - box_type b = boost::geometry::make_inverse(); + typedef bg::model::box box_type; + box_type b = bg::make_inverse(); test_combine(b, "BOX(0 2 5,4 4 6)", "(0,2,5),(4,4,6)"); test_combine(b, "BOX(0 1 5,4 6 6)", "(0,1,5),(4,6,6)"); @@ -70,10 +69,10 @@ void test_3d() template void test_2d() { - typedef boost::geometry::box box_type; + typedef bg::model::box box_type; typedef std::pair segment_type; - box_type b = boost::geometry::make_inverse(); + box_type b = bg::make_inverse(); test_combine(b, "BOX(1 1,2 2)", "(1,1),(2,2)"); @@ -87,7 +86,7 @@ void test_2d() template void test_spherical_degree() { - boost::geometry::box b = boost::geometry::make_inverse >(); + bg::model::box b = bg::make_inverse >(); test_combine(b, "POINT(179.73 71.56)", "(179.73,71.56),(179.73,71.56)"); @@ -106,7 +105,7 @@ void test_spherical_degree() template void test_spherical_radian() { - boost::geometry::box b = boost::geometry::make_inverse >(); + bg::model::box b = bg::make_inverse >(); test_combine(b, "POINT(3.128 1.249)", "(3.128,1.249),(3.128,1.249)"); @@ -123,29 +122,21 @@ void test_spherical_radian() int test_main(int, char* []) { - test_2d >(); + test_2d >(); test_3d(); - test_3d >(); - test_3d >(); - test_3d >(); + test_3d >(); + test_3d >(); + test_3d >(); - test_spherical_degree > >(); - test_spherical_radian > >(); + test_spherical_degree > >(); + test_spherical_radian > >(); -/*** -GMP/CLN still fails, due to boost::numeric_limits, waiting for solution -#if defined(HAVE_CLN) - test_3d >(); +#if defined(HAVE_TTMATH) + test_3d >(); #endif -#if defined(HAVE_GMP) - test_3d >(); -#endif -***/ return 0; } diff --git a/test/algorithms/comparable_distance.cpp b/test/algorithms/comparable_distance.cpp index 58cb2c64e..3ee1dd633 100644 --- a/test/algorithms/comparable_distance.cpp +++ b/test/algorithms/comparable_distance.cpp @@ -23,7 +23,6 @@ #include -namespace bg = boost::geometry; template void test_distance_result() @@ -74,10 +73,10 @@ void test_distance_segment() P p4 = bg::make

(2.6, 2.4); P p5 = bg::make

(2.5, 2.5); - bg::segment

const seg(s1, s2); + bg::model::referring_segment

const seg(s1, s2); - double d1 = bg::comparable_distance(p1, seg); BOOST_CHECK_CLOSE(d1, 2.0, 0.001); - double d2 = bg::comparable_distance(p2, seg); BOOST_CHECK_CLOSE(d2, 1.0, 0.001); + double d1 = bg::comparable_distance(p1, seg); BOOST_CHECK_CLOSE(d1, 8.0, 0.001); + double d2 = bg::comparable_distance(p2, seg); BOOST_CHECK_CLOSE(d2, 2.0, 0.001); double d3 = bg::comparable_distance(p3, seg); BOOST_CHECK_CLOSE(d3, 0.02, 0.001); double d4 = bg::comparable_distance(p4, seg); BOOST_CHECK_CLOSE(d4, 0.02, 0.001); double d5 = bg::comparable_distance(p5, seg); BOOST_CHECK_CLOSE(d5, 0.0, 0.001); @@ -90,7 +89,7 @@ void test_distance_segment() template void test_distance_linestring() { - bg::linestring

points; + bg::model::linestring

points; points.push_back(bg::make

(1, 1)); points.push_back(bg::make

(3, 3)); @@ -104,7 +103,7 @@ void test_distance_linestring() BOOST_CHECK_CLOSE(d, 2.828427, 0.001); - bg::linestring

line; + bg::model::linestring

line; line.push_back(bg::make

(1,1)); line.push_back(bg::make

(2,2)); line.push_back(bg::make

(3,3)); @@ -130,9 +129,9 @@ void test_all() int test_main(int, char* []) { - //test_all >(); - test_all >(); - test_all >(); + //test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/convert.cpp b/test/algorithms/convert.cpp index dde11ecc5..ab95a3a81 100644 --- a/test/algorithms/convert.cpp +++ b/test/algorithms/convert.cpp @@ -19,21 +19,22 @@ #include #include + template void test_all() { - typedef boost::geometry::box

box_type; + typedef bg::model::box

box_type; P p; - boost::geometry::assign(p, 1, 2); + bg::assign(p, 1, 2); box_type b; - boost::geometry::convert(p, b); + bg::convert(p, b); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0, 0>(b)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0, 1>(b)), 2.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1, 0>(b)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1, 1>(b)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0, 1>(b)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1, 1>(b)), 2.0, 0.001); } template @@ -41,55 +42,55 @@ void test_std() { test_all

(); - typedef boost::geometry::box

box_type; - typedef boost::geometry::linear_ring

ring_type; - typedef boost::geometry::polygon

polygon_type; + typedef bg::model::box

box_type; + typedef bg::model::linear_ring

ring_type; + typedef bg::model::polygon

polygon_type; box_type b; - boost::geometry::set(b, 1); - boost::geometry::set(b, 2); - boost::geometry::set(b, 3); - boost::geometry::set(b, 4); + bg::set(b, 1); + bg::set(b, 2); + bg::set(b, 3); + bg::set(b, 4); ring_type ring; - boost::geometry::convert(b, ring); + bg::convert(b, ring); - //std::cout << boost::geometry::wkt(b) << std::endl; - //std::cout << boost::geometry::wkt(ring) << std::endl; + //std::cout << bg::wkt(b) << std::endl; + //std::cout << bg::wkt(ring) << std::endl; typename boost::range_const_iterator::type it = ring.begin(); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(*it)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(*it)), 2.0, 0.001); it++; - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 4.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(*it)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(*it)), 4.0, 0.001); it++; - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 3.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 4.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(*it)), 3.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(*it)), 4.0, 0.001); it++; - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 3.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(*it)), 3.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(*it)), 2.0, 0.001); it++; - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(*it)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(*it)), 2.0, 0.001); BOOST_CHECK_EQUAL(ring.size(), 5u); polygon_type polygon; - boost::geometry::convert(ring, polygon); - BOOST_CHECK_EQUAL(boost::geometry::num_points(polygon), 5u); + bg::convert(ring, polygon); + BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); - boost::geometry::convert(polygon, ring); - BOOST_CHECK_EQUAL(boost::geometry::num_points(ring), 5u); + bg::convert(polygon, ring); + BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); } int test_main(int, char* []) { - test_std >(); - test_std >(); - test_std >(); + test_std >(); + test_std >(); + test_std >(); return 0; } diff --git a/test/algorithms/convex_hull.cpp b/test/algorithms/convex_hull.cpp index a1e94d884..c6e6b90de 100644 --- a/test/algorithms/convex_hull.cpp +++ b/test/algorithms/convex_hull.cpp @@ -14,25 +14,24 @@ #include - template void test_all(bool do_rectangular = true) { // from sample linestring - test_geometry >( + test_geometry >( "linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", 5, 4, 3.8); if (do_rectangular) { // rectangular, with concavity - test_geometry >( + test_geometry >( "polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))", 9, 5, 12.0); } // from sample polygon, with concavity - test_geometry >( + test_geometry >( "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0" ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", 12, 8, 5.245); @@ -40,22 +39,12 @@ void test_all(bool do_rectangular = true) int test_main(int, char* []) { - //test_all >(); - //test_all >(); - test_all >(); + //test_all >(); + test_all >(); + test_all >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - // GMP compiles, but gives 'errors' in results (6 points in hull instead of 5) - // This is because of a vertex on the line, which is OK for the convex hull, - // but not OK for the strictly convex hull. - // Actually this is unexpected from a high-precision arithmetic library, the - // problem is the comparison (something is non-zero which should be calculated - // zero, in the direction). - - test_all >(false); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/correct.cpp b/test/algorithms/correct.cpp index d3da3342b..b574d02a9 100644 --- a/test/algorithms/correct.cpp +++ b/test/algorithms/correct.cpp @@ -29,11 +29,11 @@ void test_geometry(std::string const& wkt, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::correct(geometry); + bg::read_wkt(wkt, geometry); + bg::correct(geometry); std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_EQUAL(out.str(), expected); } @@ -49,11 +49,11 @@ void test_geometry_dsv(std::string const& wkt, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::correct(geometry); + bg::read_wkt(wkt, geometry); + bg::correct(geometry); std::ostringstream out; - out << boost::geometry::dsv(geometry); + out << bg::dsv(geometry); BOOST_CHECK_EQUAL(out.str(), expected); } @@ -73,46 +73,44 @@ void test_all() std::string ccw_open_ring = "POLYGON((0 0,1 0,1 1,0 1))"; // already cw_ring - test_geometry >(cw_ring, cw_ring); + test_geometry >(cw_ring, cw_ring); // wrong order - test_geometry >(ccw_ring, cw_ring); + test_geometry >(ccw_ring, cw_ring); // ccw-ring, input ccw-ring, already correct - test_geometry >(ccw_ring, ccw_ring); + test_geometry >(ccw_ring, ccw_ring); // ccw-ring, input cw-ring, corrected - test_geometry >(cw_ring, ccw_ring); + test_geometry >(cw_ring, ccw_ring); // open-ring, input ccw-ring, already correct - test_geometry >(cw_open_ring, cw_open_ring); + test_geometry >(cw_open_ring, cw_open_ring); // ccw-ring, input cw-ring, corrected - test_geometry >(ccw_open_ring, "POLYGON((0 1,1 1,1 0,0 0))"); + test_geometry >(ccw_open_ring, "POLYGON((0 1,1 1,1 0,0 0))"); // not closed - test_geometry >( + test_geometry >( ccw_open_ring, cw_ring); // counter clockwise, cw_ring - test_geometry > - (ccw_ring, ccw_ring); + test_geometry >(ccw_ring, ccw_ring); - test_geometry > - (cw_ring, ccw_ring); + test_geometry >(cw_ring, ccw_ring); // polygon: cw_ring - test_geometry >(cw_ring, cw_ring); + test_geometry >(cw_ring, cw_ring); // wrong order - test_geometry >( + test_geometry >( "POLYGON((0 0,1 0,1 1,0 1,0 0))", cw_ring); // wrong order & not closed - test_geometry >( + test_geometry >( ccw_open_ring, cw_ring); @@ -123,34 +121,34 @@ void test_all() "POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,1 2,2 2,2 1,1 1))"; // with holes: cw_ring - test_geometry >( + test_geometry >( cw_holey_polygon, cw_holey_polygon); // wrong order of main - test_geometry >( + test_geometry >( "POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))", cw_holey_polygon); // wrong order of hole - test_geometry >( + test_geometry >( "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1))", cw_holey_polygon); // wrong order of main and hole - test_geometry >(ccw_holey_polygon, cw_holey_polygon); + test_geometry >(ccw_holey_polygon, cw_holey_polygon); // test the counter-clockwise - test_geometry >( + test_geometry >( ccw_holey_polygon, ccw_holey_polygon); // Boxes std::string proper_box = "POLYGON((0 0,0 2,2 2,2 0,0 0))"; - test_geometry >(proper_box, proper_box); - test_geometry >("BOX(0 0,2 2)", proper_box); - test_geometry >("BOX(2 2,0 0)", proper_box); - test_geometry >("BOX(0 2,2 0)", proper_box); + test_geometry >(proper_box, proper_box); + test_geometry >("BOX(0 0,2 2)", proper_box); + test_geometry >("BOX(2 2,0 0)", proper_box); + test_geometry >("BOX(0 2,2 0)", proper_box); // Cubes - typedef boost::geometry::box > box3d; + typedef bg::model::box > box3d; std::string proper_3d_dsv_box = "((0, 0, 0), (2, 2, 2))"; test_geometry_dsv("BOX(0 0 0,2 2 2)", proper_3d_dsv_box); test_geometry_dsv("BOX(2 2 2,0 0 0)", proper_3d_dsv_box); @@ -167,8 +165,8 @@ int test_main(int, char* []) //test_all(); //test_all >(); - //test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/detail/sections/sectionalize.cpp b/test/algorithms/detail/sections/sectionalize.cpp index 8a09e4a34..7fbe23a8b 100644 --- a/test/algorithms/detail/sections/sectionalize.cpp +++ b/test/algorithms/detail/sections/sectionalize.cpp @@ -22,14 +22,13 @@ #include -namespace bg = boost::geometry; template void test_sectionalize_part() { typedef typename bg::point_type::type point_type; - typedef bg::box box_type; + typedef bg::model::box box_type; typedef bg::sections sections_type; typedef typename boost::range_value::type section_type; @@ -50,7 +49,7 @@ void test_sectionalize_part() int ndi = 0; sectionalize_part::apply(sections, section, index, ndi, geometry); // There should not yet be anything generated, because it is only ONE point - + geometry.push_back(bg::make(2, 2)); sectionalize_part::apply(sections, section, index, ndi, geometry); @@ -62,7 +61,7 @@ void test_sectionalize(G const& g, std::size_t section_count, std::string const& index_check, std::string const& dir_check) { typedef typename bg::point_type::type point; - typedef bg::box box; + typedef bg::model::box box; typedef bg::sections sections; sections s; @@ -149,9 +148,9 @@ void test_sectionalize(std::string const& wkt, template void test_all() { - test_sectionalize_part<1, bg::linestring

>(); + test_sectionalize_part<1, bg::model::linestring

>(); - test_sectionalize >( + test_sectionalize >( "LINESTRING(1 1,2 2,3 0,5 0,5 8)", 4, "0..1|1..2|2..3|3..4", "+ +|+ -|+ .|. +", 2, "0..3|3..4", "+|."); @@ -204,18 +203,18 @@ void test_all() 6, "0..2|2..6|6..8|0..1|1..2|2..3", "-|+|-|-|+|."); // With duplicates - test_sectionalize >( + test_sectionalize >( "LINESTRING(1 1,2 2,3 0,3 0,5 0,5 8)", 5, "0..1|1..2|2..3|3..4|4..5", "+ +|+ -|DUP DUP|+ .|. +", 4, "0..2|2..3|3..4|4..5", "+|DUP|+|."); // With two subsequent duplicate segments - test_sectionalize >( + test_sectionalize >( "LINESTRING(1 1,2 2,3 0,3 0,3 0,5 0,5 0,5 0,5 0,5 8)", 6, "0..1|1..2|2..4|4..5|5..8|8..9", "+ +|+ -|DUP DUP|+ .|DUP DUP|. +", 5, "0..2|2..4|4..5|5..8|8..9", "+|DUP|+|DUP|."); - typedef bg::box

B; + typedef bg::model::box

B; test_sectionalize<2, B>(bg::make(0,0,4,4), 4, "0..1|1..2|2..3|3..4", ". +|+ .|. -|- ."); test_sectionalize<1, B>(bg::make(0,0,4,4), @@ -231,8 +230,8 @@ void test_all() int test_main(int, char* []) { - //test_all >(); - test_all >(); + //test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/difference.cpp b/test/algorithms/difference.cpp index e2855d0cb..07c5e744b 100644 --- a/test/algorithms/difference.cpp +++ b/test/algorithms/difference.cpp @@ -5,8 +5,11 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_GEOMETRY_CHECK_WITH_POSTGIS +//#define BOOST_GEOMETRY_CHECK_WITH_POSTGIS +// BSG 27-11-2010 (comment) +// NOTE: this is currently NOT yet error-free, reporting about 7 errors. +// TODO: fix this #include #include @@ -16,10 +19,11 @@ #include #include + template void test_all() { - typedef boost::geometry::polygon

polygon; + typedef bg::model::polygon

polygon; test_one( "star_ring", example_star, example_ring, @@ -102,6 +106,6 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/disjoint.cpp b/test/algorithms/disjoint.cpp index f8653af89..3f6089aec 100644 --- a/test/algorithms/disjoint.cpp +++ b/test/algorithms/disjoint.cpp @@ -22,19 +22,18 @@ #include - template void test_disjoint(std::string const& id, std::string const& wkt1, std::string const& wkt2, bool expected) { G1 g1; - boost::geometry::read_wkt(wkt1, g1); + bg::read_wkt(wkt1, g1); G2 g2; - boost::geometry::read_wkt(wkt2, g2); + bg::read_wkt(wkt2, g2); - bool detected = boost::geometry::disjoint(g1, g2); + bool detected = bg::disjoint(g1, g2); BOOST_CHECK_MESSAGE(detected == expected, "disjoint: " << id << " -> Expected: " << expected @@ -46,7 +45,7 @@ void test_disjoint(std::string const& id, template void test_all() { - typedef boost::geometry::box

box; + typedef bg::model::box

box; test_disjoint("pp1", "point(1 1)", "point(1 1)", false); test_disjoint("pp2", "point(1 1)", "point(1.001 1)", true); @@ -76,8 +75,8 @@ void test_all() // Test triangles for polygons/rings, boxes // Note that intersections are tested elsewhere, they don't need // thorough test at this place - typedef boost::geometry::polygon

polygon; - typedef boost::geometry::linear_ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::linear_ring

ring; // Four times same test with other types test_disjoint("disjoint_simplex_pp", disjoint_simplex[0], disjoint_simplex[1], true); @@ -100,8 +99,8 @@ void test_all() test_disjoint("within_simplex_rr2", within_simplex[1], within_simplex[0], false); // Linear - typedef boost::geometry::linestring

ls; - typedef boost::geometry::model::segment

segment; + typedef bg::model::linestring

ls; + typedef bg::model::segment

segment; test_disjoint("ls/ls 1", "linestring(0 0,1 1)", "linestring(1 0,0 1)", false); test_disjoint("ls/ls 2", "linestring(0 0,1 1)", "linestring(1 0,2 1)", true); test_disjoint("s/s 1", "linestring(0 0,1 1)", "linestring(1 0,0 1)", false); @@ -115,8 +114,8 @@ void test_all() int test_main(int, char* []) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/dissolve.cpp b/test/algorithms/dissolve.cpp index 4c958b60e..911432174 100644 --- a/test/algorithms/dissolve.cpp +++ b/test/algorithms/dissolve.cpp @@ -5,8 +5,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#define BOOST_GEOMETRY_DEBUG_ENRICH -#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +//#define BOOST_GEOMETRY_DEBUG_ENRICH +//#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER #include @@ -16,99 +16,99 @@ template void test_all() { - typedef boost::geometry::linear_ring

ring; - typedef boost::geometry::polygon

polygon; + typedef bg::model::linear_ring

ring; + typedef bg::model::polygon

polygon; // Simplex - test_one("1", - "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", - 0, 6, 8); + test_one("1", + "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", + 0, 6, 8); // Self intersecting - test_one("2", - "POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))", - 1, 12, 7.9296875); + test_one("2", + "POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))", + 1, 12, 7.9296875); // Self intersecting in last segment - test_one("3", - "POLYGON((0 2,2 4,2 0,4 2,0 2))", - 0, 4, 2.0); + test_one("3", + "POLYGON((0 2,2 4,2 0,4 2,0 2))", + 0, 4, 2.0); // Self tangent - test_one("4", - "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))", - 0, 8, 8.0); + test_one("4", + "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))", + 0, 8, 8.0); // Self tangent in corner - test_one("5", - "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))", - 0, 8, 12.0); + test_one("5", + "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))", + 0, 8, 12.0); // With spike - test_one("6", - "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))", - 0, 6, 16); + test_one("6", + "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))", + 0, 6, 16); // Non intersection, but with duplicate - test_one("d1", - "POLYGON((0 0,0 4,4 0,4 0,0 0))", - 0, 4, 8); + test_one("d1", + "POLYGON((0 0,0 4,4 0,4 0,0 0))", + 0, 4, 8); // With many duplicates - test_one("d2", - "POLYGON((0 0,0 1,0 1,0 1,0 2,0 2,0 3,0 3,0 3,0 3,0 4,2 4,2 4,4 4,4 0,4 0,3 0,3 0,3 0,3 0,3 0,0 0))", - 0, 10, 16); + test_one("d2", + "POLYGON((0 0,0 1,0 1,0 1,0 2,0 2,0 3,0 3,0 3,0 3,0 4,2 4,2 4,4 4,4 0,4 0,3 0,3 0,3 0,3 0,3 0,0 0))", + 0, 10, 16); // Hole: interior tangent to exterior - test_one("h1", - "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))", - 0, 6, 16); + test_one("h1", + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))", + 0, 6, 16); // Hole: interior intersecting exterior // TODO: fix this one /* - test_one("h2", - "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))", - 0, 8, 16.25); + test_one("h2", + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))", + 0, 8, 16.25); */ // Hole: two intersecting holes - test_one("h3", - "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,3 3,3 1,1 1),(2 2,2 3.5,3.5 3.5,3.5 2,2 2))", - 0, 5, 16); + test_one("h3", + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,3 3,3 1,1 1),(2 2,2 3.5,3.5 3.5,3.5 2,2 2))", + 0, 5, 16); // Hole: self-intersecting hole - test_one("h4", - "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 3,3 2.5,1 3.5,1.5 3.5,1 1))", - 1, 9, 14.484848484848484); + test_one("h4", + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 3,3 2.5,1 3.5,1.5 3.5,1 1))", + 1, 9, 14.484848484848484); - // See power point - test_one("case_1", - "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))", - 0, 7, 50.48056402439); + // See power point + test_one("case_1", + "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))", + 0, 7, 50.48056402439); std::string const ticket17 = "POLYGON ((-122.28139163 37.37319149,-122.28100699 37.37273669,-122.28002186 37.37303123,-122.27979681 37.37290072,-122.28007349 37.37240493,-122.27977334 37.37220360,-122.27819720 37.37288580,-122.27714184 37.37275161,-122.27678628 37.37253167,-122.27766437 37.37180973,-122.27804382 37.37121453,-122.27687664 37.37101354,-122.27645829 37.37203386,-122.27604423 37.37249110,-122.27632234 37.37343339,-122.27760980 37.37391082,-122.27812478 37.37800320,-122.26117222 37.39121007,-122.25572289 37.39566631,-122.25547269 37.39564971,-122.25366304 37.39552993,-122.24919976 37.39580268,-122.24417933 37.39366907,-122.24051443 37.39094143,-122.23246277 37.38100418,-122.23606766 37.38141338,-122.24001587 37.37738940,-122.23666848 37.37609347,-122.23057450 37.37882170,-122.22679803 37.37807143,-122.22525727 37.37448817,-122.22523229 37.37443000,-122.23083199 37.37609347,-122.23033486 37.37777891,-122.23169030 37.37732117,-122.23229178 37.37709687,-122.23237761 37.37631249,-122.23297776 37.37438834,-122.23872850 37.37165986,-122.24044511 37.36934068,-122.24671067 37.36865847,-122.24825570 37.36981819,-122.25151719 37.36947713,-122.25357721 37.36756706,-122.26001451 37.36579354,-122.25615213 37.36545239,-122.25486458 37.36245083,-122.25357721 37.36108651,-122.25194642 37.36013139,-122.24885652 37.35958557,-122.24911401 37.35849399,-122.25357721 37.35808470,-122.25675286 37.35897159,-122.25855539 37.35753887,-122.26181687 37.35828939,-122.26713837 37.35897159,-122.26782510 37.36108651,-122.26662339 37.36456559,-122.27288911 37.36722601,-122.27366159 37.36531602,-122.27168740 37.36470213,-122.27391900 37.36374701,-122.27074326 37.36245083,-122.27134408 37.35951742,-122.27426240 37.36135926,-122.27709482 37.36115474,-122.27966974 37.36231438,-122.27958391 37.36463382,-122.27572152 37.36463382,-122.27563569 37.36524779,-122.27700899 37.36593000,-122.27709482 37.36763529,-122.27554978 37.36838573,-122.27667254 37.36931478,-122.27677932 37.36932073,-122.27769362 37.36853987,-122.27942490 37.36830803,-122.28178776 37.36677917,-122.28509559 37.36443500,-122.28845129 37.36413744,-122.29194403 37.36695946,-122.29382577 37.36726817,-122.29600414 37.36898512,-122.29733083 37.36995398,-122.29593239 37.37141436,-122.29416649 37.37075898,-122.29325026 37.37108436,-122.29652910 37.37311697,-122.29584237 37.37374461,-122.29537583 37.37573372,-122.29487677 37.37752502,-122.30923212 37.37593011,-122.31122484 37.38230086,-122.31467994 37.38092472,-122.31715663 37.38252181,-122.32307970 37.38166978,-122.31985618 37.37667694,-122.32210304 37.37580220,-122.32581446 37.37589532,-122.32401730 37.37331839,-122.32960417 37.37189020,-122.33465527 37.37331906,-122.33425328 37.37623680,-122.33620676 37.37726132,-122.33397986 37.37822382,-122.33358918 37.38036590,-122.33202637 37.37986918,-122.33147954 37.38101784,-122.33394080 37.38198017,-122.33545239 37.38587943,-122.33478058 37.38785697,-122.33386050 37.38723721,-122.33350041 37.38571137,-122.33122003 37.38548891,-122.33140008 37.38650606,-122.33366042 37.38817490,-122.33244019 37.39157602,-122.33298157 37.39419201,-122.33164013 37.39477028,-122.33202017 37.39518351,-122.33358038 37.39499282,-122.33376050 37.39597811,-122.33550067 37.39734478,-122.33556069 37.39481797,-122.33344040 37.39292676,-122.33638094 37.38892189,-122.34240644 37.38852719,-122.34906293 37.38726898,-122.35072321 37.39338769,-122.34910291 37.39445252,-122.34796272 37.39410291,-122.34449043 37.39640534,-122.34500223 37.39729709,-122.34936291 37.39670910,-122.35098322 37.39531066,-122.35364623 37.39554510,-122.35434369 37.39612111,-122.35798429 37.39600988,-122.35768430 37.39478621,-122.36334519 37.39206871,-122.36604726 37.39203267,-122.36778592 37.39335592,-122.36518870 37.40022011,-122.36554552 37.40247752,-122.36370519 37.40331974,-122.36270506 37.40530591,-122.36320512 37.40670418,-122.36149849 37.40851392,-122.36730580 37.41054938,-122.37263720 37.41378932,-122.37161871 37.42076600,-122.36566153 37.42006292,-122.36520547 37.42742106,-122.37165953 37.43661157,-122.35943972 37.44459022,-122.35356359 37.44600810,-122.33792254 37.45796329,-122.35228518 37.47478091,-122.35127080 37.48181199,-122.34867342 37.48487322,-122.34359717 37.48801082,-122.33388431 37.48677650,-122.33142321 37.48429747,-122.32929580 37.48473149,-122.32609609 37.48291144,-122.32344850 37.48228229,-122.31924364 37.48410234,-122.31677299 37.48114051,-122.31431751 37.47848973,-122.31259201 37.47682190,-122.31515972 37.47568196,-122.31691389 37.47360309,-122.31292494 37.46960081,-122.31130153 37.46937743,-122.30889894 37.47124987,-122.30612839 37.47011613,-122.30149630 37.46568378,-122.30064277 37.46363784,-122.29283821 37.45922376,-122.28630141 37.45415497,-122.28883099 37.44629920,-122.28316717 37.44197138,-122.27554148 37.42297597,-122.25597410 37.40553692,-122.25196579 37.40129593,-122.25012043 37.40049143,-122.24823207 37.39897758,-122.24754551 37.39740941,-122.24778582 37.39621607,-122.24934787 37.39599102,-122.25005170 37.39871849,-122.25222328 37.39863668,-122.25342491 37.39737529,-122.25520162 37.39667289,-122.25528737 37.39522726,-122.27747460 37.37809616,-122.27977493 37.37858717,-122.28157729 37.37920106,-122.28322534 37.37952846,-122.28416939 37.38092656,-122.28621223 37.37984219,-122.28638389 37.37613857,-122.28382607 37.37843722,-122.27930278 37.37718220,-122.28196361 37.37652740,-122.28295058 37.37568167,-122.28216101 37.37523148,-122.28114822 37.37543608,-122.27934569 37.37528613,-122.27996369 37.37448121,-122.28104521 37.37454944,-122.28185197 37.37422883,-122.28290767 37.37474038,-122.28376597 37.37467224,-122.28428104 37.37399012,-122.28402346 37.37338989,-122.28610922 37.37364914,-122.28651264 37.37327388,-122.28672722 37.37207343,-122.28628398 37.37205448,-122.28574460 37.37166682,-122.28479711 37.37200981,-122.28327731 37.37137228,-122.28285511 37.37100700,-122.28279409 37.37125669,-122.28315527 37.37173756,-122.28321872 37.37220569,-122.28187007 37.37231918,-122.28193109 37.37294908,-122.28139163 37.37319149))"; - test_one("ticket17", ticket17, - 1, 228, 0.00920834633689); + test_one("ticket17", ticket17, + 1, 228, 0.00920834633689); - return; // next one does not work for gcc/linux - // Real-life - std::string const toolkit = "POLYGON((170718 605997,170718 605997,170776 606016,170773 606015,170786 606020,170778 606016,170787 606021,170781 606017,170795 606028,170795 606028,170829 606055,170939 606140,170933 605968,170933 605968,170932 605908,170929 605834,170920 605866,170961 605803,170739 605684,170699 605749,170691 605766,170693 605762,170686 605775,170688 605771,170673 605794,170676 605790,170668 605800,170672 605796,170651 605818,170653 605816,170639 605829,170568 605899,170662 605943,170633 605875,170603 605961,170718 605997))"; + return; // next one does not work for gcc/linux + // Real-life + std::string const toolkit = "POLYGON((170718 605997,170718 605997,170776 606016,170773 606015,170786 606020,170778 606016,170787 606021,170781 606017,170795 606028,170795 606028,170829 606055,170939 606140,170933 605968,170933 605968,170932 605908,170929 605834,170920 605866,170961 605803,170739 605684,170699 605749,170691 605766,170693 605762,170686 605775,170688 605771,170673 605794,170676 605790,170668 605800,170672 605796,170651 605818,170653 605816,170639 605829,170568 605899,170662 605943,170633 605875,170603 605961,170718 605997))"; test_one("toolkit", toolkit, - 0, 25, 91756.916526794434); + 0, 25, 91756.916526794434); } int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/distance.cpp b/test/algorithms/distance.cpp index 91c8e6100..055344b1e 100644 --- a/test/algorithms/distance.cpp +++ b/test/algorithms/distance.cpp @@ -24,9 +24,6 @@ #include -namespace bg = boost::geometry; - - template void test_distance_point() { @@ -95,7 +92,7 @@ void test_distance_segment() P p4; bg::set<0>(p4, 1); bg::set<1>(p4, 3); P p5; bg::set<0>(p5, 3); bg::set<1>(p5, 3); - bg::segment

const seg(s1, s2); + bg::model::referring_segment

const seg(s1, s2); return_type d1 = bg::distance(p1, seg); return_type d2 = bg::distance(p2, seg); @@ -175,34 +172,34 @@ void test_all() test_geometry("POINT(0 0)", "POINT(0 3)", 3.0); test_geometry("POINT(0 0)", "POINT(4 0)", 4.0); test_geometry("POINT(0 3)", "POINT(4 0)", 5.0); - test_geometry >("POINT(1 3)", "LINESTRING(1 1,4 4)", sqrt(2.0)); - test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); - test_geometry, P>("LINESTRING(1 1,4 4)", "POINT(1 3)", sqrt(2.0)); + test_geometry >("POINT(1 3)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + test_geometry, P>("LINESTRING(1 1,4 4)", "POINT(1 3)", sqrt(2.0)); // Rings - test_geometry >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0)); - test_geometry >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0); + test_geometry >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0)); + test_geometry >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0); // other way round - test_geometry, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0); + test_geometry, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0); // open ring - test_geometry >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0)); + test_geometry >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0)); // Polygons - test_geometry >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0)); - test_geometry >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0); + test_geometry >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0)); + test_geometry >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0); // other way round - test_geometry, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0); + test_geometry, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0); // open polygon - test_geometry >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0)); + test_geometry >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0)); // Polygons with holes std::string donut = "POLYGON ((0 0,1 9,8 1,0 0),(1 1,4 1,1 4,1 1))"; - test_geometry >("POINT(2 2)", donut, 0.5 * sqrt(2.0)); - test_geometry >("POINT(3 3)", donut, 0.0); + test_geometry >("POINT(2 2)", donut, 0.5 * sqrt(2.0)); + test_geometry >("POINT(3 3)", donut, 0.0); // other way round - test_geometry, P>(donut, "POINT(2 2)", 0.5 * sqrt(2.0)); + test_geometry, P>(donut, "POINT(2 2)", 0.5 * sqrt(2.0)); // open - test_geometry >("POINT(2 2)", "POLYGON ((0 0,1 9,8 1),(1 1,4 1,1 4))", 0.5 * sqrt(2.0)); + test_geometry >("POINT(2 2)", "POLYGON ((0 0,1 9,8 1),(1 1,4 1,1 4))", 0.5 * sqrt(2.0)); // DOES NOT COMPILE - cannot do read_wkt (because boost::array is not variably sized) @@ -220,10 +217,10 @@ int test_main(int, char* []) //test_all(); // located here because of 3D #endif - test_all >(); + test_all >(); test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/envelope.cpp b/test/algorithms/envelope.cpp index cf6765fff..fcda89cbe 100644 --- a/test/algorithms/envelope.cpp +++ b/test/algorithms/envelope.cpp @@ -16,16 +16,15 @@ #include - template void test_2d() { test_envelope

("POINT(1 1)", 1, 1, 1, 1); - test_envelope >("LINESTRING(1 1,2 2)", 1, 2, 1, 2); - test_envelope >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3); + test_envelope >("LINESTRING(1 1,2 2)", 1, 2, 1, 2); + test_envelope >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3); - test_envelope >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3); - test_envelope >("BOX(1 1,3 3)", 1, 3, 1, 3); + test_envelope >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3); + test_envelope >("BOX(1 1,3 3)", 1, 3, 1, 3); typedef std::pair segment_type; test_envelope("SEGMENT(1 1,3 3)", 1, 3, 1, 3); @@ -36,8 +35,8 @@ void test_3d() { test_envelope

("POINT(1 2 3)", 1, 1, 2, 2, 3, 3); test_envelope

("POINT(3 2 1)", 3, 3, 2, 2, 1, 1); - test_envelope >("LINESTRING(1 1 1,2 2 2)", 1, 2, 1, 2, 1, 2); - test_envelope >("BOX(1 1 1,3 3 3)", 1, 3, 1, 3, 1, 3); + test_envelope >("LINESTRING(1 1 1,2 2 2)", 1, 2, 1, 2, 1, 2); + test_envelope >("BOX(1 1 1,3 3 3)", 1, 3, 1, 3, 1, 3); } @@ -47,9 +46,9 @@ int test_main(int, char* []) //test_2d(); //test_2d(); test_2d >(); - test_2d >(); - test_2d >(); - test_2d >(); + test_2d >(); + test_2d >(); + test_2d >(); test_3d(); diff --git a/test/algorithms/equals.cpp b/test/algorithms/equals.cpp index 710447c07..ffd0278d1 100644 --- a/test/algorithms/equals.cpp +++ b/test/algorithms/equals.cpp @@ -10,13 +10,15 @@ #include + + template void test_all() { - typedef boost::geometry::box

box; - typedef boost::geometry::linear_ring

ring; - typedef boost::geometry::polygon

polygon; - typedef boost::geometry::linestring

linestring; + typedef bg::model::box

box; + typedef bg::model::linear_ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; test_geometry("p1", "POINT(1 1)", "POINT(1 1)", true); @@ -97,14 +99,11 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); -#if defined(HAVE_CLN) -// test_all >(); -#endif -#if defined(HAVE_GMP) -// test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/for_each.cpp b/test/algorithms/for_each.cpp index 00e8bdced..19446fdb5 100644 --- a/test/algorithms/for_each.cpp +++ b/test/algorithms/for_each.cpp @@ -28,7 +28,7 @@ void test_all() , 0 , "POINT(1 1)" ); - test_geometry > + test_geometry > ( "LINESTRING(1 1,2 2)" @@ -40,7 +40,7 @@ void test_all() , std::sqrt(2.0) , "LINESTRING(10 1,2 2)" ); - test_geometry > + test_geometry > ( "POLYGON((1 1,1 4,4 4,4 1,1 1))" @@ -52,7 +52,7 @@ void test_all() , 4 * 3.0 , "POLYGON((10 1,10 4,4 4,4 1,1 1))" ); - test_geometry > + test_geometry > ( "POLYGON((1 1,1 4,4 4,4 1,1 1),(2 2,3 2,3 3,2 3,2 2))" @@ -69,6 +69,6 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index 38c0a341d..61c3daa27 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -75,7 +75,7 @@ void test_areal() test_one("intersect_holes_intersect_and_touch", intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1], 1, 23, 17.25); - + test_one("intersect_holes_new_ring", intersect_holes_new_ring[0], intersect_holes_new_ring[1], 2, 23, 122.1039); @@ -123,16 +123,16 @@ void test_areal() test_one( - "polygon_pseudo_line", - "Polygon((0 0,0 4,4 4,4 0,0 0))", - "Polygon((2 -2,2 -1,2 6,2 -2))", + "polygon_pseudo_line", + "Polygon((0 0,0 4,4 4,4 0,0 0))", + "Polygon((2 -2,2 -1,2 6,2 -2))", 5, 22, 1.1901714); // Icovist (submitted by Brandon during Formal Review) // Test the FORWARD case { - std::string tn = string_from_type::type>::name(); + std::string tn = string_from_type::type>::name(); test_one("isovist", isovist1[0], isovist1[1], 1, @@ -156,7 +156,7 @@ void test_areal_clip() { test_one("boxring", example_box, example_ring, 2, 12, 1.09125); - test_one("boxring2", example_ring,example_box, + test_one("boxring2", example_ring,example_box, 2, 12, 1.09125); test_one("boxpoly", example_box, example_polygon, @@ -192,13 +192,13 @@ void test_areal_clip() template void test_all() { - typedef boost::geometry::linestring

linestring; - typedef boost::geometry::model::polygon

polygon; - typedef boost::geometry::box

box; - typedef boost::geometry::model::segment

segment; + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; + typedef bg::model::box

box; + typedef bg::model::segment

segment; - typedef boost::geometry::model::polygon polygon_ccw; - typedef boost::geometry::model::polygon polygon_open; + typedef bg::model::polygon polygon_ccw; + typedef bg::model::polygon polygon_open; std::string clip = "box(2 2,8 8)"; @@ -274,20 +274,20 @@ void test_pointer_version() p = new test::test_point_xy; p->x = 0; p->y = 0; ln.push_back(p); p = new test::test_point_xy; p->x = 10; p->y = 10; ln.push_back(p); - boost::geometry::box > box; - boost::geometry::assign(box, 2, 2, 8, 8); + bg::model::box > box; + bg::assign(box, 2, 2, 8, 8); - typedef boost::geometry::linestring > output_type; + typedef bg::model::linestring > output_type; std::vector clip; - boost::geometry::intersection_inserter(box, ln, std::back_inserter(clip)); + bg::intersection_inserter(box, ln, std::back_inserter(clip)); double length = 0; int n = 0; for (std::vector::const_iterator it = clip.begin(); it != clip.end(); ++it) { - length += boost::geometry::length(*it); - n += boost::geometry::num_points(*it); + length += bg::length(*it); + n += bg::num_points(*it); } BOOST_CHECK_EQUAL(clip.size(), 1u); @@ -306,16 +306,13 @@ void test_pointer_version() int test_main(int, char* []) { - //test_all >(); - test_all >(); + //test_all >(); + test_all >(); -#if defined(HAVE_CLN) - test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif -#if defined(HAVE_GMP) - //test_all >(); -#endif //test_pointer_version(); return 0; } diff --git a/test/algorithms/intersection_segment.cpp b/test/algorithms/intersection_segment.cpp index b0b703fa7..1b0931385 100644 --- a/test/algorithms/intersection_segment.cpp +++ b/test/algorithms/intersection_segment.cpp @@ -20,52 +20,52 @@ #include #include -static std::ostream & operator<<(std::ostream &s, const boost::geometry::intersection_result& r) +static std::ostream & operator<<(std::ostream &s, const bg::intersection_result& r) { switch(r) { - case boost::geometry::is_intersect_no : s << "is_intersect_no"; break; - case boost::geometry::is_intersect : s << "is_intersect"; break; - case boost::geometry::is_parallel : s << "is_parallel"; break; - case boost::geometry::is_collinear_no : s << "is_collinear_no"; break; - case boost::geometry::is_collinear_one : s << "is_collinear_one"; break; - case boost::geometry::is_collinear_connect : s << "is_collinear_connect"; break; - case boost::geometry::is_collinear_overlap : s << "is_collinear_overlap"; break; - case boost::geometry::is_collinear_overlap_opposite : s << "is_collinear_overlap_opposite"; break; - case boost::geometry::is_collinear_connect_opposite : s << "is_collinear_connect_opposite"; break; + case bg::is_intersect_no : s << "is_intersect_no"; break; + case bg::is_intersect : s << "is_intersect"; break; + case bg::is_parallel : s << "is_parallel"; break; + case bg::is_collinear_no : s << "is_collinear_no"; break; + case bg::is_collinear_one : s << "is_collinear_one"; break; + case bg::is_collinear_connect : s << "is_collinear_connect"; break; + case bg::is_collinear_overlap : s << "is_collinear_overlap"; break; + case bg::is_collinear_overlap_opposite : s << "is_collinear_overlap_opposite"; break; + case bg::is_collinear_connect_opposite : s << "is_collinear_connect_opposite"; break; // detailed connection results: - case boost::geometry::is_intersect_connect_s1p1 : s << "is_intersect_connect_s1p1"; break; - case boost::geometry::is_intersect_connect_s1p2 : s << "is_intersect_connect_s1p2"; break; - case boost::geometry::is_intersect_connect_s2p1 : s << "is_intersect_connect_s2p1"; break; - case boost::geometry::is_intersect_connect_s2p2 : s << "is_intersect_connect_s2p2"; break; + case bg::is_intersect_connect_s1p1 : s << "is_intersect_connect_s1p1"; break; + case bg::is_intersect_connect_s1p2 : s << "is_intersect_connect_s1p2"; break; + case bg::is_intersect_connect_s2p1 : s << "is_intersect_connect_s2p1"; break; + case bg::is_intersect_connect_s2p2 : s << "is_intersect_connect_s2p2"; break; } return s; } -static std::string as_string(const boost::geometry::intersection_result& r) +static std::string as_string(const bg::intersection_result& r) { std::stringstream out; out << r; return out.str(); } -typedef boost::geometry::point P; -typedef boost::geometry::const_segment

S; +typedef bg::model::point P; +typedef bg::const_segment

S; static void test_intersection(double s1x1, double s1y1, double s1x2, double s1y2, double s2x1, double s2y1, double s2x2, double s2y2, // Expected results - boost::geometry::intersection_result expected_result, + bg::intersection_result expected_result, int exptected_count, const P& exp_p1, const P& exp_p2) { S s1(P(s1x1, s1y1), P(s1x2, s1y2)); S s2(P(s2x1, s2y1), P(s2x2, s2y2)); std::vector

ip; double ra, rb; - boost::geometry::intersection_result r = boost::geometry::intersection_s(s1, s2, ra, rb, ip); - r = boost::geometry::intersection_connect_result(r, ra, rb); + bg::intersection_result r = bg::intersection_s(s1, s2, ra, rb, ip); + r = bg::intersection_connect_result(r, ra, rb); BOOST_CHECK_EQUAL(ip.size(), exptected_count); BOOST_CHECK_EQUAL(as_string(expected_result), as_string(r)); @@ -99,31 +99,31 @@ static void test_intersection(double s1x1, double s1y1, double s1x2, double s1y2 int test_main( int , char* [] ) { // Identical cases - test_intersection(0,0, 1,1, 0,0, 1,1, boost::geometry::is_collinear_overlap, 2, P(0,0), P(1,1)); - test_intersection(1,1, 0,0, 0,0, 1,1, boost::geometry::is_collinear_overlap_opposite, 2, P(1,1), P(0,0)); - test_intersection(0,1, 0,2, 0,1, 0,2, boost::geometry::is_collinear_overlap, 2, P(0,1), P(0,2)); // Vertical - test_intersection(0,2, 0,1, 0,1, 0,2, boost::geometry::is_collinear_overlap_opposite, 2, P(0,2), P(0,1)); // Vertical + test_intersection(0,0, 1,1, 0,0, 1,1, bg::is_collinear_overlap, 2, P(0,0), P(1,1)); + test_intersection(1,1, 0,0, 0,0, 1,1, bg::is_collinear_overlap_opposite, 2, P(1,1), P(0,0)); + test_intersection(0,1, 0,2, 0,1, 0,2, bg::is_collinear_overlap, 2, P(0,1), P(0,2)); // Vertical + test_intersection(0,2, 0,1, 0,1, 0,2, bg::is_collinear_overlap_opposite, 2, P(0,2), P(0,1)); // Vertical // Overlap cases - test_intersection(0,0, 1,1, -0.5,-0.5, 2,2, boost::geometry::is_collinear_overlap, 2, P(0,0), P(1,1)); - test_intersection(0,0, 1,1, 0.5,0.5, 1.5,1.5, boost::geometry::is_collinear_overlap, 2, P(0.5,0.5), P(1,1)); - test_intersection(0,0, 0,1, 0,-10, 0,10, boost::geometry::is_collinear_overlap, 2, P(0,0), P(0,1)); // Vertical - test_intersection(0,0, 0,1, 0,10, 0,-10, boost::geometry::is_collinear_overlap_opposite, 2, P(0,0), P(0,1)); // Vertical - test_intersection(0,0, 1,1, 1,1, 2,2, boost::geometry::is_collinear_connect, 1, P(1,1), P(0,0)); // Single point + test_intersection(0,0, 1,1, -0.5,-0.5, 2,2, bg::is_collinear_overlap, 2, P(0,0), P(1,1)); + test_intersection(0,0, 1,1, 0.5,0.5, 1.5,1.5, bg::is_collinear_overlap, 2, P(0.5,0.5), P(1,1)); + test_intersection(0,0, 0,1, 0,-10, 0,10, bg::is_collinear_overlap, 2, P(0,0), P(0,1)); // Vertical + test_intersection(0,0, 0,1, 0,10, 0,-10, bg::is_collinear_overlap_opposite, 2, P(0,0), P(0,1)); // Vertical + test_intersection(0,0, 1,1, 1,1, 2,2, bg::is_collinear_connect, 1, P(1,1), P(0,0)); // Single point // Colinear, non overlap cases - test_intersection(0,0, 1,1, 1.5,1.5, 2.5,2.5, boost::geometry::is_collinear_no, 0, P(0,0), P(0,0)); - test_intersection(0,0, 0,1, 0,5, 0,6, boost::geometry::is_collinear_no, 0, P(0,0), P(0,0)); // Vertical + test_intersection(0,0, 1,1, 1.5,1.5, 2.5,2.5, bg::is_collinear_no, 0, P(0,0), P(0,0)); + test_intersection(0,0, 0,1, 0,5, 0,6, bg::is_collinear_no, 0, P(0,0), P(0,0)); // Vertical // Parallel cases - test_intersection(0,0, 1,1, 1,0, 2,1, boost::geometry::is_parallel, 0, P(0,0), P(0,1)); + test_intersection(0,0, 1,1, 1,0, 2,1, bg::is_parallel, 0, P(0,0), P(0,1)); // Intersect cases - test_intersection(0,2, 4,2, 3,0, 3,4, boost::geometry::is_intersect, 1, P(3,2), P(0,0)); + test_intersection(0,2, 4,2, 3,0, 3,4, bg::is_intersect, 1, P(3,2), P(0,0)); // Non intersect cases // Single point cases - test_intersection(0,0, 0,0, 1,1, 2,2, boost::geometry::is_collinear_no, 0, P(1,1), P(0,0)); // Colinear/no - test_intersection(2,2, 2,2, 1,1, 3,3, boost::geometry::is_collinear_one, 1, P(2,2.01), P(0,0)); // On segment - test_intersection(1,1, 3,3, 2,2, 2,2, boost::geometry::is_collinear_one, 1, P(2,2), P(0,0)); // On segment - test_intersection(1,1, 3,3, 1,1, 1,1, boost::geometry::is_collinear_one, 1, P(1,1), P(0,0)); // On segment, start - test_intersection(1,1, 3,3, 3,3, 3,3, boost::geometry::is_collinear_one, 1, P(3,3), P(0,0)); // On segment, end + test_intersection(0,0, 0,0, 1,1, 2,2, bg::is_collinear_no, 0, P(1,1), P(0,0)); // Colinear/no + test_intersection(2,2, 2,2, 1,1, 3,3, bg::is_collinear_one, 1, P(2,2.01), P(0,0)); // On segment + test_intersection(1,1, 3,3, 2,2, 2,2, bg::is_collinear_one, 1, P(2,2), P(0,0)); // On segment + test_intersection(1,1, 3,3, 1,1, 1,1, bg::is_collinear_one, 1, P(1,1), P(0,0)); // On segment, start + test_intersection(1,1, 3,3, 3,3, 3,3, bg::is_collinear_one, 1, P(3,3), P(0,0)); // On segment, end return 0; } diff --git a/test/algorithms/intersects.cpp b/test/algorithms/intersects.cpp index 8124878f5..4e588e051 100644 --- a/test/algorithms/intersects.cpp +++ b/test/algorithms/intersects.cpp @@ -23,10 +23,10 @@ void test_all() // intersect <=> ! disjoint // so most tests are done in disjoint test. // We only test compilation of one case. - test_geometry >("POINT(1 1)", "BOX(0 0,2 2)", true); + test_geometry >("POINT(1 1)", "BOX(0 0,2 2)", true); // self-intersecting is not tested in disjoint, so that is done here. - typedef boost::geometry::polygon

polygon; + typedef bg::model::polygon

polygon; // Just a normal polygon test_self_intersects("POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", false); @@ -70,13 +70,10 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); + test_all >(); -#if defined(HAVE_CLN) - //test_all >(); -#endif -#if defined(HAVE_GMP) - //test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/is_convex.cpp b/test/algorithms/is_convex.cpp index 48a7fdb4f..75ed256b5 100644 --- a/test/algorithms/is_convex.cpp +++ b/test/algorithms/is_convex.cpp @@ -36,20 +36,20 @@ void test_geometry(std::string const& wkt, { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); - typedef typename boost::geometry::point_type::type P; - typename boost::geometry::strategy_side + typedef typename bg::point_type::type P; + typename bg::strategy_side < - typename boost::geometry::cs_tag

::type + typename bg::cs_tag

::type >::type side; boost::ignore_unused_variable_warning(side); - typedef typename boost::geometry::range_type::type range_type; + typedef typename bg::range_type::type range_type; typedef typename boost::range_const_iterator::type iterator; - range_type const& range = boost::geometry::as_range(geometry); + range_type const& range = bg::as_range(geometry); iterator it1 = boost::begin(range); iterator it3 = it1++; @@ -77,30 +77,30 @@ void test_geometry(std::string const& wkt, std::cout << " " << (*it3) - << " " << boost::geometry::wkt(*it2) - << " " << boost::geometry::wkt(*it1) + << " " << bg::wkt(*it2) + << " " << bg::wkt(*it1) << " " << s << std::endl; } - std::cout << boost::geometry::area(geometry) << " " << boost::geometry::wkt(geometry) << std::endl; + std::cout << bg::area(geometry) << " " << bg::wkt(geometry) << std::endl; } template void test_all() { // rectangular, with concavity - test_geometry >( + test_geometry >( "polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))", 9, 5, 12.0); // concavity at start/closing point - test_geometry >( + test_geometry >( "polygon((1 1,0 2,3 3,1 0,1 1))", 9, 5, 12.0); // from sample polygon, with concavity - test_geometry >( + test_geometry >( "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0" ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", 12, 8, 5.245); @@ -108,17 +108,12 @@ void test_all() int test_main(int, char* []) { - //test_all >(); - //test_all >(); - test_all >(); + //test_all >(); + //test_all >(); + test_all >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - // GMP compiles but gives errors in results - // TODO: find out what's going wrong here - // test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/length.cpp b/test/algorithms/length.cpp index a8010d3a7..6c6077dc7 100644 --- a/test/algorithms/length.cpp +++ b/test/algorithms/length.cpp @@ -7,13 +7,10 @@ #include - #include #include - - template void test_all() { @@ -21,24 +18,21 @@ void test_all() test_geometry >("LINESTRING(0 0,3 4)", 5); // 3-4-5 plus 1-1 - test_geometry >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0)); + test_geometry >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0)); // Geometries with length zero test_geometry

("POINT(0 0)", 0); - test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0); + test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0); } int test_main(int, char* []) { - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/make.cpp b/test/algorithms/make.cpp index 071a82176..b4aef1f0a 100644 --- a/test/algorithms/make.cpp +++ b/test/algorithms/make.cpp @@ -19,47 +19,44 @@ #include -using namespace boost::geometry; - template void test_point_2d() { - P p = make

((T) 123, (T) 456); - BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 123, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 456, 1.0e-6); - + P p = bg::make

((T) 123, (T) 456); + BOOST_CHECK_CLOSE( ((double) bg::get<0>(p)), (double) 123, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<1>(p)), (double) 456, 1.0e-6); } template void test_point_3d() { - P p = make

((T) 123, (T) 456, (T) 789); - BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 123, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 456, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get<2>(p)), (double) 789, 1.0e-6); + P p = bg::make

((T) 123, (T) 456, (T) 789); + BOOST_CHECK_CLOSE( ((double) bg::get<0>(p)), (double) 123, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<1>(p)), (double) 456, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<2>(p)), (double) 789, 1.0e-6); } template void test_box_2d() { - typedef box

B; - B b = make((T) 123, (T) 456, (T) 789, (T) 1011); - BOOST_CHECK_CLOSE( ((double) get(b)), (double) 123, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get(b)), (double) 456, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get(b)), (double) 789, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get(b)), (double) 1011, 1.0e-6); + typedef bg::model::box

B; + B b = bg::make((T) 123, (T) 456, (T) 789, (T) 1011); + BOOST_CHECK_CLOSE( ((double) bg::get(b)), (double) 123, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get(b)), (double) 456, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get(b)), (double) 789, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get(b)), (double) 1011, 1.0e-6); - b = make_inverse(); + b = bg::make_inverse(); } template void test_linestring_2d() { - typedef linestring

L; + typedef bg::model::linestring

L; T coors[][2] = {{1,2}, {3,4}}; - L line = make(coors); + L line = bg::make(coors); BOOST_CHECK_EQUAL(line.size(), 2u); } @@ -67,11 +64,11 @@ void test_linestring_2d() template void test_linestring_3d() { - typedef linestring

L; + typedef bg::model::linestring

L; T coors[][3] = {{1,2,3}, {4,5,6}}; - L line = make(coors); + L line = bg::make(coors); BOOST_CHECK_EQUAL(line.size(), 2u); //std::cout << dsv(line) << std::endl; @@ -114,12 +111,12 @@ int test_main(int, char* []) //test_2d(); //test_2d(); //test_2d(); - test_2d >(); - test_2d >(); - test_2d >(); + test_2d >(); + test_2d >(); + test_2d >(); - test_3d >(); + test_3d >(); return 0; } diff --git a/test/algorithms/overlaps.cpp b/test/algorithms/overlaps.cpp index 7e9a73fd0..301ba0397 100644 --- a/test/algorithms/overlaps.cpp +++ b/test/algorithms/overlaps.cpp @@ -24,44 +24,41 @@ void test_2d() test_geometry("POINT(1 1)", "POINT(1 1)", true); #endif - test_geometry, boost::geometry::box

>("BOX(1 1, 3 3)", "BOX(0 0,2 2)", true); + test_geometry, bg::model::box

>("BOX(1 1, 3 3)", "BOX(0 0,2 2)", true); // touch -> false - test_geometry, boost::geometry::box

>("BOX(1 1, 3 3)", "BOX(3 3,5 5)", false); + test_geometry, bg::model::box

>("BOX(1 1, 3 3)", "BOX(3 3,5 5)", false); // disjoint -> false - test_geometry, boost::geometry::box

>("BOX(1 1, 3 3)", "BOX(4 4,6 6)", false); + test_geometry, bg::model::box

>("BOX(1 1, 3 3)", "BOX(4 4,6 6)", false); // within -> false - test_geometry, boost::geometry::box

>("BOX(1 1, 5 5)", "BOX(2 2,3 3)", false); + test_geometry, bg::model::box

>("BOX(1 1, 5 5)", "BOX(2 2,3 3)", false); // within+touch -> false - test_geometry, boost::geometry::box

>("BOX(1 1, 5 5)", "BOX(2 2,5 5)", false); + test_geometry, bg::model::box

>("BOX(1 1, 5 5)", "BOX(2 2,5 5)", false); } template void test_3d() { - test_geometry, boost::geometry::box

>("BOX(1 1 1, 3 3 3)", "BOX(0 0 0,2 2 2)", true); - test_geometry, boost::geometry::box

>("BOX(1 1 1, 3 3 3)", "BOX(3 3 3,5 5 5)", false); - test_geometry, boost::geometry::box

>("BOX(1 1 1, 3 3 3)", "BOX(4 4 4,6 6 6)", false); + test_geometry, bg::model::box

>("BOX(1 1 1, 3 3 3)", "BOX(0 0 0,2 2 2)", true); + test_geometry, bg::model::box

>("BOX(1 1 1, 3 3 3)", "BOX(3 3 3,5 5 5)", false); + test_geometry, bg::model::box

>("BOX(1 1 1, 3 3 3)", "BOX(4 4 4,6 6 6)", false); } int test_main( int , char* [] ) { - test_2d >(); - test_2d >(); + test_2d >(); + test_2d >(); -#if defined(HAVE_CLN) - test_2d >(); -#endif -#if defined(HAVE_GMP) - test_2d >(); +#if defined(HAVE_TTMATH) + test_2d >(); #endif - //test_3d >(); + //test_3d >(); return 0; } diff --git a/test/algorithms/overlay/assemble.cpp b/test/algorithms/overlay/assemble.cpp index 54a449d69..c73e8de34 100644 --- a/test/algorithms/overlay/assemble.cpp +++ b/test/algorithms/overlay/assemble.cpp @@ -36,7 +36,6 @@ template inline void test_assemble(std::string const& id, Geometry const& p, Geometry const& q) { - namespace bg = boost::geometry; std::vector u, i; bg::union_inserter(p, q, std::back_inserter(u)); @@ -95,7 +94,6 @@ inline void test_assemble(std::string const& id, Geometry const& p, Geometry con template inline bool int_ok(Polygon const& poly) { - namespace bg = boost::geometry; typename bg::point_type::type const& pi = bg::interior_rings(poly)[0].front(); @@ -107,7 +105,6 @@ inline bool int_ok(Polygon const& poly) void generate() { - namespace bg = boost::geometry; static std::string exteriors[4] = { "(0 0,0 10,10 10,10 0,0 0)", @@ -132,13 +129,13 @@ void generate() std::string ps = "POLYGON(" + exteriors[pe] + "," + interiors[pi] + ")"; std::string qs = "POLYGON(" + exteriors[qe] + "," + interiors[qi] + ")"; - bg::polygon_2d p, q; + bg::model::polygon_2d p, q; bg::read_wkt(ps, p); bg::read_wkt(qs, q); bg::correct(p); bg::correct(q); - if (! intersects(p) - && ! intersects(q) + if (! bg::intersects(p) + && ! bg::intersects(q) && int_ok(p) && int_ok(q) ) diff --git a/test/algorithms/overlay/ccw_traverse.cpp b/test/algorithms/overlay/ccw_traverse.cpp index 8ac35b363..3bd32c490 100644 --- a/test/algorithms/overlay/ccw_traverse.cpp +++ b/test/algorithms/overlay/ccw_traverse.cpp @@ -14,13 +14,14 @@ # include #endif +#include + #include -namespace bg = boost::geometry; template -inline typename bg::coordinate_type::type intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name, +inline typename bg::coordinate_type::type intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name, bg::detail::overlay::operation_type op) { typedef typename bg::strategy_side @@ -31,14 +32,14 @@ inline typename bg::coordinate_type::type intersect(Geometry1 const& typedef bg::detail::overlay::traversal_turn_info < - typename boost::geometry::point_type::type + typename bg::point_type::type > turn_info; std::vector turns; bg::detail::get_turns::no_interrupt_policy policy; bg::get_turns(g1, g2, turns, policy); - bool const reverse = + bool const reverse = bg::point_order::value == bg::counterclockwise || bg::point_order::value == bg::counterclockwise; if (reverse) @@ -48,7 +49,7 @@ inline typename bg::coordinate_type::type intersect(Geometry1 const& bg::enrich_intersection_points(turns, bg::detail::overlay::operation_intersection, g1, g2, side_strategy_type()); - typedef bg::linear_ring::type> ring_type; + typedef bg::model::linear_ring::type> ring_type; typedef std::vector out_vector; out_vector v; @@ -70,7 +71,7 @@ inline typename bg::coordinate_type::type intersect(Geometry1 const& #if defined(TEST_WITH_SVG) { std::ostringstream filename; - filename + filename << name << "_" << (op == bg::detail::overlay::operation_intersection ? "i" : "u") << (reverse ? "_ccw" : "") @@ -94,7 +95,7 @@ inline typename bg::coordinate_type::type intersect(Geometry1 const& mapper.map(ring, "fill-opacity:0.3;stroke-opacity:0.4;fill:rgb(255,255,0);" "stroke:rgb(255,0,255);stroke-width:8"); } - + // turn points in orange, + enrichment/traversal info @@ -121,7 +122,7 @@ inline typename bg::coordinate_type::type intersect(Geometry1 const& std::ostringstream out; out << index - << ": " << bg::method_char(turn.method) + << ": " << bg::method_char(turn.method) << std::endl << "op: " << bg::operation_char(turn.operations[0].operation) << " / " << bg::operation_char(turn.operations[1].operation) @@ -169,7 +170,7 @@ inline typename bg::coordinate_type::type intersect(Geometry1 const& } template -inline typename bg::coordinate_type::type intersect(std::string const& wkt1, std::string const& wkt2, std::string const& name, +inline typename bg::coordinate_type::type intersect(std::string const& wkt1, std::string const& wkt2, std::string const& name, bg::detail::overlay::operation_type op) { Geometry1 geometry1; @@ -187,7 +188,7 @@ inline typename bg::coordinate_type::type intersect(std::string const template inline void test_polygon(std::string const& wkt1, std::string const& wkt2, std::string const& name) { - typedef bg::point_xy point; + typedef bg::model::point_xy point; typedef bg::model::polygon clock; typedef bg::model::polygon counter; @@ -204,8 +205,8 @@ inline void test_polygon(std::string const& wkt1, std::string const& wkt2, std:: template inline void test_box_polygon(std::string const& wkt1, std::string const& wkt2, std::string const& name) { - typedef bg::point_xy point; - typedef bg::box box; + typedef bg::model::point_xy point; + typedef bg::model::box box; typedef bg::model::polygon clock; typedef bg::model::polygon counter; @@ -227,7 +228,7 @@ int test_main(int, char* []) test_polygon(case_7[0], case_7[1], "c7"); test_polygon(case_8[0], case_8[1], "c8"); test_polygon(case_9[0], case_9[1], "c9" /*, ig */); - + test_polygon(case_10[0], case_10[1], "c10"); test_polygon(case_11[0], case_11[1], "c11"); @@ -310,4 +311,4 @@ int test_main(int, char* []) } return 0; -} +} diff --git a/test/algorithms/overlay/dissolver.cpp b/test/algorithms/overlay/dissolver.cpp index e3a7f9c54..1ceeaaaad 100644 --- a/test/algorithms/overlay/dissolver.cpp +++ b/test/algorithms/overlay/dissolver.cpp @@ -34,7 +34,6 @@ void test_dissolve_plusmin(std::string const& caseid, Collection const& input, T const& expected_positive_area, T const& expected_negative_area) { - namespace bg = boost::geometry; typedef typename boost::range_value::type geometry_type; typedef typename bg::point_type::type point_type; @@ -102,7 +101,6 @@ void test_geometry(std::string const& caseid, std::string const& wkt, T const& expected_positive_area, T const& expected_negative_area = T()) { - namespace bg = boost::geometry; MultiPolygon multi_polygon; bg::read_wkt(wkt, multi_polygon); @@ -160,9 +158,8 @@ void test_geometry(std::string const& caseid, std::string const& wkt, template void test_all() { - namespace bg = boost::geometry; - typedef bg::polygon polygon; - typedef bg::multi_polygon multi_polygon; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; test_geometry("simplex_one", "MULTIPOLYGON(((0 0,1 4,4 1,0 0)))", @@ -212,7 +209,7 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/overlay/enrich_intersection_points.cpp b/test/algorithms/overlay/enrich_intersection_points.cpp index 9beafed59..728bd121f 100644 --- a/test/algorithms/overlay/enrich_intersection_points.cpp +++ b/test/algorithms/overlay/enrich_intersection_points.cpp @@ -43,14 +43,14 @@ struct test_enrich_intersection_points { //std::cout << "#" << id << std::endl; - typedef boost::geometry::detail::intersection::intersection_point - ::type> ip; + typedef bg::detail::intersection::intersection_point + ::type> ip; typedef typename boost::range_const_iterator >::type iterator; std::vector ips; - boost::geometry::get_intersection_points(g1, g2, ips); - boost::geometry::merge_intersection_points(ips); - boost::geometry::enrich_intersection_points(ips, true); + bg::get_intersection_points(g1, g2, ips); + bg::merge_intersection_points(ips); + bg::enrich_intersection_points(ips, true); std::ostringstream out; out << std::setprecision(2); @@ -78,7 +78,7 @@ struct test_enrich_intersection_points std::ofstream svg(filename.str().c_str()); - boost::geometry::svg_mapper::type> mapper(svg, 500, 500); + bg::svg_mapper::type> mapper(svg, 500, 500); mapper.add(g1); mapper.add(g2); @@ -171,8 +171,8 @@ int test_main(int, char* []) // ticket#17 expected.push_back(boost::make_tuple(6, "LR,RL,LR,RL,RL,LR")); - //test_all, test_enrich_intersection_points>(expected); - test_all, test_enrich_intersection_points>(expected); + //test_all, test_enrich_intersection_points>(expected); + test_all, test_enrich_intersection_points>(expected); //test_all, test_enrich_intersection_points>(expected); */ diff --git a/test/algorithms/overlay/get_turn_info.cpp b/test/algorithms/overlay/get_turn_info.cpp index d566b5ac1..636be6ed6 100644 --- a/test/algorithms/overlay/get_turn_info.cpp +++ b/test/algorithms/overlay/get_turn_info.cpp @@ -28,12 +28,11 @@ template void test_with_point(std::string const& caseid, T pi_x, T pi_y, T pj_x, T pj_y, T pk_x, T pk_y, T qi_x, T qi_y, T qj_x, T qj_y, T qk_x, T qk_y, - boost::geometry::detail::overlay::method_type expected_method, + bg::detail::overlay::method_type expected_method, T ip_x, T ip_y, std::string const& expected, T ip_x2, T ip_y2) { - namespace bg = boost::geometry; P pi = bg::make

(pi_x, pi_y); P pj = bg::make

(pj_x, pj_y); P pk = bg::make

(pk_x, pk_y); @@ -53,7 +52,7 @@ void test_with_point(std::string const& caseid, if (info.size() == 0) { BOOST_CHECK_EQUAL(expected_method, - boost::geometry::detail::overlay::method_none); + bg::detail::overlay::method_none); } std::string detected; @@ -99,7 +98,7 @@ void test_with_point(std::string const& caseid, { std::ostringstream filename; filename << "get_turn_info_" << caseid - << "_" << string_from_type::type>::name() + << "_" << string_from_type::type>::name() << ".svg"; std::ofstream svg(filename.str().c_str()); @@ -108,8 +107,8 @@ void test_with_point(std::string const& caseid, mapper.add(bg::make

(0, 0)); mapper.add(bg::make

(10, 10)); - bg::linestring

p; p.push_back(pi); p.push_back(pj); p.push_back(pk); - bg::linestring

q; q.push_back(qi); q.push_back(qj); q.push_back(qk); + bg::model::linestring

p; p.push_back(pi); p.push_back(pj); p.push_back(pk); + bg::model::linestring

q; q.push_back(qi); q.push_back(qj); q.push_back(qk); mapper.map(p, "opacity:0.8;stroke:rgb(0,192,0);stroke-width:3"); mapper.map(q, "opacity:0.8;stroke:rgb(0,0,255);stroke-width:3"); @@ -164,8 +163,8 @@ template void test_both(std::string const& caseid, T pi_x, T pi_y, T pj_x, T pj_y, T pk_x, T pk_y, T qi_x, T qi_y, T qj_x, T qj_y, T qk_x, T qk_y, - boost::geometry::detail::overlay::method_type method - = boost::geometry::detail::overlay::method_none, + bg::detail::overlay::method_type method + = bg::detail::overlay::method_none, T ip_x = -1, T ip_y = -1, std::string const& expected = "", T ip_x2 = -1, T ip_y2 = -1) @@ -198,7 +197,7 @@ void test_both(std::string const& caseid, template void test_all() { - using namespace boost::geometry::detail::overlay; + using namespace bg::detail::overlay; // See powerpoint "doc/testcases/get_turn_info.ppt" @@ -804,7 +803,7 @@ void test_all() /*** TODO, work this out further / check this - // Case where + // Case where test_both("issue_buffer_mill", 5.1983614873206241 , 6.7259025813913107 , 5.0499999999999998 , 6.4291796067500622 , 5.1983614873206241 , 6.7259025813913107, // p 5.0499999999999998 , 6.4291796067500622 , 5.0499999999999998 , 6.4291796067500622 , 5.1983614873206241 , 6.7259025813913107, // q @@ -822,22 +821,22 @@ void test_all() template void test2(G const& geometry) { - typedef typename boost::geometry::point_type::type P; - typedef typename boost::geometry::tag::type T; - typedef typename boost::geometry::tag

::type PT; + typedef typename bg::point_type::type P; + typedef typename bg::tag::type T; + typedef typename bg::tag

::type PT; std::cout << typeid(G).name() << std::endl; std::cout << typeid(T).name() << std::endl; std::cout << typeid(P).name() << std::endl; std::cout << typeid(PT).name() << std::endl; - std::cout << boost::geometry::length(geometry) << std::endl; + std::cout << bg::length(geometry) << std::endl; - typedef boost::geometry::point P2; - boost::geometry::linestring out; - boost::geometry::strategy::transform::scale_transformer scaler(5); - boost::geometry::transform(geometry, out, scaler); - std::cout << boost::geometry::dsv(out) << std::endl; + typedef bg::model::point P2; + bg::model::linestring out; + bg::strategy::transform::scale_transformer scaler(5); + bg::transform(geometry, out, scaler); + std::cout << bg::dsv(out) << std::endl; } void test_f3() @@ -852,6 +851,6 @@ void test_f3() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/overlay/get_turns.cpp b/test/algorithms/overlay/get_turns.cpp index e28639c2b..52ba9ddbc 100644 --- a/test/algorithms/overlay/get_turns.cpp +++ b/test/algorithms/overlay/get_turns.cpp @@ -29,7 +29,7 @@ // To test that "get_turns" can be called using additional information template -struct my_turn_op : public boost::geometry::detail::overlay::turn_operation +struct my_turn_op : public bg::detail::overlay::turn_operation { }; @@ -41,10 +41,9 @@ struct test_get_turns boost::tuple const& expected_count_and_center, G1 const& g1, G2 const& g2, double precision) { - namespace bg = boost::geometry; - typedef bg::detail::overlay::turn_info + typedef bg::detail::overlay::turn_info < - typename boost::geometry::point_type::type + typename bg::point_type::type > turn_info; std::vector turns; @@ -118,10 +117,10 @@ struct test_get_turns template void test_all() { - typedef boost::geometry::point P; - typedef boost::geometry::polygon

polygon; - typedef boost::geometry::linestring

linestring; - typedef boost::geometry::box

box; + typedef bg::model::point P; + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + typedef bg::model::box

box; // Expected count, average x, average y typedef boost::tuple Tuple; @@ -258,16 +257,16 @@ void test_all() template void test_ccw() { - typedef boost::geometry::point P; - typedef boost::geometry::model::polygon polygon; + typedef bg::model::point P; + typedef bg::model::polygon polygon; typedef boost::tuple Tuple; - test_overlay("ccw_1", - boost::make_tuple(6), + test_overlay("ccw_1", + boost::make_tuple(6), ccw_case_1[0], ccw_case_1[1]); - test_overlay("ccw_9", + test_overlay("ccw_9", boost::make_tuple(1), case_9[0], case_9[1]); @@ -276,15 +275,15 @@ void test_ccw() template void test_open() { - typedef boost::geometry::point P; - typedef boost::geometry::model::polygon polygon; + typedef bg::model::point P; + typedef bg::model::polygon polygon; typedef boost::tuple Tuple; - test_overlay("open_1", - boost::make_tuple(6), + test_overlay("open_1", + boost::make_tuple(6), open_case_1[0], open_case_1[1]); - test_overlay("open_9", + test_overlay("open_9", boost::make_tuple(1), open_case_9[0], open_case_9[1]); } @@ -302,11 +301,9 @@ int test_main(int, char* []) #if ! defined(_MSC_VER) test_all(); #endif -#if defined(HAVE_CLN) - //test_all(); -#endif -#if defined(HAVE_GMP) - //test_all(); + +#if defined(HAVE_TTMATH) + test_all(); #endif return 0; } diff --git a/test/algorithms/overlay/overlay_cases.hpp b/test/algorithms/overlay/overlay_cases.hpp index e5146d9f4..2c3adc31c 100644 --- a/test/algorithms/overlay/overlay_cases.hpp +++ b/test/algorithms/overlay/overlay_cases.hpp @@ -403,6 +403,14 @@ static std::string pie_23_21_12_500[2] = { "POLYGON((2500 3000,2500 1875,2208 1913,1937 2025,1704 2204,1525 2437,1413 2708,1375 3000,1413 3291,1525 3562,1704 3795,1937 3974,2208 4086,2499 4125,2791 4086,3062 3974,3295 3795,3474 3562,3586 3291,3625 3000,3586 2708,3474 2437,2500 3000))" }; +// Self-tangent pies (but as single-polygon, this one is NOT VALID and (therefore) (currently) NOT WORKING) +static std::string pie_5_12_12_0_7s[2] = +{ + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,2500 2500))", + "POLYGON((2500 2500,2500 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,1413 2791,1525 3062,1704 3295,1937 3474,2208 3586,2500 2500,2791 3586,3062 3474,3295 3295,3474 3062,3586 2791,3625 2500,3586 2208,2500 2500))" +}; + + // Cases coming from High volume (hv) tests static std::string hv_1[2] = { "POLYGON((24.995166778564453 50.011310577392578,46.630809783935547 37.494682312011719,46.661380767822266 12.499360084533691,25.003841400146484 0.020658308640122414,3.3419711589813232 12.491842269897461,3.3638687133789062 37.487174987792969,24.995166778564453 50.011310577392578))", diff --git a/test/algorithms/overlay/overlay_common.hpp b/test/algorithms/overlay/overlay_common.hpp index 6d3e6124b..752673522 100644 --- a/test/algorithms/overlay/overlay_common.hpp +++ b/test/algorithms/overlay/overlay_common.hpp @@ -45,13 +45,13 @@ void test_overlay(std::string const& id, T const& expected, } G1 g1; - boost::geometry::read_wkt(wkt1, g1); + bg::read_wkt(wkt1, g1); G2 g2; - boost::geometry::read_wkt(wkt2, g2); + bg::read_wkt(wkt2, g2); - //std::cout << boost::geometry::wkt(g1) << std::endl; - //std::cout << boost::geometry::wkt(g2) << std::endl; + //std::cout << bg::wkt(g1) << std::endl; + //std::cout << bg::wkt(g2) << std::endl; // Try the overlay-function in both ways std::string caseid = id; @@ -83,9 +83,9 @@ void test_overlay(std::string const& id, T const& expected, template void test_all(std::vector const& expected) { - typedef boost::geometry::polygon

polygon; - typedef boost::geometry::linestring

linestring; - typedef boost::geometry::box

box; + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + typedef bg::model::box

box; // compilation test only, will not output //test_overlay("", "", "", ""); diff --git a/test/algorithms/overlay/relative_order.cpp b/test/algorithms/overlay/relative_order.cpp index 5db470b0d..26fdb25e1 100644 --- a/test/algorithms/overlay/relative_order.cpp +++ b/test/algorithms/overlay/relative_order.cpp @@ -30,7 +30,6 @@ void test_with_point(std::string const& caseid, T si_x, T si_y, T sj_x, T sj_y, int expected_order) { - namespace bg = boost::geometry; P pi = bg::make

(pi_x, pi_y); P pj = bg::make

(pj_x, pj_y); P ri = bg::make

(ri_x, ri_y); @@ -60,7 +59,7 @@ void test_with_point(std::string const& caseid, { std::ostringstream filename; filename << "get_turn_info_" << caseid - << "_" << string_from_type::type>::name() + << "_" << string_from_type::type>::name() << ".svg"; std::ofstream svg(filename.str().c_str()); @@ -69,8 +68,8 @@ void test_with_point(std::string const& caseid, mapper.add(bg::make

(0, 0)); mapper.add(bg::make

(10, 10)); - bg::linestring

p; p.push_back(pi); p.push_back(pj); p.push_back(pk); - bg::linestring

q; q.push_back(qi); q.push_back(qj); q.push_back(qk); + bg::model::linestring

p; p.push_back(pi); p.push_back(pj); p.push_back(pk); + bg::model::linestring

q; q.push_back(qi); q.push_back(qj); q.push_back(qk); mapper.map(p, "opacity:0.8;stroke:rgb(0,192,0);stroke-width:3"); mapper.map(q, "opacity:0.8;stroke:rgb(0,0,255);stroke-width:3"); @@ -199,6 +198,6 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/overlay/robustness/intersection_pies.cpp b/test/algorithms/overlay/robustness/intersection_pies.cpp index c13d23302..a6044ae7a 100644 --- a/test/algorithms/overlay/robustness/intersection_pies.cpp +++ b/test/algorithms/overlay/robustness/intersection_pies.cpp @@ -24,10 +24,10 @@ template inline void make_pie(Polygon& polygon, int count, int offset, int offset_y, double factor1, int total_segment_count = 36) { - typedef typename boost::geometry::point_type::type p; - typedef typename boost::geometry::select_most_precise + typedef typename bg::point_type::type p; + typedef typename bg::select_most_precise < - typename boost::geometry::coordinate_type::type, + typename bg::coordinate_type::type, long double >::type coordinate_type; @@ -35,39 +35,111 @@ inline void make_pie(Polygon& polygon, coordinate_type cx = 2500.0; coordinate_type cy = 2500.0 + offset_y; - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make

(int(cx), int(cy))); + bg::exterior_ring(polygon).push_back(bg::make

(int(cx), int(cy))); - coordinate_type dx = 5000.0; - coordinate_type dy = 5000.0; + coordinate_type const dx = 5000.0; + coordinate_type const dy = 5000.0; - coordinate_type half = 0.5; - coordinate_type two = 2.0; + coordinate_type const half = 0.5; + coordinate_type const two = 2.0; - coordinate_type a = coordinate_type(factor1) * half * dx; - coordinate_type b = coordinate_type(factor1) * half * dy; + coordinate_type const a = coordinate_type(factor1) * half * dx; + coordinate_type const b = coordinate_type(factor1) * half * dy; - coordinate_type pi = boost::math::constants::pi(); - coordinate_type delta = pi * two / total_segment_count; + coordinate_type const pi = boost::math::constants::pi(); + coordinate_type const delta = pi * two / total_segment_count; coordinate_type angle = coordinate_type(offset) * delta; for (int i = 0; i < count; i++, angle += delta) { - coordinate_type s = sin(angle); - coordinate_type c = cos(angle); - coordinate_type x = cx + a * s; - coordinate_type y = cy + b * c; - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make

(int(x), int(y))); + coordinate_type const s = sin(angle); + coordinate_type const c = cos(angle); + coordinate_type const x = cx + a * s; + coordinate_type const y = cy + b * c; + bg::exterior_ring(polygon).push_back(bg::make

(int(x), int(y))); } - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make

(int(cx), int(cy))); + bg::exterior_ring(polygon).push_back(bg::make

(int(cx), int(cy))); } +/* +sql server + +TWO INNERS +1a) select geometry::STGeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,4 6,4 4),(6 6,5 5,6 4,6 6)) ', 0).STIsValid(); -> valid +same: +1b) POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,6 4,6 6,5 5,4 6,4 4)) -> valid + +I-E tangency IET +2a) select geometry::STGeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0))', 0).STIsValid(); -> valid +same by Self tangency ST +2b) select geometry::STGeomFromText('POLYGON((0 0,0 10,10 10,10 0,5 0,6 1,4 1,5 0, 0 0))', 0).STIsValid(); -> valid + +Two inners all tangent +3a) POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0),(5 1,6 2,4 2,5 1)) -> valid + +postgis: +1a) select ST_IsValid(ST_GeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,4 6,4 4),(6 6,5 5,6 4,6 6))', 0)); -> valid +1b) POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,6 4,6 6,5 5,4 6,4 4)) -> NOT valid + +2a) POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0)) -> valid +2b) POLYGON((0 0,0 10,10 10,10 0,5 0,6 1,4 1,5 0, 0 0)) -> NOT valid (?) + +3a) POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0),(5 1,6 2,4 2,5 1)) -> valid + + +*/ + +template +inline void holify(Polygon& polygon) +{ + typedef typename bg::point_type::type point_type; + + Polygon p; + bg::exterior_ring(p).push_back(bg::make(0, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 0)); + bg::interior_rings(p).push_back(bg::exterior_ring(polygon)); + bg::correct(p); + + polygon = p; +} + +template +inline void holify_multi(MultiPolygon& multi_polygon) +{ + typedef typename bg::point_type::type point_type; + + typename boost::range_value::type p; + + bg::exterior_ring(p).push_back(bg::make(0, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 0)); + + for (int i = 0; i < multi_polygon.size(); i++) + { + bg::interior_rings(p).push_back(bg::exterior_ring(multi_polygon[i])); + } + + bg::correct(p); + + multi_polygon.clear(); + multi_polygon.push_back(p); +} + + + template -void test_pie(int total_segment_count, T factor_p, T factor_q, bool svg) +void test_pie(int total_segment_count, T factor_p, T factor_q, + bool multi, bool multi_st, bool svg) { boost::timer t; - typedef boost::geometry::point_xy point_type; - typedef boost::geometry::polygon polygon; - typedef boost::geometry::multi_polygon multi_polygon; + typedef bg::model::point_xy point_type; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; int good_count = 0; int bad_count = 0; @@ -76,6 +148,9 @@ void test_pie(int total_segment_count, T factor_p, T factor_q, bool svg) { polygon p; make_pie(p, a, 0, 0, factor_p, total_segment_count); + + holify(p); + for (int b = 2; b < total_segment_count; b++) { for (int offset = 1; offset < total_segment_count; offset++) @@ -86,42 +161,13 @@ void test_pie(int total_segment_count, T factor_p, T factor_q, bool svg) polygon q; make_pie(q, b, offset, y, factor_q, total_segment_count); - // multi-polygon: - //for (int c = o - int left = total_segment_count - b - 2; - //std::cout << a << " " << b << " " << left << std::endl; - for (int c = 2; c < left; c++) + if (! multi) { - polygon q2; - make_pie(q2, c, offset + b + 1, y, factor_q, total_segment_count); + holify(q); std::ostringstream out; - out << "pie_" << a << "_" << b << "_" << offset << "_" << y - << "_" << c - ; - - bool good = false; - bool one_with_self_tangency = false; - - // Represent as either multi-polygon, or as single-self-touching-polygon - if (one_with_self_tangency) - { - polygon q1 = q; - for (unsigned int i = 1; i < q2.outer().size(); i++) - { - q1.outer().push_back(q2.outer()[i]); - } - good = test_overlay_p_q(out.str(), p, q1, svg, 0.01); - } - else - { - multi_polygon mq; - mq.push_back(q); - mq.push_back(q2); - good = test_overlay_p_q(out.str(), p, mq, svg, 0.01); - } - - if (good) + out << "pie_" << a << "_" << b << "_" << offset << "_" << y; + if (test_overlay_p_q(out.str(), p, q, svg, 0.01)) { good_count++; } @@ -130,6 +176,52 @@ void test_pie(int total_segment_count, T factor_p, T factor_q, bool svg) bad_count++; } } + else + { + int left = total_segment_count - b - 2; + //std::cout << a << " " << b << " " << left << std::endl; + for (int c = 2; c < left; c++) + { + polygon q2; + make_pie(q2, c, offset + b + 1, y, factor_q, total_segment_count); + + std::ostringstream out; + out << "pie_" << a << "_" << b << "_" << offset << "_" << y + << "_" << c + ; + + bool good = false; + + // Represent as either multi-polygon, or as single-self-touching-polygon (INVALID) + if (multi_st) + { + polygon q1 = q; + for (unsigned int i = 1; i < q2.outer().size(); i++) + { + q1.outer().push_back(q2.outer()[i]); + } + holify(q1); + good = test_overlay_p_q(out.str(), p, q1, svg, 0.01); + } + else + { + multi_polygon mq; + mq.push_back(q); + mq.push_back(q2); + holify_multi(mq); + good = test_overlay_p_q(out.str(), p, mq, svg, 0.01); + } + + if (good) + { + good_count++; + } + else + { + bad_count++; + } + } + } } } } @@ -142,9 +234,9 @@ void test_pie(int total_segment_count, T factor_p, T factor_q, bool svg) template -void test_all(bool svg) +void test_all(bool multi, bool multi_st, bool svg) { - test_pie(24, 0.55, 0.45, svg); + test_pie(24, 0.55, 0.45, multi, multi_st, svg); } int main(int argc, char** argv) @@ -154,15 +246,8 @@ int main(int argc, char** argv) bool svg = argc > 1 && std::string(argv[1]) == std::string("svg"); //test_all(); - test_all(svg); + test_all(true, true, svg); //test_all(); - -#if defined(HAVE_CLN) - //test_all(); -#endif -#if defined(HAVE_GMP) - //test_all(); -#endif } catch(std::exception const& e) { diff --git a/test/algorithms/overlay/robustness/intersection_stars.cpp b/test/algorithms/overlay/robustness/intersection_stars.cpp index b26dccba2..07f525fb7 100644 --- a/test/algorithms/overlay/robustness/intersection_stars.cpp +++ b/test/algorithms/overlay/robustness/intersection_stars.cpp @@ -28,22 +28,16 @@ #include #include -// Two at the same time not (yet) supported -#if defined(HAVE_CLN) && defined(HAVE_GMP) -#undef HAVE_GMP -#endif - - template inline void make_star(Polygon& polygon, int count, double factor1, double factor2, long double offset = 0) { - typedef typename boost::geometry::point_type::type p; - typedef typename boost::geometry::select_most_precise + typedef typename bg::point_type::type p; + typedef typename bg::select_most_precise < - typename boost::geometry::coordinate_type::type, + typename bg::coordinate_type::type, long double >::type coordinate_type; @@ -73,10 +67,10 @@ inline void make_star(Polygon& polygon, coordinate_type c = cos(angle); coordinate_type x = cx + (even ? a1 : a2) * s; coordinate_type y = cy + (even ? b1 : b2) * c; - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make

(x, y)); + bg::exterior_ring(polygon).push_back(bg::make

(x, y)); } - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::exterior_ring(polygon).front()); + bg::exterior_ring(polygon).push_back(bg::exterior_ring(polygon).front()); } @@ -96,8 +90,8 @@ void test_star(std::string const& p_type, std::string const& c_type, << c_type << " (" << sizeof(CalculationType) << ")" << std::endl; boost::timer t; - typedef boost::geometry::point_xy point_type; - typedef boost::geometry::polygon polygon; + typedef bg::model::point_xy point_type; + typedef bg::model::polygon polygon; T area_i = 0; T area_a = 0; @@ -115,8 +109,8 @@ void test_star(std::string const& p_type, std::string const& c_type, make_star(b, p * 2 + 1, 0.5, 1.0, rotation); area_i += test_intersection(out.str(), a, b); - area_a += boost::geometry::area(a); - area_b += boost::geometry::area(b); + area_a += bg::area(a); + area_b += bg::area(b); } std::cout @@ -141,12 +135,8 @@ void test_all(std::string const& p_type, test_star(p_type, "e", p_selection, c_selection, min_points, max_points, rotation); -#if defined(HAVE_CLN) - test_star(p_type, "c", - p_selection, c_selection, min_points, max_points, rotation); -#endif -#if defined(HAVE_GMP) - test_star(p_type, "g", +#if defined(HAVE_TTMATH) + test_star(p_type, "t", p_selection, c_selection, min_points, max_points, rotation); #endif } @@ -165,12 +155,8 @@ int main(int argc, char** argv) test_all("d", p_selection, c_selection, min_points, max_points, rotation); test_all("e", p_selection, c_selection, min_points, max_points, rotation); -#if defined(HAVE_CLN) - test_all("c", - p_selection, c_selection, min_points, max_points, rotation); -#endif -#if defined(HAVE_GMP) - test_all("g", +#if defined(HAVE_TTMATH) + test_all("t", p_selection, c_selection, min_points, max_points, rotation); #endif } diff --git a/test/algorithms/overlay/robustness/random_ellipses_stars.cpp b/test/algorithms/overlay/robustness/random_ellipses_stars.cpp index c4ed08d2f..42fd7c28a 100644 --- a/test/algorithms/overlay/robustness/random_ellipses_stars.cpp +++ b/test/algorithms/overlay/robustness/random_ellipses_stars.cpp @@ -51,10 +51,10 @@ struct star_params template inline void make_star(Polygon& polygon, star_params const& p) { - typedef typename boost::geometry::point_type::type P; - typedef typename boost::geometry::select_most_precise + typedef typename bg::point_type::type P; + typedef typename bg::select_most_precise < - typename boost::geometry::coordinate_type::type, + typename bg::coordinate_type::type, long double >::type coordinate_type; @@ -83,10 +83,10 @@ inline void make_star(Polygon& polygon, star_params const& p) coordinate_type c = cos(angle); coordinate_type x = p.center_x + cx + (even ? a1 : a2) * s; coordinate_type y = p.center_y + cy + (even ? b1 : b2) * c; - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make

(x, y)); + bg::exterior_ring(polygon).push_back(bg::make

(x, y)); } - boost::geometry::exterior_ring(polygon).push_back(boost::geometry::exterior_ring(polygon).front()); + bg::exterior_ring(polygon).push_back(bg::exterior_ring(polygon).front()); } @@ -94,8 +94,8 @@ template void test_star_ellipse(int seed, int index, star_params const& par_p, star_params const& par_q, bool svg, double tolerance) { - typedef boost::geometry::point_xy point_type; - typedef boost::geometry::polygon polygon; + typedef bg::model::point_xy point_type; + typedef bg::model::polygon polygon; polygon p, q; make_star(p, par_p); @@ -184,11 +184,8 @@ int main(int argc, char** argv) test_all(seed, count, svg, 1e-3); //test_all(seed, count, svg, 1e-6); -#if defined(HAVE_CLN) - //test_star_ellipse("c", -#endif -#if defined(HAVE_GMP) - // test_star_ellipse(selection, "g"); +#if defined(HAVE_TTMATH) + // test_star_ellipse(selection, "t"); #endif } catch(std::exception const& e) diff --git a/test/algorithms/overlay/robustness/recursive_boxes.cpp b/test/algorithms/overlay/robustness/recursive_boxes.cpp index f2fac6027..c80a7dd3c 100644 --- a/test/algorithms/overlay/robustness/recursive_boxes.cpp +++ b/test/algorithms/overlay/robustness/recursive_boxes.cpp @@ -35,7 +35,6 @@ template inline void make_box(Polygon& polygon, Generator& generator) { - namespace bg = boost::geometry; typedef typename bg::point_type::type point_type; typedef typename bg::coordinate_type::type coordinate_type; @@ -67,10 +66,9 @@ inline void make_box(Polygon& polygon, Generator& generator) template bool test_recursive_boxes(MultiPolygon& result, int& index, - Generator& generator, + Generator& generator, bool svg, int level = 3) { - namespace bg = boost::geometry; MultiPolygon p, q; // Generate two boxes @@ -129,11 +127,11 @@ void test_all(int seed, int count, bool svg, int level) boost::variate_generator > coordinate_generator(generator, random_coordinate); - typedef boost::geometry::polygon + typedef bg::model::polygon < - boost::geometry::point_xy + bg::model::point_xy > polygon; - typedef boost::geometry::multi_polygon mp; + typedef bg::model::multi_polygon mp; int index = 0; @@ -143,7 +141,7 @@ void test_all(int seed, int count, bool svg, int level) test_recursive_boxes(p, index, coordinate_generator, svg, level); } std::cout - << "boxes " << index + << "boxes " << index << " type: " << string_from_type::name() << " time: " << t.elapsed() << std::endl; } @@ -163,11 +161,8 @@ int main(int argc, char** argv) //test_all(seed, count, svg, 1e-3); test_all(seed, count, svg, level); -#if defined(HAVE_CLN) - //test_recursive_boxes("c", -#endif -#if defined(HAVE_GMP) - // test_recursive_boxes(selection, "g"); +#if defined(HAVE_TTMATH) + // test_recursive_boxes(selection, "t"); #endif } catch(std::exception const& e) diff --git a/test/algorithms/overlay/robustness/test_overlay_p_q.hpp b/test/algorithms/overlay/robustness/test_overlay_p_q.hpp index 101b3a4ee..69206cd07 100644 --- a/test/algorithms/overlay/robustness/test_overlay_p_q.hpp +++ b/test/algorithms/overlay/robustness/test_overlay_p_q.hpp @@ -29,19 +29,19 @@ template -static bool test_overlay_p_q(std::string const& caseid, - G1 const& p, G2 const& q, +static bool test_overlay_p_q(std::string const& caseid, + G1 const& p, G2 const& q, bool svg, double tolerance, bool force_output = false) { bool result = true; - typedef typename boost::geometry::coordinate_type::type coordinate_type; - typedef typename boost::geometry::point_type::type point_type; - typedef boost::geometry::detail::overlay::turn_info turn_type; + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + typedef bg::detail::overlay::turn_info turn_type; - typedef boost::geometry::strategy_intersection + typedef bg::strategy_intersection < - typename boost::geometry::cs_tag::type, + typename bg::cs_tag::type, G1, G2, turn_type, @@ -50,25 +50,25 @@ static bool test_overlay_p_q(std::string const& caseid, std::vector out_i, out_u; - CalculationType area_p = boost::geometry::area(p); - CalculationType area_q = boost::geometry::area(q); + CalculationType area_p = bg::area(p); + CalculationType area_q = bg::area(q); CalculationType area_i = 0; CalculationType area_u = 0; - boost::geometry::intersection_inserter(p, q, std::back_inserter(out_i), strategy()); + bg::intersection_inserter(p, q, std::back_inserter(out_i), strategy()); for (typename std::vector::iterator it = out_i.begin(); it != out_i.end(); ++it) { - area_i += boost::geometry::area(*it); + area_i += bg::area(*it); } - boost::geometry::union_inserter(p, q, std::back_inserter(out_u), strategy()); + bg::union_inserter(p, q, std::back_inserter(out_u), strategy()); for (typename std::vector::iterator it = out_u.begin(); it != out_u.end(); ++it) { - area_u += boost::geometry::area(*it); + area_u += bg::area(*it); } double diff = (area_p + area_q) - area_u - area_i; @@ -91,8 +91,8 @@ static bool test_overlay_p_q(std::string const& caseid, << " diff: " << diff << std::endl << std::setprecision(20) - << " p: " << boost::geometry::wkt(p) << std::endl - << " q: " << boost::geometry::wkt(q) << std::endl + << " p: " << bg::wkt(p) << std::endl + << " q: " << bg::wkt(q) << std::endl ; } @@ -108,7 +108,7 @@ static bool test_overlay_p_q(std::string const& caseid, std::ofstream svg(filename.str().c_str()); - boost::geometry::svg_mapper mapper(svg, 500, 500); + bg::svg_mapper mapper(svg, 500, 500); mapper.add(p); mapper.add(q); diff --git a/test/algorithms/overlay/self_intersection_points.cpp b/test/algorithms/overlay/self_intersection_points.cpp index 1125079b1..3a9969273 100644 --- a/test/algorithms/overlay/self_intersection_points.cpp +++ b/test/algorithms/overlay/self_intersection_points.cpp @@ -37,15 +37,14 @@ struct test_self_intersection_points boost::tuple const& expected_count_and_center, Geometry const& geometry, double precision) { - namespace bg = boost::geometry; - typedef bg::detail::overlay::turn_info + typedef bg::detail::overlay::turn_info < typename bg::point_type::type > turn_info; std::vector turns; - ///boost::geometry::get_intersection_points(geometry, turns); + ///bg::get_intersection_points(geometry, turns); bg::detail::get_turns::no_interrupt_policy policy; bg::get_turns @@ -114,7 +113,7 @@ void test_self_overlay(std::string const& id, T const& expected, } Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); std::string caseid = id; @@ -130,7 +129,7 @@ void test_self_overlay(std::string const& id, T const& expected, template void test_self_all() { - typedef boost::geometry::polygon

polygon; + typedef bg::model::polygon

polygon; // Just a normal polygon test_self_overlay("1", boost::make_tuple(0, 0, 0), @@ -228,7 +227,7 @@ void test_self_all() #if ! defined(GEOMETRY_TEST_MULTI) int test_main(int, char* []) { - test_self_all >(); + test_self_all >(); return 0; } #endif diff --git a/test/algorithms/overlay/split_rings.cpp b/test/algorithms/overlay/split_rings.cpp index 51a6a7f10..a8d316879 100644 --- a/test/algorithms/overlay/split_rings.cpp +++ b/test/algorithms/overlay/split_rings.cpp @@ -30,11 +30,10 @@ struct test_split_rings { template static void apply(std::string const& id, - Geometry const& geometry, + Geometry const& geometry, int expected_ring_count, double precision) { - namespace bg = boost::geometry; typedef typename bg::ring_type::type ring_type; std::vector rings; @@ -68,8 +67,8 @@ struct test_split_rings template -void test_geometry(std::string const& caseid, - std::string const& wkt, +void test_geometry(std::string const& caseid, + std::string const& wkt, int expected_ring_count, double precision = 0.001) { if (wkt.empty()) @@ -78,7 +77,7 @@ void test_geometry(std::string const& caseid, } Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_split_rings::apply(caseid, geometry, expected_ring_count, precision); } @@ -89,29 +88,29 @@ void test_geometry(std::string const& caseid, template void test_self_all() { - typedef boost::geometry::polygon

polygon; + typedef bg::model::polygon

polygon; // Simplex - + test_geometry("1", "POLYGON((0 0,0 10,10 10,5 2,5 8,10 0,0 0))", 2); // // Many loops (e.g. as result from buffering) - test_geometry("many_loops", + test_geometry("many_loops", "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))", 3); // From "mill" (flower) - test_geometry("2", - "POLYGON((5 6.10557,3.64223 8.82111,4.28284 8.71716,2.28284 6.71716,2.17889 7.35777,4.89443 6,2.17889 4.64223,2.28284 5.28284,4.28284 3.28284,3.62547 3.14045,5 6.10557))", + test_geometry("2", + "POLYGON((5 6.10557,3.64223 8.82111,4.28284 8.71716,2.28284 6.71716,2.17889 7.35777,4.89443 6,2.17889 4.64223,2.28284 5.28284,4.28284 3.28284,3.62547 3.14045,5 6.10557))", 5); - test_geometry("3", - "POLYGON((0.6 10.4,9.4 10.4,9.4 -0.4,7.59 -0.4,4.59 5.33667,4.25383 5.6797,2.67526 4.89042,4.28284 3.28284,3.62547 3.14045,5.15 7.20587,5.15 -0.4,0.6 -0.4,0.6 10.4))", + test_geometry("3", + "POLYGON((0.6 10.4,9.4 10.4,9.4 -0.4,7.59 -0.4,4.59 5.33667,4.25383 5.6797,2.67526 4.89042,4.28284 3.28284,3.62547 3.14045,5.15 7.20587,5.15 -0.4,0.6 -0.4,0.6 10.4))", 4); - - test_geometry("4", - "POLYGON((0.6 10.4,9.4 10.4,9.4 -0.4,4.59 -0.4,4.59 5.5,4.70431 5.22003,3.93716 6.00284,5 7.06569,6.06284 6.00284,5.29569 5.22003,5.41 5.5,5.41 0.01,5.01 0.41,5.25 0.41,4.85 0.01,4.85 7.20587,6.37453 3.14045,5.71716 3.28284,7.71716 5.28284,7.82111 4.64223,5.10557 6,7.82111 7.35777,7.71716 6.71716,5.71716 8.71716,6.35777 8.82111,5 6.10557,3.64223 8.82111,4.28284 8.71716,2.28284 6.71716,2.17889 7.35777,4.89443 6,2.17889 4.64223,2.28284 5.28284,4.28284 3.28284,3.62547 3.14045,5.15 7.20587,5.15 -0.4,0.6 -0.4,0.6 10.4))", + + test_geometry("4", + "POLYGON((0.6 10.4,9.4 10.4,9.4 -0.4,4.59 -0.4,4.59 5.5,4.70431 5.22003,3.93716 6.00284,5 7.06569,6.06284 6.00284,5.29569 5.22003,5.41 5.5,5.41 0.01,5.01 0.41,5.25 0.41,4.85 0.01,4.85 7.20587,6.37453 3.14045,5.71716 3.28284,7.71716 5.28284,7.82111 4.64223,5.10557 6,7.82111 7.35777,7.71716 6.71716,5.71716 8.71716,6.35777 8.82111,5 6.10557,3.64223 8.82111,4.28284 8.71716,2.28284 6.71716,2.17889 7.35777,4.89443 6,2.17889 4.64223,2.28284 5.28284,4.28284 3.28284,3.62547 3.14045,5.15 7.20587,5.15 -0.4,0.6 -0.4,0.6 10.4))", 21); @@ -126,11 +125,11 @@ void test_self_all() /* // From us counties - test_geometry("us_counties_1", + test_geometry("us_counties_1", "POLYGON((-111.5261116995073 41.22069282150765,-111.5217628285303 41.22035416591237,-111.5169320292328 41.22267065617934,-111.5202664326763 41.22008222445458,-111.524706358225 41.21912313459525,-111.5275767689257 41.2191200646373,-111.5313115885788 41.21977799763464,-111.5361319416122 41.22230930953956,-111.5390149025386 41.22669307111289,-111.5389640868764 41.22665820699549,-111.5405314519348 41.226478917027,-111.5432483336679 41.22674131537675,-111.5420873870024 41.22669699246593,-111.5468899132279 41.22714783689431,-111.5460245791811 41.22698484329734,-111.549259355884 41.2274477430645,-111.5577408755315 41.22811342877968,-111.5617324131657 41.22965779857636,-111.5622074202574 41.22994756325099,-111.5670818828246 41.22909494401993,-111.5692718200805 41.22891062885189,-111.5728540853548 41.22873442382645,-111.5760492668632 41.22941962741943,-111.5791498048043 41.22837886418323,-111.5837423095737 41.22837646600842,-111.5873509885199 41.22912252997033,-111.5905502098084 41.23037015657303,-111.5905738976172 41.23038614536871,-111.5911014306057 41.23028197627109,-111.5941112302391 41.22824505355918,-111.595808135602 41.22727811489068,-111.5980905931322 41.22548836332129,-111.5989075933465 41.22473873279626,-111.6007963250705 41.22266022435337,-111.6036899443978 41.22086457915817,-111.6058137732627 41.22012887375856,-111.602749721482 41.22196865310281,-111.5997971061567 41.22806209012482,-111.6002070563618 41.23129419775559,-111.6028708561713 41.23528460733029,-111.5994206515041 41.23211047917744,-111.5970021250484 41.22731367405874,-111.5968553199938 41.2213333698604,-111.5978240860405 41.218735705151,-111.59872799008 41.21674091429518,-111.5990118775156 41.21586922673351,-111.5993569133788 41.21346252288525,-111.601620124863 41.20717717448136,-111.6036896381354 41.20413147570312,-111.6066477579892 41.20036520970371,-111.6170938638088 41.19792503997269,-111.6171211409054 41.197912672181,-111.6174792281175 41.19763333099935,-111.6154497071748 41.19990210883104,-111.6145469690724 41.20214793299209,-111.6143872042365 41.20466380077419,-111.6140900270553 41.2012073328748,-111.6150859490031 41.19660529794054,-111.6218436555485 41.19061554473284,-111.6263257242001 41.18915337689279,-111.6371251993805 41.18909914015737,-111.6373680096377 41.18885567474617,-111.6383949129559 41.18739026040299,-111.6411123401382 41.18431339866869,-111.6444453559743 41.18263938395823,-111.6475502757163 41.18131111472079,-111.6480824344513 41.18111660627603,-111.6487261483388 41.18018217910811,-111.6541286582274 41.17582409853807,-111.6607502293818 41.17606808683036,-111.6639928385305 41.17750001069842,-111.6627289991998 41.17881191178137,-111.6627289991998 41.16984763275211,-111.6723147297616 41.17250652017602,-111.6740201607502 41.17050691221176,-111.6809028142628 41.17126673355348,-111.6809650818884 41.17123939654464,-111.6853833520725 41.17029389383428,-111.6898658836949 41.17133338502266,-111.6902209084905 41.17152318556664,-111.6904607105552 41.17152361200778,-111.6937608878567 41.171379538936,-111.6956197940083 41.17208616938441,-111.6993728847585 41.17040839085778,-111.7047507179242 41.17328962730216,-111.705138917194 41.1733253907057,-111.7102826252236 41.17325145150028,-111.7134998796559 41.17582525522811,-111.713857740997 41.1760577731046,-111.7143713164526 41.17626863893947,-111.714718580845 41.17638849963699,-111.7161627293466 41.17641647553787,-111.7235652490785 41.17698889260424,-111.7252956636535 41.18063938630633,-111.7255467374265 41.18070780591805,-111.7276362413481 41.18341443465751,-111.7281195035541 41.18379477216856,-111.7289633137073 41.18400466618191,-111.7322463245943 41.18537474159142,-111.7350417499302 41.18787350954477,-111.7400241492817 41.18920498371762,-111.7403897806728 41.18992392192225,-111.7405871404544 41.18993880963902,-111.7419062185388 41.19156105303389,-111.7441017621743 41.19149230781282,-111.74633522639 41.19326425318707,-111.7521804511058 41.19568179191514,-111.7548256119847 41.2000988714596,-111.7562439764081 41.20369244649578,-111.756385520958 41.20741568356885,-111.7560620666084 41.21002180147129,-111.7557493627381 41.2115435666562,-111.7556682922401 41.21250032230501,-111.7549762228438 41.2083729918014,-111.753021260936 41.20652061558319,-111.7508964302413 41.20557195114677,-111.7490502562344 41.20743627992862,-111.7538043672131 41.20092160586289,-111.7599851908795 41.19974075159288,-111.7535482000425 41.20277936096064,-111.7771999505038 41.20664084862795,-111.7822946483749 41.20868575255317,-111.7890479847428 41.20857546302415,-111.7834053984034 41.21113545825469,-111.8070916837301 41.21164475084303,-111.7983239620671 41.20690941545636,-111.7989057748419 41.20685382060309,-111.7988970680348 41.20685567247974,-111.8003950034205 41.20645434489455,-111.8015510337817 41.20521459774467,-111.8040078302751 41.20352268624269,-111.8051400156104 41.20305119804074,-111.805500030827 41.2024512874073,-111.8087760206539 41.19898729003837,-111.8127632488366 41.19571430853862,-111.8168246456107 41.19449127428283,-111.8226375152909 41.19565019698728,-111.8231921576817 41.19623717584509,-111.8268842679184 41.19390830631116,-111.8294386474025 41.19326999358571,-111.8281081895357 41.1923520714658,-111.83461841217 41.19040911228597,-111.8363820197726 41.18976234820737,-111.8389082690123 41.18928774535946,-111.8407278566805 41.18914288072003,-111.8414848277101 41.18915262958935,-111.8446813084015 41.18866243446734,-111.845959886583 41.18861802620197,-111.8434859428467 41.18901816674433,-111.8524610560402 41.1882713958049,-111.8481595765179 41.18832631814151,-111.8496570501088 41.18779673144824,-111.8533671749084 41.18768855682465,-111.8555901658855 41.18738820608631,-111.8545856366929 41.18543601585669,-111.8575805827953 41.18393299249777,-111.8615394981653 41.18172167621498,-111.8609477242236 41.1754400940934,-111.8606336522941 41.17523901959252,-111.8627856637925 41.16997723323662,-111.8635235797656 41.16904436111794,-111.8633266432236 41.16866453458245,-111.8616523096336 41.16843313106372,-111.8616216864947 41.16843907484764,-111.8576102899319 41.16714259614227,-111.8547179142898 41.16646709783558,-111.849004376199 41.16243082584917,-111.8507419858166 41.16392775774389,-111.8449330541267 41.15938516033442,-111.8453252871628 41.14671969870953,-111.8475090520856 41.14347927334031,-111.8495994494861 41.14184555885641,-111.8555300241724 41.12935093455723,-111.8539570692924 41.12913464596177,-111.8600529353453 41.12732099986341,-111.8628893201463 41.12732099986341,-111.8661516016343 41.12766178921265,-111.8717554038871 41.12781992480323,-111.8727125056091 41.12781941462108,-111.8744250029675 41.12734726013537,-111.8884146775109 41.12740408919985,-111.8910337085167 41.12670722950872,-111.8905605241137 41.12684570910798,-111.9013989090858 41.12571131225988,-111.902772044475 41.12619651923274,-111.9129115072118 41.12403191483529,-111.9147507512154 41.12495153622086,-111.9201178874858 41.12566715447374,-111.9240696750495 41.12855499923182,-111.9276546757843 41.12501918886934,-111.9355598663484 41.12798289437448,-111.9479782385554 41.12689279975358,-111.9529681915247 41.12994221534668,-111.9568859680716 41.13081283226165,-111.9574421207222 41.13136898494051,-111.9640025656762 41.1310956332098,-111.9657332834527 41.1401588859141,-111.9717215703218 41.14239547503718,-111.9730675011477 41.14266466120236,-111.9787329018218 41.14336183402796,-111.9883596218439 41.14364222393152,-111.9931363926252 41.14354196764271,-111.9994051904948 41.14363978973041,-112.0021307818896 41.14345808374524,-112.019489139395 41.14254400074554,-112.0239643318703 41.14234399927284,-112.026875 41.142344,-112.027575 41.142344,-112.0287262996005 41.142444,-112.029675 41.142444,-112.0285706847393 41.14250516265326,-112.0334643259497 41.14254400007785,-112.037275 41.142544,-112.038460765726 41.14254315085275,-112.0431214055661 41.14232416334449,-112.045375 41.142443" ",-112.045875 41.142443,-112.046183 41.142443,-112.046675 41.142443,-112.04701 41.142443,-112.047675 41.142443,-112.048675 41.142443,-112.050775 41.142443,-112.051675 41.142443,-112.0540827641383 41.14234300009903,-112.0612488438362 41.14234300000304,-112.0635234354713 41.14223960918194,-112.0770714181921 41.14244181784342,-112.083276 41.142343,-112.084776 41.142343,-112.0848417657806 41.14234299978541,-112.0924417865876 41.142443,-112.100276 41.142443,-112.103976 41.142443,-112.104114857411 41.14244299996745,-112.1076037688054 41.1425399140815,-112.112793190197 41.14242459354599,-112.1135036272676 41.14254300000501,-112.1226270227682 41.14254300006021,-112.1324270190691 41.142643,-112.1421638167791 41.142643,-112.1506273882427 41.14262237725859,-112.1576209575547 41.16131792925686,-112.152476 41.142743,-112.1733149590181 41.14274300002015,-112.1756526514941 41.14285431862275,-112.1721656863206 41.14330717334865,-112.1790628146085 41.14280884335523,-112.1808690864646 41.1427879609488,-112.1876051371955 41.1429370321104,-112.1984510116649 41.14057456440421,-112.1985386297479 41.14057190901539,-112.2482545857727 41.12928342466068,-112.2585216921568 41.1262568687031,-112.2815023152398 41.11964490348107,-112.3289786112679 41.10733319877986,-112.3533969705625 41.10142824273057,-112.5251560608342 41.05848586571712,-112.4535385157666 41.13192877978023,-112.3829356229766 41.20387761333999,-112.3628222295217 41.22454031797921,-112.3307981858544 41.25696262304565,-112.2578598211629 41.33099951523954,-112.2419961323004 41.34673900002596,-112.201955 41.34674,-112.198854 41.34674,-112.198567 41.34674,-112.197535 41.34674,-112.196755 41.34674,-112.183092 41.34674,-112.182661 41.34674,-112.174135 41.34674,-112.171521 41.34674,-112.164398 41.34674,-112.163765 41.34674,-112.162149 41.34674,-112.160616 41.34674,-112.152812 41.34674,-112.137305 41.34674,-112.133199 41.34674,-112.132112 41.34674,-112.1321083653075 41.34674,-112.1261408632321 41.34735552370944,-112.1210375425564 41.34723915345325,-112.0986867218297 41.34703960146247,-112.0991128873171 41.34703432373578,-112.096676 41.34703999999999,-112.0826884841567 41.34693962919125,-112.0727519042998 41.34683715821147,-112.0659830006501 41.34633201618576,-112.043791 41.346241,-112.038076 41.346241,-112.037476 41.346241,-112.033576 41.346241,-112.032963751752 41.346241,-112.0320859322845 41.34720047709238,-112.0293729847019 41.35158293065583,-112.0225987768525 41.35384099993897,-112.012945949278 41.35384099993896,-112.0051264048585 41.35982065155388,-111.9999931863867 41.35955048219633,-111.9985054002757 41.36093908247315,-111.9886378853145 41.36437975025613,-111.982438239708 41.36699931881362,-111.9768823000155 41.37105942855347,-111.9678461715639 41.3739866250941,-111.964824595067 41.37468391195694,-111.9684577169769 41.3568526391571,-111.9703144346862 41.35837247542384,-111.9717680562695 41.36002125916402,-111.9721806067458 41.36052336335063,-111.9722701353691 41.36056857086819,-111.9756933090284 41.36361139189865,-111.9764686134888 41.3653518489586,-111.9774815061067 41.36631107832983,-111.9784353725122 41.3673490439311,-111.9818608355456 41.36917725269873,-111.9855534354769 41.3760117250587,-111.9850442656137 41.37863404701749,-111.9854221363925 41.37887044147006,-111.977148428119 41.39494967066619,-111.9823464481754 41.39046084615109,-111.9775668170106 41.39635867866395,-111.9772955142989 41.39712343090701,-111.9777832268621 41.39396396792152,-111.9780769108747 41.39453595193084,-111.9779510967016 41.39732368111444,-111.9769673928205 41.40507237141038,-111.9776418373984 41.4063310929224,-111.979249745182 41.40756511192825,-111.9805546890196 41.41174800617959,-111.9821969091629 41.41376647554345,-111.9822412429523 41.41771857136868,-111.9841029081325 41.42395514822981,-111.9758267412905 41.42973332568962,-111.9744143892868 41.43003915215967,-111.974044426735 41.43044369722418,-111.9724487099302 41.43127793250221,-111.9714554951038 41.43218647543674,-111.9705674410934 41.4326839955389,-111.969173938818 41.43455463604666,-111.9691313074541 41.43514229114804,-111.9698532625346 41.44083524341373,-111.9563035057409 41.44387691758892,-111.9528519001313 41.4425035997071,-111.948862688548 41.43996812957263,-111.9436557129119 41.43464132813732,-111.944571811535 41.43108183151026,-111.9453783570838 41.43429662278894,-111.9453292374341 41.43423156460978,-111.9487047416977 41.4370350518674,-111.949293219852 41.43728152821434,-111.946617863753 41.43651233182759,-111.9427973525344 41.43430728368595,-111.9423776809036 41.43367777659645,-111.9419291943176 41.4334303851785,-111.9407777658475 41.43217660903539,-111.9381879763191 41.43031650193143,-111.9382493895579 41.43040002340472,-111.9372011434928 41.42981718018637,-111.934117584732 41.42860635849613,-111.9324487007684 41.4262717701259,-111.9302590931362 41.42612441754618,-111.925590477184 41.4240869309046,-111.9246983708718 41.42340851775217,-111.9216328785657 41.42175106235152,-111.9201304574531 41.41957427158692,-111.9218350345417 41.42105808569211,-111.9265579698133 41.4224674871054,-111.9269374253964 41.42243152261963,-111.92904005315 41.4216476704315,-111.9263529265228 41.42314117163985,-111.9215977648415 41.42317758175992,-111.9196428552148 41.42261319977101,-111.9169146898828 41.42287472206833,-111.9134215054519 41.42473907134696,-111.9126447259132 41.42469479648941,-111.9124490246428 41.42499795177306,-111.9092387641912 41.42755224569281,-111.9052380937632 41.42897848938426,-111.9002628533518 41.42946382895553,-111.8971561379816 41.42889450986716,-111.8960249780191 41.4283771327491,-111.8940193677521 41.42850175875044,-111.8960340763695 41.42767896956915,-111.9024176724123 41.42135665487622,-111.9015750043214 41.42528897612509,-111.8998000296643 41.4285722194028,-111.8966205495849 41.43183063874344,-111.8944406431162 41.43324514380939,-111.8926252959783 41.43414332950123,-111.8916804311569 41.43450204532494,-111.8813854987459 41.43984949127724,-111.880095916456 41.43458669143437,-111.8830979471463 41.43487808596424,-111.8730501071175 41.43221499037259,-111.8646587191902 41.42862291364479,-111.8681104012376 41.41281394982138,-111.8676066232081 41.41192879397556,-111.8662685472666 41.41047503332864,-111.8648360831269 41.40927056113344,-111.8617555367589 41.40987864206158,-111.8571815473483 41.40797796402953,-111.8529378794857 41.40290666028592,-111.8525219677778 41.40333283159944,-111.8527417149485 41.40333718389994,-111.8501119188309 41.40364548567232,-111.8450021686117 41.40306327006346,-111.843627880848 41.40234608708582,-111.8435199095021 41.40231074220579,-111.844881585803 41.40265278843807,-111.8349256853031 41.39920519979233,-111.832436319031 41.39890094762616,-111.8320872552582 41.39798934323525,-111.8361009415533 41.3978803505358,-111.8321021292179 41.40300459287702,-111.8241291143356 41.40167512219369,-111.8217725690825 41.40211299539512,-111.8212955423522 41.40200922486019,-111.8171546776915 41.40329458953078,-111.8125316083106 41.39846505320347,-111.8124294708664 41.39842288523761,-111.8124264284935 41.3984236578345,-111.8108857608745 41.39858652417184" ",-111.809365213452 41.39987879371605,-111.8042760434507 41.4011908453571,-111.8020686543937 41.40053613590567,-111.8039046363505 41.40017458184678,-111.8042635478739 41.39999258459775,-111.7909954737669 41.40089644205416,-111.7929629310693 41.40139132981063,-111.7846743021944 41.40036870539331,-111.7827866126724 41.39571814524774,-111.7815214169703 41.39299863043483,-111.7828920971421 41.39327334027993,-111.7748509130635 41.38743730378992,-111.7752165761997 41.38718480775791,-111.7721697223399 41.38604483298051,-111.7750983614573 41.386555270279,-111.7639414583505 41.38192065911581,-111.761963781468 41.3800412809659,-111.7613108864837 41.37912231691754,-111.7612258742607 41.37910304832786,-111.7591299416527 41.37968085372221,-111.7577907259937 41.37944029328051,-111.7558579035919 41.38022277149841,-111.7512688505652 41.38095536128881,-111.7482174462501 41.37990334283357,-111.7486646160195 41.37996229584262,-111.7501551896196 41.37882469173843,-111.7454941763277 41.38178624311301,-111.7335398767194 41.38465825647904,-111.7344375425085 41.38458725363097,-111.7324914280349 41.38482975996588,-111.7308102203539 41.38492274099217,-111.730258 41.364938,-111.7400445096964 41.37466081033997,-111.7367972666407 41.37827413406988,-111.7369761626924 41.37865937323883,-111.7373499817572 41.38191202877975,-111.7362382343994 41.3896817282629,-111.7318062031051 41.39385726751244,-111.730934876677 41.39610325892399,-111.7281898573264 41.39852698503418,-111.7232992768295 41.40141614738422,-111.7216699706312 41.40155945218662,-111.7235231380814 41.40068052773415,-111.7265750913976 41.3963025736558,-111.7201029932023 41.40005616511778,-111.7177896512755 41.40746098221877,-111.7158070848994 41.41038399195119,-111.715655176932 41.41047706608663,-111.715983156649 41.40463400375688,-111.7204406800612 41.40810070196405,-111.7274933391879 41.41205246687121,-111.7285125917203 41.41467440623902,-111.728522980037 41.41344595317905,-111.7322942449122 41.41795959302958,-111.731896106543 41.42560633754115,-111.7320332087593 41.42926118743524,-111.729957646899 41.43302822141643,-111.7118843501114 41.43114694815002,-111.7140310900979 41.43355552193208,-111.7078739864605 41.43654866026967,-111.6998524797112 41.43271471504839,-111.6986652926243 41.42986102526688,-111.6975120881016 41.42897853603878,-111.6971210984819 41.4282934699863,-111.6961606079428 41.42773075204737,-111.6959864719628 41.42776692740181,-111.6933497690836 41.42989872972967,-111.6930019315523 41.42994586089555,-111.6917153721713 41.43152040923766,-111.6902295574764 41.4326187150197,-111.6857899530101 41.43448702217745,-111.6836120286734 41.43709471482509,-111.6771247652154 41.43723637943522,-111.6779983979918 41.43725697173675,-111.6749495172627 41.43734007411281,-111.6746735498744 41.43741591954125,-111.6720209667629 41.43783594325005,-111.6727109972352 41.43770166372526,-111.6553038799185 41.42796846134614,-111.6559813580971 41.42929086121254,-111.6584331526525 41.4317013458235,-111.6584370945208 41.43170379247909,-111.6526596626538 41.42834717102206,-111.6520987713805 41.42542774863863,-111.651155399945 41.42497098966823,-111.6485038542844 41.42069082966789,-111.6484473142877 41.42048207616851,-111.6481701857523 41.42030165647017,-111.6458111338422 41.41860283437335,-111.6435250708396 41.41556473317775,-111.6434325770253 41.41553749590582,-111.6387074295628 41.41091893071695,-111.6382542875749 41.40697282822121,-111.6430587268327 41.41423110967988,-111.6474946531616 41.41493287990986,-111.6519130312862 41.41196173789954,-111.6533453458041 41.4089750382549,-111.6534670630606 41.40818567942468,-111.6532180676668 41.41233729755218,-111.650141671316 41.41784707703802,-111.6506362105335 41.41721786169201,-111.6483458444573 41.42038505559527,-111.6399883913355 41.42456782419585,-111.6387619333563 41.42531302770971,-111.6372313167869 41.42610278062988,-111.6388772156545 41.42503724999391,-111.6241185051481 41.42565671005583,-111.6292989198989 41.42747881108829,-111.6330212257612 41.42632935426848,-111.6300888540781 41.42874135696512,-111.6258525865511 41.43045665694785,-111.6200937473438 41.43292197700307,-111.6163818162207 41.43227133372919,-111.6139121279047 41.43210192316946,-111.6127778034731 41.431778181874,-111.6100998879303 41.43186873969825,-111.6033371287108 41.42772766687219,-111.6022619251007 41.41977026042356,-111.6042208823911 41.42642276689722,-111.6042547368996 41.42641106290917,-111.608203778722 41.42866129535266,-111.6088030126456 41.42877501302603,-111.6100720883581 41.428785889551,-111.6085308515393 41.42932400636524,-111.606750545072 41.42926095100312,-111.6050156683234 41.42987323575301,-111.6032457428657 41.43066814395039,-111.5990673748855 41.43148472494484,-111.5935002234159 41.43042488220517,-111.5930272861467 41.42998515359408,-111.5930267097009 41.42998503477877,-111.5926383972181 41.42952847560235,-111.5893656740488 41.42939120933852,-111.5879879513229 41.42897465490946,-111.5877655061638 41.42920784693975,-111.5872128087414 41.42998364520915,-111.583805331358 41.43402279679681,-111.5850015607415 41.43257430449172,-111.5682595644039 41.43689127289402,-111.5655580307463 41.43431733658391,-111.5648140723382 41.43437789786282,-111.5588494686844 41.43147389314375,-111.5627733442355 41.43390475163831,-111.5467595603931 41.43097085352397,-111.5435231017314 41.4216909235525,-111.5442217676426 41.42410058028637,-111.5429581915997 41.4198629141784,-111.5415905096045 41.41916883276773,-111.5377466703981 41.42118674271469,-111.4999002636551 41.40754598864975,-111.49992321854 41.41992376877793,-111.5043942337116 41.42316548043323,-111.5074667581468 41.42367669767896,-111.5018577201973 41.42339139933106,-111.498492694593 41.42223736811422,-111.4908347022589 41.41568090530068,-111.4908130094445 41.41544015588016,-111.4899750552739 41.41493216608176,-111.4892746770538 41.41472074332899,-111.4877789754887 41.41479252991904,-111.4780235955907 41.41446855024663,-111.4758343817126 41.4101305233553,-111.4667945916543 41.408008495426,-111.4649303818979 41.39743051733797,-111.4670499026164 41.38880238826368,-111.4675403497742 41.39238946277144,-111.4682693256192 41.3896798556904,-111.468223034458 41.38866896494368,-111.4679524737185 41.3873696044556,-111.467909790308 41.38511421668602,-111.4689252899892 41.3893194192861,-111.4719613794916 41.39260783946975,-111.4773850453548 41.3939272250177,-111.4755047817366 41.39401042247292,-111.4730700536672 41.3936966334367,-111.4707125540257 41.39313997077441,-111.4681148394472 41.39206078401419,-111.4673020106218 41.39150164420799,-111.4650634653196 41.39118921312598,-111.4624398349077 41.3906400254072,-111.4605400175199 41.38972232484358,-111.4570460693707 41.38909801417777,-111.4548503602481 41.38578941112745,-111.4481916270633 41.37903507093495,-111.4538905371506 41.37167946112217,-111.4523110338275 41.37562482145626,-111.453122061191 41.38030214182341,-111.4559274593289 41.38258137778414,-111.4578400905912 41.38326186498487,-111.4580092624499 41.38328010181085,-111.4545500072416 41.38310423553524,-111.453828693243 41.38286176547096,-111.4513917306495 41.38316888047494,-111.4490880680225 41.38286920566615,-111.4458883535083 41.38283562865421,-111.4410455091279 41.38056286130516,-111.4296540092564 41.37759174629597,-111.4330684620716 41.37199485958408,-111.4325288499295 41.37170115977816,-111.433423614824 41.37148481989143,-111.4327514468304 41.37229760229101,-111.4292876194388 41.37329041914894,-111.4279628046368 41.37382224950171,-111.4310504194527 41.37201570165918,-111.4220511206116 41.37680632625185,-111.4132007135549 41.36916475528064,-111.4132556937664 41.36821137521456,-111.410599947015 41.3655167694235,-111.4095467780071 41.35588239586497,-111.4153923235931 41.35080670253447,-111.4157574283901 41.3503345776012,-111.4141595503214 41.35370156318688,-111.4141624489772 41.35339760480722,-111.4115288588478 41.35121628241728" - ",-111.4156461230987 41.34027082280225,-111.4156347336163 41.34011622708512,-111.4219171529141 41.33399691991721,-111.4230512496498 41.33351877639811,-111.4246536800136 41.33255158448824,-111.4278802645644 41.3316442458971,-111.4321841269485 41.3326384089827,-111.4310435307007 41.3328305819942,-111.4298921041398 41.33381070679388,-111.4325816436783 41.34640754412428,-111.4305938656625 41.34507358150004,-111.4288086603161 41.342542060306,-111.431481679049 41.34513109369425,-111.4287994278175 41.33815667720043,-111.4278232779227 41.33641772801344,-111.4265560012482 41.33289501968777,-111.4265560012482 41.32617628698502,-111.4272107382647 41.32560778902531,-111.4272178782421 41.32554523388917,-111.4261980734283 41.32225817088516,-111.4304919167739 41.31367048419434,-111.4363369977304 41.31257559725096,-111.4394237666417 41.31270635296883,-111.4394344156974 41.31270409565712,-111.441519161219 41.31236426658026,-111.4381960052264 41.31363247642526,-111.4343497992445 41.31844116068382,-111.4351634377084 41.3136073258965,-111.4398662896243 41.30910418220708,-111.4422468135143 41.30752683142005,-111.44538081134 41.30634785128562,-111.4477252742131 41.30622230681761,-111.4450982072919 41.30679223598104,-111.4415499070308 41.30926911751111,-111.440343520513 41.31155182354399,-111.4451062874178 41.31989072583871,-111.4414187617719 41.31986572481608,-111.4386063431991 41.31574156424257,-111.4372288340086 41.31425825843935,-111.4357467129998 41.3119401785306,-111.4339202494052 41.30822377235391,-111.4336625137004 41.30069611228576,-111.436193501451 41.29832538323529,-111.4342850140522 41.29308194363609,-111.4328391389641 41.29555271021763,-111.4325216530159 41.29665639935071,-111.4347508608123 41.30443260100356,-111.4360586780902 41.30564636670918,-111.4346792471093 41.30464063662748,-111.4254390049755 41.29528237788455,-111.4291302686912 41.29068338555521,-111.4261573074688 41.28463104839097,-111.4370267030589 41.27981638195083,-111.4375558321362 41.27935123578043,-111.4354383430839 41.27995632635503,-111.4416162807751 41.2758529929185,-111.4384076084416 41.27957295063146,-111.4377212864738 41.2850520602332,-111.4381740345049 41.28651100478594,-111.4384610963577 41.28700771059263,-111.4443864706288 41.29120163044556,-111.4392995187362 41.28993258176533,-111.437506253794 41.28634485567613,-111.4356263875061 41.28302577228677,-111.4349277183834 41.27937332380423,-111.4350242056712 41.26951553923891,-111.4419729572562 41.26823923756828,-111.443851402553 41.26628117225569,-111.4466503255125 41.26617791598309,-111.4466539930302 41.26617467737448,-111.4520015669708 41.26396940238351,-111.4535032224145 41.26442883740561,-111.4575335757568 41.26357415147228,-111.4483713214452 41.27007784433943,-111.4479650010794 41.2717768437342,-111.4480273600067 41.27313463677613,-111.4493445602483 41.27659822195652,-111.4478190730863 41.27422750187978,-111.4464117327744 41.26893674882813,-111.4496732569538 41.26159468063268,-111.4543300686382 41.25793771380997,-111.4571410161368 41.2577942766178,-111.4584177002777 41.25730159262817,-111.4553050787541 41.25932963474278,-111.4530081358515 41.26959930131982,-111.4508994156196 41.26371450013092,-111.4541957910179 41.25962837787136,-111.4533513082429 41.25606707336917,-111.4584511900491 41.24989054984832,-111.4611419330649 41.24901272751228,-111.4642296892219 41.2471079915566,-111.466302267792 41.24724208780359,-111.4612041454673 41.25525650795958,-111.4613628730978 41.25711686602586,-111.460012566547 41.25068020785515,-111.4631190491229 41.24557484651866,-111.4668960494423 41.24198842878425,-111.4691669157075 41.2417000374843,-111.4697812813245 41.24112614793989,-111.4746504843807 41.23477980181183,-111.4803977314971 41.23547461817721,-111.4807668379497 41.23549157614718,-111.4821598518453 41.235181287545,-111.4835147362251 41.23397825845257,-111.4913294700869 41.23144137067924,-111.4937928098947 41.23127714842143,-111.4853525806721 41.23734674935701,-111.4851730213113 41.24391252958296,-111.4868064098187 41.24667054274708,-111.4899998360328 41.24898263383229,-111.4827890866642 41.24415984037166,-111.4821185211798 41.23272415759732,-111.4852056387818 41.22855546079995,-111.4871367392634 41.22636620973306,-111.4877302368984 41.22602162842327,-111.4866371991571 41.22728810367443,-111.4862618064053 41.21244302667023,-111.5038439093175 41.21886594606829,-111.5086526752272 41.22023174933462,-111.5093913926803 41.21966687966173,-111.5156021372448 41.21908063181036,-111.5179945315531 41.21978213857661,-111.5200627063573 41.21974916010367,-111.5242768213902 41.22009310457656,-111.5261116995073 41.22069282150765))", + ",-111.4156461230987 41.34027082280225,-111.4156347336163 41.34011622708512,-111.4219171529141 41.33399691991721,-111.4230512496498 41.33351877639811,-111.4246536800136 41.33255158448824,-111.4278802645644 41.3316442458971,-111.4321841269485 41.3326384089827,-111.4310435307007 41.3328305819942,-111.4298921041398 41.33381070679388,-111.4325816436783 41.34640754412428,-111.4305938656625 41.34507358150004,-111.4288086603161 41.342542060306,-111.431481679049 41.34513109369425,-111.4287994278175 41.33815667720043,-111.4278232779227 41.33641772801344,-111.4265560012482 41.33289501968777,-111.4265560012482 41.32617628698502,-111.4272107382647 41.32560778902531,-111.4272178782421 41.32554523388917,-111.4261980734283 41.32225817088516,-111.4304919167739 41.31367048419434,-111.4363369977304 41.31257559725096,-111.4394237666417 41.31270635296883,-111.4394344156974 41.31270409565712,-111.441519161219 41.31236426658026,-111.4381960052264 41.31363247642526,-111.4343497992445 41.31844116068382,-111.4351634377084 41.3136073258965,-111.4398662896243 41.30910418220708,-111.4422468135143 41.30752683142005,-111.44538081134 41.30634785128562,-111.4477252742131 41.30622230681761,-111.4450982072919 41.30679223598104,-111.4415499070308 41.30926911751111,-111.440343520513 41.31155182354399,-111.4451062874178 41.31989072583871,-111.4414187617719 41.31986572481608,-111.4386063431991 41.31574156424257,-111.4372288340086 41.31425825843935,-111.4357467129998 41.3119401785306,-111.4339202494052 41.30822377235391,-111.4336625137004 41.30069611228576,-111.436193501451 41.29832538323529,-111.4342850140522 41.29308194363609,-111.4328391389641 41.29555271021763,-111.4325216530159 41.29665639935071,-111.4347508608123 41.30443260100356,-111.4360586780902 41.30564636670918,-111.4346792471093 41.30464063662748,-111.4254390049755 41.29528237788455,-111.4291302686912 41.29068338555521,-111.4261573074688 41.28463104839097,-111.4370267030589 41.27981638195083,-111.4375558321362 41.27935123578043,-111.4354383430839 41.27995632635503,-111.4416162807751 41.2758529929185,-111.4384076084416 41.27957295063146,-111.4377212864738 41.2850520602332,-111.4381740345049 41.28651100478594,-111.4384610963577 41.28700771059263,-111.4443864706288 41.29120163044556,-111.4392995187362 41.28993258176533,-111.437506253794 41.28634485567613,-111.4356263875061 41.28302577228677,-111.4349277183834 41.27937332380423,-111.4350242056712 41.26951553923891,-111.4419729572562 41.26823923756828,-111.443851402553 41.26628117225569,-111.4466503255125 41.26617791598309,-111.4466539930302 41.26617467737448,-111.4520015669708 41.26396940238351,-111.4535032224145 41.26442883740561,-111.4575335757568 41.26357415147228,-111.4483713214452 41.27007784433943,-111.4479650010794 41.2717768437342,-111.4480273600067 41.27313463677613,-111.4493445602483 41.27659822195652,-111.4478190730863 41.27422750187978,-111.4464117327744 41.26893674882813,-111.4496732569538 41.26159468063268,-111.4543300686382 41.25793771380997,-111.4571410161368 41.2577942766178,-111.4584177002777 41.25730159262817,-111.4553050787541 41.25932963474278,-111.4530081358515 41.26959930131982,-111.4508994156196 41.26371450013092,-111.4541957910179 41.25962837787136,-111.4533513082429 41.25606707336917,-111.4584511900491 41.24989054984832,-111.4611419330649 41.24901272751228,-111.4642296892219 41.2471079915566,-111.466302267792 41.24724208780359,-111.4612041454673 41.25525650795958,-111.4613628730978 41.25711686602586,-111.460012566547 41.25068020785515,-111.4631190491229 41.24557484651866,-111.4668960494423 41.24198842878425,-111.4691669157075 41.2417000374843,-111.4697812813245 41.24112614793989,-111.4746504843807 41.23477980181183,-111.4803977314971 41.23547461817721,-111.4807668379497 41.23549157614718,-111.4821598518453 41.235181287545,-111.4835147362251 41.23397825845257,-111.4913294700869 41.23144137067924,-111.4937928098947 41.23127714842143,-111.4853525806721 41.23734674935701,-111.4851730213113 41.24391252958296,-111.4868064098187 41.24667054274708,-111.4899998360328 41.24898263383229,-111.4827890866642 41.24415984037166,-111.4821185211798 41.23272415759732,-111.4852056387818 41.22855546079995,-111.4871367392634 41.22636620973306,-111.4877302368984 41.22602162842327,-111.4866371991571 41.22728810367443,-111.4862618064053 41.21244302667023,-111.5038439093175 41.21886594606829,-111.5086526752272 41.22023174933462,-111.5093913926803 41.21966687966173,-111.5156021372448 41.21908063181036,-111.5179945315531 41.21978213857661,-111.5200627063573 41.21974916010367,-111.5242768213902 41.22009310457656,-111.5261116995073 41.22069282150765))", 22); */ @@ -142,7 +141,7 @@ void test_self_all() #if ! defined(GEOMETRY_TEST_MULTI) int test_main(int, char* []) { - test_self_all >(); + test_self_all >(); return 0; } #endif diff --git a/test/algorithms/overlay/traverse.cpp b/test/algorithms/overlay/traverse.cpp index 4c15e9388..cf2fb4a62 100644 --- a/test/algorithms/overlay/traverse.cpp +++ b/test/algorithms/overlay/traverse.cpp @@ -57,7 +57,7 @@ # include #endif -template +template struct test_traverse { static inline std::string operation(int d) @@ -90,7 +90,6 @@ struct test_traverse //if (Direction != 1) return; // END DEBUG ONE ... - namespace bg = boost::geometry; /*** FOR REVERSING ONLY { @@ -124,7 +123,7 @@ struct test_traverse typedef bg::detail::overlay::traversal_turn_info < - typename boost::geometry::point_type::type + typename bg::point_type::type > turn_info; std::vector turns; @@ -135,7 +134,7 @@ struct test_traverse : bg::detail::overlay::operation_intersection, g1, g2, side_strategy_type()); - typedef bg::linear_ring::type> ring_type; + typedef bg::model::linear_ring::type> ring_type; typedef std::vector out_vector; out_vector v; @@ -321,12 +320,11 @@ struct test_traverse template void test_all(bool test_self_tangencies = true, bool test_mixed = false) { - namespace bg = boost::geometry; - using namespace boost::geometry::detail::overlay; + using namespace bg::detail::overlay; - typedef bg::point P; + typedef bg::model::point P; typedef bg::model::polygon

polygon; - typedef bg::box

box; + typedef bg::model::box

box; typedef boost::tuple Tuple; // 1-6 @@ -485,6 +483,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false) boost::make_tuple(2, 2183372.2718), pie_20_20_7_100[0], pie_20_20_7_100[1]); + // 1-6 test_overlay, Tuple>("1", boost::make_tuple(1, 11.5264), case_1[0], case_1[1]); test_overlay, Tuple>("2", boost::make_tuple(1, 17.9455), case_2[0], case_2[1]); @@ -558,7 +557,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false) test_overlay, Tuple>("53_st", boost::make_tuple(2, 16), case_53[0], case_53[1]); } test_overlay, Tuple>("53_iet", - boost::make_tuple(2, 16), + boost::make_tuple(2, 16), case_53[0], case_53[2]); if (test_self_tangencies) { @@ -601,7 +600,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false) case_60[0], case_60[1]); } test_overlay, Tuple>("58_iet", - boost::make_tuple( 4, 12.16666), + boost::make_tuple( 4, 12.16666), case_58[0], case_58[2]); test_overlay, Tuple>("59_iet", boost::make_tuple(1, -3.791666), // 2, 17.208333), outer ring (ii/ix) is done by ASSEMBLE @@ -657,6 +656,14 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false) test_overlay, Tuple>("pie_20_20_7_100", boost::make_tuple(1, 5577158.72823), pie_20_20_7_100[0], pie_20_20_7_100[1]); + /* + if (test_not_valid) + { + test_overlay, Tuple>("pie_5_12_12_0_7s", + boost::make_tuple(1, 3271710.48516), pie_5_12_12_0_7s[0], pie_5_12_12_0_7s[1]); + } + */ + static const bool is_float = boost::is_same::value; static const bool is_double @@ -828,10 +835,9 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false) template void test_open() { - namespace bg = boost::geometry; - using namespace boost::geometry::detail::overlay; + using namespace bg::detail::overlay; - typedef bg::point P; + typedef bg::model::point P; typedef bg::model::polygon polygon; typedef boost::tuple Tuple; @@ -844,9 +850,9 @@ void test_open() int test_main(int, char* []) { - test_all(); + //test_all(); test_all(); - test_open(); + //test_open(); #if ! defined(_MSC_VER) test_all(); @@ -857,6 +863,6 @@ int test_main(int, char* []) #endif return 0; -} + } #endif diff --git a/test/algorithms/overlay/traverse_gmp.cpp b/test/algorithms/overlay/traverse_gmp.cpp index 411a45517..627360e18 100644 --- a/test/algorithms/overlay/traverse_gmp.cpp +++ b/test/algorithms/overlay/traverse_gmp.cpp @@ -22,11 +22,6 @@ #include #include -#if defined(HAVE_CLN) -# include -#endif - - #include #include @@ -54,7 +49,6 @@ template void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2) { - namespace bg = boost::geometry; typedef bg::detail::intersection::intersection_point ::type> ip; typedef typename boost::range_const_iterator >::type iterator; @@ -77,7 +71,7 @@ void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2) bg::get_turns(g1, g2, ips); bg::enrich_intersection_points(ips, g1, g2, strategy_type()); - typedef bg::linear_ring::type> ring_type; + typedef bg::model::linear_ring::type> ring_type; typedef std::vector out_vector; out_vector v; @@ -102,7 +96,7 @@ void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2) std::ofstream svg(filename.str().c_str()); // Trick to have this always LongDouble - //typedef bg::point_xy P; + //typedef bg::model::point_xy P; typedef typename bg::point_type::type P; //typename bg::replace_point_type::type rg1; //typename bg::replace_point_type::type rg2; @@ -143,7 +137,6 @@ void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2) template void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2) { - namespace bg = boost::geometry; G1 g1; bg::read_wkt(wkt1, g1); @@ -163,8 +156,7 @@ void test_one(std::string const& caseid, std::string const& wkt1, std::string co template void test_traverse_gmp(std::string const& caseid) { - namespace bg = boost::geometry; - typedef bg::polygon

polygon; + typedef bg::model::polygon

polygon; std::cout << typeid(typename bg::coordinate_type

::type).name() << std::endl; std::cout << std::setprecision(30) << std::numeric_limits::epsilon() << std::endl; std::cout << std::setprecision(30) << std::numeric_limits::epsilon() << std::endl; @@ -188,29 +180,22 @@ void test_traverse_gmp(std::string const& caseid) int main(int argc, char** argv) { - namespace bg = boost::geometry; int mode = (argc > 1) ? atol(argv[1]) : 1; switch(mode) { case 1 : - test_traverse_gmp >("float"); + test_traverse_gmp >("float"); break; case 2 : - test_traverse_gmp >("double"); + test_traverse_gmp >("double"); break; case 3 : - test_traverse_gmp >("long double"); + test_traverse_gmp >("long double"); break; case 4 : - #if defined(HAVE_GMP) - test_traverse_gmp >("gmp"); + #if defined(HAVE_TTMATH) + test_traverse_gmp >("ttmath_big"); #endif - break; - case 5 : - #if defined(HAVE_CLN) - test_traverse_gmp >("cln"); - #endif - break; } return 0; diff --git a/test/algorithms/perimeter.cpp b/test/algorithms/perimeter.cpp index 6f88f0422..9700752d3 100644 --- a/test/algorithms/perimeter.cpp +++ b/test/algorithms/perimeter.cpp @@ -17,35 +17,32 @@ void test_all() // 3-4-5 triangle //test_geometry >("LINESTRING(0 0,3 4)", 5); - test_geometry >( + test_geometry >( "POLYGON((0 0,0 1,1 1,1 0,0 0))", 4); - test_geometry >( + test_geometry >( "POLYGON((0 0,0 1,1 0,0 0))", 1.0 + 1.0 + sqrt(2.0)); - test_geometry >( + test_geometry >( "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,2 1,2 2,1 2,1 1))", 20); } template void test_open() { - typedef boost::geometry::polygon open_polygon; + typedef bg::model::polygon open_polygon; test_geometry("POLYGON((0 0,0 1,1 1,1 0))", 4); } int test_main(int, char* []) { - //test_all >(); - test_all >(); - test_all >(); + //test_all >(); + test_all >(); + test_all >(); - test_open >(); + test_open >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/reverse.cpp b/test/algorithms/reverse.cpp index 7e45931e6..74ef5d4cc 100644 --- a/test/algorithms/reverse.cpp +++ b/test/algorithms/reverse.cpp @@ -16,37 +16,37 @@ template void test_all() { // Simplex - test_geometry >( + test_geometry >( "LINESTRING(0 0,1 1)", "LINESTRING(1 1,0 0)"); // Three points, middle should stay the same - test_geometry >( + test_geometry >( "LINESTRING(0 0,1 1,2 2)", "LINESTRING(2 2,1 1,0 0)"); // Four points - test_geometry >( + test_geometry >( "LINESTRING(0 0,1 1,2 2,3 3)", "LINESTRING(3 3,2 2,1 1,0 0)"); // Polygon with holes - test_geometry >( + test_geometry >( "POLYGON((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))", "POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0),(7 3,4 3,1 3,1 6,7 6,7 3))"); // Check compilation test_geometry("POINT(0 0)", "POINT(0 0)"); - test_geometry >( + test_geometry >( "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", "POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0))"); } int test_main(int, char* []) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/simplify.cpp b/test/algorithms/simplify.cpp index e59d4ce6c..b2f67f11c 100644 --- a/test/algorithms/simplify.cpp +++ b/test/algorithms/simplify.cpp @@ -17,20 +17,18 @@ #include - - template void test_all() { - test_geometry >( + test_geometry >( "LINESTRING(0 0,5 5,10 10)", "LINESTRING(0 0,10 10)", 1.0); - test_geometry >( + test_geometry >( "LINESTRING(0 0, 5 5, 6 5, 10 10)", "LINESTRING(0 0,10 10)", 1.0); - test_geometry >( + test_geometry >( "LINESTRING(0 0,5 5,7 5,10 10)", "LINESTRING(0 0,5 5,7 5,10 10)", 1.0); @@ -38,15 +36,15 @@ void test_all() "LINESTRING(0 0,5 5,7 5,10 10)", "LINESTRING(0 0,5 5,7 5,10 10)", 1.0); - test_geometry >( + test_geometry >( "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0))", 1.0); - test_geometry >( + test_geometry >( "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0))", 1.0); - test_geometry >( + test_geometry >( "POLYGON((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))", "POLYGON((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); @@ -67,7 +65,7 @@ union all select astext(ST_Simplify(geomfromtext('POLYGON((4 0, 8 2, 8 7, 4 9, 0 "POINT(0 0)", 1.0); - test_geometry >( + test_geometry >( "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0))", 1.0); } @@ -76,7 +74,7 @@ union all select astext(ST_Simplify(geomfromtext('POLYGON((4 0, 8 2, 8 7, 4 9, 0 template void test_spherical() { - test_geometry >( + test_geometry >( "LINESTRING(4.1 52.1,4.2 52.2,4.3 52.3)", "LINESTRING(4.1 52.1,4.3 52.3)", 0.01); } @@ -85,12 +83,12 @@ void test_spherical() int test_main(int, char* []) { // Integer compiles, but simplify-process fails (due to distances) - //test_all >(); + //test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); - test_spherical > >(); + test_spherical > >(); return 0; } diff --git a/test/algorithms/test_area.hpp b/test/algorithms/test_area.hpp index e5cf4e699..689fe2f05 100644 --- a/test/algorithms/test_area.hpp +++ b/test/algorithms/test_area.hpp @@ -20,15 +20,15 @@ template void test_area(Geometry const& geometry, long double expected_area) { - long double area = boost::geometry::area(geometry); + long double area = bg::area(geometry); #ifdef GEOMETRY_TEST_DEBUG std::ostringstream out; - out << typeid(typename boost::geometry::coordinate_type::type).name() + out << typeid(typename bg::coordinate_type::type).name() << " " - << typeid(typename boost::geometry::area_result::type).name() + << typeid(typename bg::area_result::type).name() << " " - << "area : " << boost::geometry::area(geometry) + << "area : " << bg::area(geometry) << std::endl; std::cout << out.str(); #endif @@ -36,20 +36,20 @@ void test_area(Geometry const& geometry, long double expected_area) BOOST_CHECK_CLOSE(area, expected_area, 0.0001); // Test with explicitly defined strategies - boost::geometry::strategy::area::by_triangles + bg::strategy::area::by_triangles < - typename boost::geometry::point_type::type + typename bg::point_type::type > strategy1; - area = boost::geometry::area(geometry, strategy1); + area = bg::area(geometry, strategy1); - boost::geometry::strategy::area::by_triangles + bg::strategy::area::by_triangles < - typename boost::geometry::point_type::type, + typename bg::point_type::type, long double > strategy2; - area = boost::geometry::area(geometry, strategy2); + area = bg::area(geometry, strategy2); } @@ -57,7 +57,7 @@ template void test_geometry(std::string const& wkt, double expected_area) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_area(geometry, expected_area); } diff --git a/test/algorithms/test_centroid.hpp b/test/algorithms/test_centroid.hpp index 575a63ac2..ad2151ce0 100644 --- a/test/algorithms/test_centroid.hpp +++ b/test/algorithms/test_centroid.hpp @@ -30,8 +30,8 @@ struct check_result<2> template static void apply(Point const& p, T const& x, T const& y, T const&) { - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(p)), double(x), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(p)), double(y), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(p)), double(x), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(p)), double(y), 0.001); } }; @@ -42,9 +42,9 @@ struct check_result<3> template static void apply(Point const& p, T const& x, T const& y, T const& z) { - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(p)), double(x), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(p)), double(y), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<2>(p)), double(z), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(p)), double(x), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(p)), double(y), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<2>(p)), double(z), 0.001); } }; @@ -53,15 +53,15 @@ struct check_result<3> template void test_with_other_calculation_type(Geometry const& geometry, Point& c1) { - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::point_type::type point_type; // Calculate it with user defined strategy point_type c2; - boost::geometry::centroid(geometry, c2, - boost::geometry::strategy::centroid::bashein_detmer()); + bg::centroid(geometry, c2, + bg::strategy::centroid::bashein_detmer()); std::cout << typeid(CalculationType).name() << ": " << std::setprecision(20) - << boost::geometry::get<0>(c2) << " " << boost::geometry::get<1>(c2) - << " -> difference: " << boost::geometry::distance(c1, c2) + << bg::get<0>(c2) << " " << bg::get<1>(c2) + << " -> difference: " << bg::distance(c1, c2) << std::endl; } @@ -69,23 +69,20 @@ template void test_centroid(std::string const& wkt, T const& x, T const& y, T const& z = T()) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - typedef typename boost::geometry::point_type::type point_type; + bg::read_wkt(wkt, geometry); + typedef typename bg::point_type::type point_type; point_type c1; - boost::geometry::centroid(geometry, c1); - check_result::type::value>::apply(c1, x, y, z); + bg::centroid(geometry, c1); + check_result::type::value>::apply(c1, x, y, z); #ifdef REPORT_RESULTS - std::cout << "normal: " << std::setprecision(20) << boost::geometry::get<0>(c1) << " " << boost::geometry::get<1>(c1) << std::endl; + std::cout << "normal: " << std::setprecision(20) << bg::get<0>(c1) << " " << bg::get<1>(c1) << std::endl; //test_with_other_calculation_type(geometry, c1); test_with_other_calculation_type(geometry, c1); test_with_other_calculation_type(geometry, c1); -#if defined(HAVE_GMP) - test_with_other_calculation_type(geometry, c1); -#endif -#if defined(HAVE_CLN) - test_with_other_calculation_type(geometry, c1); +#if defined(HAVE_TTMATH) + test_with_other_calculation_type(geometry, c1); #endif #endif diff --git a/test/algorithms/test_combine.hpp b/test/algorithms/test_combine.hpp index b968ebfff..3c53ba4c5 100644 --- a/test/algorithms/test_combine.hpp +++ b/test/algorithms/test_combine.hpp @@ -24,12 +24,12 @@ void test_combine(Box& box, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); - boost::geometry::combine(box, geometry); + bg::combine(box, geometry); std::ostringstream out; - out << boost::geometry::dsv(box, ",", "(", ")", ",", "", ""); + out << bg::dsv(box, ",", "(", ")", ",", "", ""); BOOST_CHECK_EQUAL(out.str(), expected); } @@ -40,13 +40,13 @@ void test_combine_other_strategy(Box& box, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); - boost::geometry::combine(box, geometry); + bg::combine(box, geometry); std::ostringstream out; - out << boost::geometry::dsv(box, ",", "(", ")", ",", "", ""); + out << bg::dsv(box, ",", "(", ")", ",", "", ""); BOOST_CHECK_EQUAL(out.str(), expected); } diff --git a/test/algorithms/test_convex_hull.hpp b/test/algorithms/test_convex_hull.hpp index 1f3fa1c49..b5e2c8d77 100644 --- a/test/algorithms/test_convex_hull.hpp +++ b/test/algorithms/test_convex_hull.hpp @@ -28,27 +28,27 @@ void test_convex_hull(Geometry const& geometry, Hull const& hull, double expected_area, bool reverse) { - std::size_t n = boost::geometry::num_points(hull); + std::size_t n = bg::num_points(hull); BOOST_CHECK_MESSAGE(n == size_hull, - "convex hull: " << boost::geometry::wkt(geometry) - << " -> " << boost::geometry::wkt(hull) + "convex hull: " << bg::wkt(geometry) + << " -> " << bg::wkt(hull) << " type " - << (typeid(typename boost::geometry::coordinate_type::type).name()) + << (typeid(typename bg::coordinate_type::type).name()) << " -> Expected: " << size_hull << " detected: " << n); - BOOST_CHECK(boost::geometry::num_points(geometry) == size_original); + BOOST_CHECK(bg::num_points(geometry) == size_original); - double ah = boost::geometry::area(hull); + double ah = bg::area(hull); if (reverse) { ah = -ah; } -//std::cout << "Area: " << boost::geometry::area(geometry) << std::endl; -//std::cout << boost::geometry::wkt(hull) << std::endl; +//std::cout << "Area: " << bg::area(geometry) << std::endl; +//std::cout << bg::wkt(hull) << std::endl; BOOST_CHECK_CLOSE(ah, expected_area, 0.001); } @@ -59,44 +59,42 @@ void test_geometry_order(std::string const& wkt, double expected_area) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); - boost::geometry::polygon + bg::model::polygon < - typename boost::geometry::point_type::type, - std::vector, - std::vector, + typename bg::point_type::type, Clockwise > hull; // Test version with output iterator - convex_hull_inserter(geometry, std::back_inserter(hull.outer())); + bg::convex_hull_inserter(geometry, std::back_inserter(hull.outer())); test_convex_hull(geometry, hull, size_original, size_hull, expected_area, ! Clockwise); // Test version with ring as output - boost::geometry::clear(hull); - boost::geometry::convex_hull(geometry, hull.outer()); + bg::clear(hull); + bg::convex_hull(geometry, hull.outer()); test_convex_hull(geometry, hull, size_original, size_hull, expected_area, false); // Test version with polygon as output - boost::geometry::clear(hull); - boost::geometry::convex_hull(geometry, hull); + bg::clear(hull); + bg::convex_hull(geometry, hull); test_convex_hull(geometry, hull, size_original, size_hull, expected_area, false); // Test version with strategy - boost::geometry::clear(hull); - boost::geometry::strategy::convex_hull::graham_andrew + bg::clear(hull); + bg::strategy::convex_hull::graham_andrew < Geometry, - typename boost::geometry::point_type::type + typename bg::point_type::type > graham; - boost::geometry::convex_hull(geometry, hull.outer(), graham); + bg::convex_hull(geometry, hull.outer(), graham); test_convex_hull(geometry, hull, size_original, size_hull, expected_area, false); // Test version with output iterator and strategy - boost::geometry::clear(hull); - boost::geometry::convex_hull_inserter(geometry, std::back_inserter(hull.outer()), graham); + bg::clear(hull); + bg::convex_hull_inserter(geometry, std::back_inserter(hull.outer()), graham); test_convex_hull(geometry, hull, size_original, size_hull, expected_area, ! Clockwise); } diff --git a/test/algorithms/test_difference.hpp b/test/algorithms/test_difference.hpp index 75ff971bb..7f737af82 100644 --- a/test/algorithms/test_difference.hpp +++ b/test/algorithms/test_difference.hpp @@ -44,16 +44,16 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, { std::vector clip; - typedef typename boost::geometry::coordinate_type::type coordinate_type; - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; if (sym) { - boost::geometry::sym_difference(g1, g2, clip); + bg::sym_difference(g1, g2, clip); } else { - boost::geometry::difference(g1, g2, clip); + bg::difference(g1, g2, clip); } double area = 0; @@ -66,11 +66,11 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, { // Get a correct point-count without duplicate points // (note that overlay might be adapted to avoid duplicates) - boost::geometry::unique(*it); - n += boost::geometry::num_points(*it); + bg::unique(*it); + n += bg::num_points(*it); } - area += boost::geometry::area(*it); + area += bg::area(*it); } @@ -110,7 +110,7 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, std::ofstream svg(filename.str().c_str()); - boost::geometry::svg_mapper mapper(svg, 500, 500); + bg::svg_mapper mapper(svg, 500, 500); mapper.add(g1); mapper.add(g2); @@ -121,7 +121,7 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, for (typename std::vector::const_iterator it = clip.begin(); it != clip.end(); ++it) { - mapper.map(*it, sym + mapper.map(*it, sym ? "opacity:0.6;fill:rgb(255,255,0);stroke:rgb(255,0,0);stroke-width:5" : "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); } @@ -136,23 +136,23 @@ static int counter = 0; template -void test_one(std::string const& caseid, +void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - std::size_t expected_count1, + std::size_t expected_count1, std::size_t expected_point_count1, double expected_area1, - std::size_t expected_count2, + std::size_t expected_count2, std::size_t expected_point_count2, double expected_area2, double percentage = 0.0001) { G1 g1; - boost::geometry::read_wkt(wkt1, g1); + bg::read_wkt(wkt1, g1); G2 g2; - boost::geometry::read_wkt(wkt2, g2); + bg::read_wkt(wkt2, g2); test_difference(caseid + "_a", g1, g2, expected_count1, expected_point_count1, @@ -161,9 +161,9 @@ void test_one(std::string const& caseid, expected_count2, expected_point_count2, expected_area2, percentage); test_difference(caseid + "_s", g1, g2, - expected_count1 + expected_count2, + expected_count1 + expected_count2, expected_point_count1 + expected_point_count2, - expected_area1 + expected_area2, + expected_area1 + expected_area2, percentage, true); #ifdef BOOST_GEOMETRY_CHECK_WITH_POSTGIS @@ -172,27 +172,27 @@ void test_one(std::string const& caseid, << "select " << counter++ << ", '" << caseid << "' as caseid" << ", ST_NumPoints(ST_Difference(ST_GeomFromText('" << wkt1 << "'), " - << " ST_GeomFromText('" << wkt2 << "'))) " + << " ST_GeomFromText('" << wkt2 << "'))) " << ", ST_NumGeometries(ST_Difference(ST_GeomFromText('" << wkt1 << "'), " - << " ST_GeomFromText('" << wkt2 << "'))) " + << " ST_GeomFromText('" << wkt2 << "'))) " << ", ST_Area(ST_Difference(ST_GeomFromText('" << wkt1 << "'), " - << " ST_GeomFromText('" << wkt2 << "'))) " + << " ST_GeomFromText('" << wkt2 << "'))) " //<< ", " << expected_area1 << " as expected_area_a" //<< ", " << expected_count1 << " as expected_count_a" << ", ST_NumPoints(ST_Difference(ST_GeomFromText('" << wkt2 << "'), " - << " ST_GeomFromText('" << wkt1 << "'))) " + << " ST_GeomFromText('" << wkt1 << "'))) " << ", ST_NumGeometries(ST_Difference(ST_GeomFromText('" << wkt2 << "'), " - << " ST_GeomFromText('" << wkt1 << "'))) " + << " ST_GeomFromText('" << wkt1 << "'))) " << ", ST_Area(ST_Difference(ST_GeomFromText('" << wkt2 << "'), " - << " ST_GeomFromText('" << wkt1 << "'))) " + << " ST_GeomFromText('" << wkt1 << "'))) " //<< ", " << expected_area2 << " as expected_area_b" //<< ", " << expected_count2 << " as expected_count_b" << ", ST_NumPoints(ST_SymDifference(ST_GeomFromText('" << wkt1 << "'), " - << " ST_GeomFromText('" << wkt2 << "'))) " + << " ST_GeomFromText('" << wkt2 << "'))) " << ", ST_NumGeometries(ST_SymDifference(ST_GeomFromText('" << wkt1 << "'), " - << " ST_GeomFromText('" << wkt2 << "'))) " + << " ST_GeomFromText('" << wkt2 << "'))) " << ", ST_Area(ST_SymDifference(ST_GeomFromText('" << wkt1 << "'), " - << " ST_GeomFromText('" << wkt2 << "'))) " + << " ST_GeomFromText('" << wkt2 << "'))) " //<< ", " << expected_area1 + expected_area2 << " as expected_area_s" //<< ", " << expected_count1 + expected_count2 << " as expected_count_s" << std::endl; diff --git a/test/algorithms/test_dissolve.hpp b/test/algorithms/test_dissolve.hpp index a301ef6b7..3fa86765d 100644 --- a/test/algorithms/test_dissolve.hpp +++ b/test/algorithms/test_dissolve.hpp @@ -38,29 +38,28 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, std::size_t expected_hole_count, std::size_t expected_point_count, double expected_length_or_area, double percentage) { - namespace bg = boost::geometry; typedef typename bg::coordinate_type::type coordinate_type; static const bool is_line = bg::geometry_id::type::value == 2; - std::vector dissolved_vector; - bg::dissolve_inserter(geometry, std::back_inserter(dissolved_vector)); + std::vector dissolved_vector; + bg::dissolve_inserter(geometry, std::back_inserter(dissolved_vector)); - typename bg::area_result::type length_or_area = 0; - //std::size_t holes = 0; - std::size_t count = 0; + typename bg::area_result::type length_or_area = 0; + //std::size_t holes = 0; + std::size_t count = 0; - BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector) - { - bg::unique(dissolved); + BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector) + { + bg::unique(dissolved); - length_or_area += + length_or_area += is_line ? bg::length(dissolved) : bg::area(dissolved); - //holes += bg::num_interior_rings(dissolved); - count += bg::num_points(dissolved); - } + //holes += bg::num_interior_rings(dissolved); + count += bg::num_points(dissolved); + } BOOST_CHECK_MESSAGE(count == expected_point_count, "dissolve: " << caseid @@ -73,11 +72,11 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, //BOOST_CHECK_EQUAL(holes, expected_hole_count); BOOST_CHECK_CLOSE(length_or_area, expected_length_or_area, percentage); - // Compile check, it should also compile inplace, outputting to the same geometry - { - std::vector dissolved; - bg::dissolve(geometry, dissolved); - } + // Compile check, it should also compile inplace, outputting to the same geometry + { + std::vector dissolved; + bg::dissolve(geometry, dissolved); + } #if defined(TEST_WITH_SVG) @@ -97,11 +96,11 @@ void test_dissolve(std::string const& caseid, Geometry const& geometry, mapper.add(geometry); mapper.map(geometry, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1"); - BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector) - { - mapper.map(dissolved, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); - } - } + BOOST_FOREACH(GeometryOut& dissolved, dissolved_vector) + { + mapper.map(dissolved, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); + } + } #endif } @@ -112,7 +111,7 @@ void test_one(std::string const& caseid, std::string const& wkt, double expected_length_or_area, double percentage = 0.001) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_dissolve(caseid, geometry, expected_hole_count, expected_point_count, diff --git a/test/algorithms/test_distance.hpp b/test/algorithms/test_distance.hpp index 2f9b4ce7f..2c53af9af 100644 --- a/test/algorithms/test_distance.hpp +++ b/test/algorithms/test_distance.hpp @@ -16,7 +16,7 @@ // Define a custom distance strategy -// For this one, the "taxicab" distance, +// For this one, the "taxicab" distance, // see http://en.wikipedia.org/wiki/Taxicab_geometry // For a point-point-distance operation, one typename Point is enough. @@ -26,11 +26,11 @@ template struct taxicab_distance { - static inline typename boost::geometry::coordinate_type::type apply( - P1 const& p1, P2 const& p2) + static inline typename bg::coordinate_type::type apply( + P1 const& p1, P2 const& p2) { - using boost::geometry::get; - using boost::geometry::math::abs; + using bg::get; + using bg::math::abs; return abs(get<0>(p1) - get<1>(p2)) + abs(get<1>(p1) - get<1>(p2)); } @@ -38,7 +38,7 @@ struct taxicab_distance -namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services +namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services { template @@ -100,26 +100,26 @@ struct result_from_distance > }; -}}}}} // namespace boost::geometry::strategy::distance::services +}}}}} // namespace bg::strategy::distance::services template -void test_distance(Geometry1 const& geometry1, +void test_distance(Geometry1 const& geometry1, Geometry2 const& geometry2, long double expected_distance) { - long double distance = boost::geometry::distance(geometry1, geometry2); + long double distance = bg::distance(geometry1, geometry2); #ifdef GEOMETRY_TEST_DEBUG std::ostringstream out; - out << typeid(typename boost::geometry::coordinate_type::type).name() + out << typeid(typename bg::coordinate_type::type).name() << std::endl - << typeid(typename boost::geometry::distance_result::type).name() + << typeid(typename bg::distance_result::type).name() << std::endl - << "distance : " << boost::geometry::distance(geometry1, geometry2) + << "distance : " << bg::distance(geometry1, geometry2) << std::endl; std::cout << out.str(); #endif @@ -131,10 +131,10 @@ void test_distance(Geometry1 const& geometry1, template void test_geometry(std::string const& wkt1, std::string const& wkt2, double expected_distance) { - Geometry1 geometry1; - boost::geometry::read_wkt(wkt1, geometry1); - Geometry2 geometry2; - boost::geometry::read_wkt(wkt2, geometry2); + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); test_distance(geometry1, geometry2, expected_distance); } diff --git a/test/algorithms/test_envelope.hpp b/test/algorithms/test_envelope.hpp index e4b4b08d1..96cdce009 100644 --- a/test/algorithms/test_envelope.hpp +++ b/test/algorithms/test_envelope.hpp @@ -29,11 +29,11 @@ struct check_result<2> static void apply(Box const& b, const T& x1, const T& y1, const T& z1, const T& x2, const T& y2, const T& z2) { - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(x1), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(y1), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(x1), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(y1), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(x2), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(y2), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(x2), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(y2), 0.001); } }; @@ -44,13 +44,13 @@ struct check_result<3> static void apply(Box const& b, const T& x1, const T& y1, const T& z1, const T& x2, const T& y2, const T& z2) { - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(x1), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(y1), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(z1), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(x1), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(y1), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(z1), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(x2), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(y2), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get(b)), double(z2), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(x2), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(y2), 0.001); + BOOST_CHECK_CLOSE(double(bg::get(b)), double(z2), 0.001); } }; @@ -62,11 +62,11 @@ void test_envelope(std::string const& wkt, const T& z1 = 0, const T& z2 = 0) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::box::type > b; - boost::geometry::envelope(geometry, b); + bg::read_wkt(wkt, geometry); + bg::model::box::type > b; + bg::envelope(geometry, b); - check_result::type::value>::apply(b, x1, y1, z1, x2, y2, z2); + check_result::type::value>::apply(b, x1, y1, z1, x2, y2, z2); } template @@ -76,11 +76,11 @@ void test_envelope_strategy(std::string const& wkt, const T& z1 = 0, const T& z2 = 0) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::box::type > b; - boost::geometry::envelope(geometry, b); + bg::read_wkt(wkt, geometry); + bg::model::box::type > b; + bg::envelope(geometry, b); - check_result::type::value>::apply(b, x1, y1, z1, x2, y2, z2); + check_result::type::value>::apply(b, x1, y1, z1, x2, y2, z2); } diff --git a/test/algorithms/test_equals.hpp b/test/algorithms/test_equals.hpp index 996c96dcd..65ee88a71 100644 --- a/test/algorithms/test_equals.hpp +++ b/test/algorithms/test_equals.hpp @@ -28,10 +28,10 @@ void test_geometry(std::string const& caseid, Geometry1 geometry1; Geometry2 geometry2; - boost::geometry::read_wkt(wkt1, geometry1); - boost::geometry::read_wkt(wkt2, geometry2); + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); - bool detected = boost::geometry::equals(geometry1, geometry2); + bool detected = bg::equals(geometry1, geometry2); BOOST_CHECK_MESSAGE(detected == expected, "case: " << caseid diff --git a/test/algorithms/test_for_each.hpp b/test/algorithms/test_for_each.hpp index d2b19457f..0cb88125c 100644 --- a/test/algorithms/test_for_each.hpp +++ b/test/algorithms/test_for_each.hpp @@ -21,7 +21,7 @@ template inline void translate_x_function(Point& p) { - boost::geometry::set<0>(p, boost::geometry::get<0>(p) + 100.0); + bg::set<0>(p, bg::get<0>(p) + 100.0); } template @@ -29,7 +29,7 @@ struct scale_y_functor { inline void operator()(Point& p) { - boost::geometry::set<1>(p, boost::geometry::get<1>(p) * 100.0); + bg::set<1>(p, bg::get<1>(p) * 100.0); } }; @@ -44,7 +44,7 @@ struct sum_x_functor inline void operator()(Point const& p) { - sum += int(boost::geometry::get<0>(p)); + sum += int(bg::get<0>(p)); } }; @@ -54,7 +54,7 @@ static std::ostringstream g_out; template inline void stream_segment(Segment const& s) { - g_out << boost::geometry::dsv(s) << " "; + g_out << bg::dsv(s) << " "; } template @@ -67,16 +67,16 @@ struct sum_segment_length {} inline void operator()(Segment const& s) { - sum += boost::geometry::distance(s.first, s.second); + sum += bg::distance(s.first, s.second); } }; template inline void modify_segment(Segment& s) { - if (boost::geometry::math::equals(boost::geometry::get<0,0>(s), 1.0)) + if (bg::math::equals(bg::get<0,0>(s), 1.0)) { - boost::geometry::set<0,0>(s, 10.0); + bg::set<0,0>(s, 10.0); } } @@ -84,10 +84,10 @@ inline void modify_segment(Segment& s) template void test_per_point_const(Geometry const& geometry, int expected) { - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::point_type::type point_type; sum_x_functor functor; - functor = boost::geometry::for_each_point(geometry, functor); + functor = bg::for_each_point(geometry, functor); BOOST_CHECK_EQUAL(functor.sum, expected); } @@ -96,28 +96,28 @@ void test_per_point_non_const(Geometry& geometry, std::string const& expected1, std::string const& expected2) { - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::point_type::type point_type; // function - boost::geometry::for_each_point(geometry, translate_x_function); + bg::for_each_point(geometry, translate_x_function); std::ostringstream out1; - out1 << boost::geometry::wkt(geometry); + out1 << bg::wkt(geometry); BOOST_CHECK_MESSAGE(out1.str() == expected1, "for_each_point: " << " expected " << expected1 - << " got " << boost::geometry::wkt(geometry)); + << " got " << bg::wkt(geometry)); // functor - boost::geometry::for_each_point(geometry, scale_y_functor()); + bg::for_each_point(geometry, scale_y_functor()); std::ostringstream out2; - out2 << boost::geometry::wkt(geometry); + out2 << bg::wkt(geometry); BOOST_CHECK_MESSAGE(out2.str() == expected2, "for_each_point: " << " expected " << expected2 - << " got " << boost::geometry::wkt(geometry)); + << " got " << bg::wkt(geometry)); } @@ -129,7 +129,7 @@ void test_per_point(std::string const& wkt ) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_per_point_const(geometry, expected_sum_x); test_per_point_non_const(geometry, expected1, expected2); } @@ -141,20 +141,20 @@ void test_per_segment_const(Geometry const& geometry, std::string const& expected_dsv, double expected_length) { - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::point_type::type point_type; // function g_out.str(""); g_out.clear(); - boost::geometry::for_each_segment(geometry, - stream_segment >); + bg::for_each_segment(geometry, + stream_segment >); std::string out = g_out.str(); boost::trim(out); BOOST_CHECK_EQUAL(out, expected_dsv); // functor - sum_segment_length > functor; - functor = boost::geometry::for_each_segment(geometry, functor); + sum_segment_length > functor; + functor = bg::for_each_segment(geometry, functor); BOOST_CHECK_EQUAL(functor.sum, expected_length); } @@ -164,19 +164,19 @@ template void test_per_segment_non_const(Geometry& geometry, std::string const& expected_wkt) { - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::point_type::type point_type; // function - boost::geometry::for_each_segment(geometry, - modify_segment >); + bg::for_each_segment(geometry, + modify_segment >); std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_MESSAGE(out.str() == expected_wkt, "for_each_segment: " << " expected " << expected_wkt - << " got " << boost::geometry::wkt(geometry)); + << " got " << bg::wkt(geometry)); // function is working here, functor works for all others, // it will also work here. @@ -191,7 +191,7 @@ void test_per_segment(std::string const& wkt ) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_per_segment_const(geometry, expected_dsv, expected_length); test_per_segment_non_const(geometry, expected_wkt); } diff --git a/test/algorithms/test_intersection.hpp b/test/algorithms/test_intersection.hpp index bb24f0ae1..d884ba5fe 100644 --- a/test/algorithms/test_intersection.hpp +++ b/test/algorithms/test_intersection.hpp @@ -42,23 +42,23 @@ double test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2, double percentage = 0.0001, bool make_unique = true) { - static const bool is_line = boost::geometry::geometry_id::type::value == 2; + static const bool is_line = bg::geometry_id::type::value == 2; std::vector clip; - typedef typename boost::geometry::coordinate_type::type coordinate_type; - typedef typename boost::geometry::point_type::type point_type; + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; - typedef boost::geometry::strategy_intersection + typedef bg::strategy_intersection < - typename boost::geometry::cs_tag::type, + typename bg::cs_tag::type, G1, G2, point_type, CalculationType > strategy; - boost::geometry::intersection_inserter(g1, g2, std::back_inserter(clip), strategy()); + bg::intersection_inserter(g1, g2, std::back_inserter(clip), strategy()); double length_or_area = 0; @@ -73,25 +73,25 @@ double test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2, { // Get a correct point-count without duplicate points // (note that overlay might be adapted to avoid duplicates) - boost::geometry::unique(*it); - n += boost::geometry::num_points(*it, true); + bg::unique(*it); + n += bg::num_points(*it, true); } else { - n += boost::geometry::num_points(*it, true); + n += bg::num_points(*it, true); } } // instead of specialization we check it run-time here length_or_area += is_line - ? boost::geometry::length(*it) - : boost::geometry::area(*it); + ? bg::length(*it) + : bg::area(*it); /* std::cout << std::endl << "case " << caseid << " "; std::cout << std::setprecision(20) - << boost::geometry::dsv(*it) << std::endl; + << bg::dsv(*it) << std::endl; */ } @@ -124,11 +124,11 @@ double test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2, #if defined(TEST_WITH_SVG) { bool const ccw = - boost::geometry::point_order::value == boost::geometry::counterclockwise - || boost::geometry::point_order::value == boost::geometry::counterclockwise; + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; bool const open = - boost::geometry::closure::value == boost::geometry::open - || boost::geometry::closure::value == boost::geometry::open; + bg::closure::value == bg::open + || bg::closure::value == bg::open; std::ostringstream filename; filename << "intersection_" @@ -141,7 +141,7 @@ double test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2, std::ofstream svg(filename.str().c_str()); - boost::geometry::svg_mapper mapper(svg, 500, 500); + bg::svg_mapper mapper(svg, 500, 500); mapper.add(g1); mapper.add(g2); @@ -173,14 +173,14 @@ double test_one(std::string const& caseid, std::string const& wkt1, std::string bool make_unique = true) { G1 g1; - boost::geometry::read_wkt(wkt1, g1); + bg::read_wkt(wkt1, g1); G2 g2; - boost::geometry::read_wkt(wkt2, g2); + bg::read_wkt(wkt2, g2); // Reverse if necessary - boost::geometry::correct(g1); - boost::geometry::correct(g2); + bg::correct(g1); + bg::correct(g2); return test_intersection(caseid, g1, g2, expected_count, expected_point_count, diff --git a/test/algorithms/test_intersects.hpp b/test/algorithms/test_intersects.hpp index 1ef257c5e..517c190bf 100644 --- a/test/algorithms/test_intersects.hpp +++ b/test/algorithms/test_intersects.hpp @@ -27,10 +27,10 @@ void test_geometry(std::string const& wkt1, Geometry1 geometry1; Geometry2 geometry2; - boost::geometry::read_wkt(wkt1, geometry1); - boost::geometry::read_wkt(wkt2, geometry2); + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); - bool detected = boost::geometry::intersects(geometry1, geometry2); + bool detected = bg::intersects(geometry1, geometry2); BOOST_CHECK_MESSAGE(detected == expected, "intersects: " << wkt1 @@ -45,9 +45,9 @@ void test_self_intersects(std::string const& wkt, bool expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); - bool detected = boost::geometry::intersects(geometry); + bool detected = bg::intersects(geometry); BOOST_CHECK_MESSAGE(detected == expected, "intersects: " << wkt diff --git a/test/algorithms/test_length.hpp b/test/algorithms/test_length.hpp index d3a6a5081..fb6ce3bc8 100644 --- a/test/algorithms/test_length.hpp +++ b/test/algorithms/test_length.hpp @@ -18,15 +18,15 @@ template void test_length(Geometry const& geometry, long double expected_length) { - long double length = boost::geometry::length(geometry); + long double length = bg::length(geometry); #ifdef GEOMETRY_TEST_DEBUG std::ostringstream out; - out << typeid(typename boost::geometry::coordinate_type::type).name() + out << typeid(typename bg::coordinate_type::type).name() << std::endl - << typeid(typename boost::geometry::length_result::type).name() + << typeid(typename bg::length_result::type).name() << std::endl - << "length : " << boost::geometry::length(geometry) + << "length : " << bg::length(geometry) << std::endl; std::cout << out.str(); #endif @@ -39,7 +39,7 @@ template void test_geometry(std::string const& wkt, double expected_length) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_length(geometry, expected_length); } diff --git a/test/algorithms/test_overlaps.hpp b/test/algorithms/test_overlaps.hpp index b43138e8c..388613697 100644 --- a/test/algorithms/test_overlaps.hpp +++ b/test/algorithms/test_overlaps.hpp @@ -27,10 +27,10 @@ void test_geometry(std::string const& wkt1, Geometry1 geometry1; Geometry2 geometry2; - boost::geometry::read_wkt(wkt1, geometry1); - boost::geometry::read_wkt(wkt2, geometry2); + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); - bool detected = boost::geometry::overlaps(geometry1, geometry2); + bool detected = bg::overlaps(geometry1, geometry2); BOOST_CHECK_MESSAGE(detected == expected, "overlaps: " << wkt1 diff --git a/test/algorithms/test_perimeter.hpp b/test/algorithms/test_perimeter.hpp index 0a2765c3d..fe31f2e19 100644 --- a/test/algorithms/test_perimeter.hpp +++ b/test/algorithms/test_perimeter.hpp @@ -21,15 +21,15 @@ template void test_perimeter(Geometry const& geometry, long double expected_perimeter) { - long double perimeter = boost::geometry::perimeter(geometry); + long double perimeter = bg::perimeter(geometry); #ifdef GEOMETRY_TEST_DEBUG std::ostringstream out; - out << typeid(typename boost::geometry::coordinate_type::type).name() + out << typeid(typename bg::coordinate_type::type).name() << std::endl - << typeid(typename boost::geometry::perimeter_result::type).name() + << typeid(typename bg::perimeter_result::type).name() << std::endl - << "perimeter : " << boost::geometry::perimeter(geometry) + << "perimeter : " << bg::perimeter(geometry) << std::endl; std::cout << out.str(); #endif @@ -42,7 +42,7 @@ template void test_geometry(std::string const& wkt, double expected_perimeter) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_perimeter(geometry, expected_perimeter); } diff --git a/test/algorithms/test_reverse.hpp b/test/algorithms/test_reverse.hpp index 6309d24ca..eb005a69d 100644 --- a/test/algorithms/test_reverse.hpp +++ b/test/algorithms/test_reverse.hpp @@ -21,11 +21,11 @@ void test_geometry(std::string const& wkt, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::reverse(geometry); + bg::read_wkt(wkt, geometry); + bg::reverse(geometry); std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_MESSAGE(out.str() == expected, "reverse: " << wkt diff --git a/test/algorithms/test_simplify.hpp b/test/algorithms/test_simplify.hpp index 0ae2feca1..1e6bfa58f 100644 --- a/test/algorithms/test_simplify.hpp +++ b/test/algorithms/test_simplify.hpp @@ -25,16 +25,16 @@ struct test_inserter }; template -struct test_inserter +struct test_inserter { static void apply(Geometry& geometry, std::string const& expected, double distance) { Geometry simplified; - boost::geometry::simplify_inserter(geometry, + bg::simplify_inserter(geometry, std::back_inserter(simplified), distance); std::ostringstream out; - out << boost::geometry::wkt(simplified); + out << bg::wkt(simplified); BOOST_CHECK_EQUAL(out.str(), expected); } }; @@ -47,46 +47,46 @@ void test_geometry(std::string const& wkt, std::string const& expected, double d // Generate polygon using only integer coordinates and obvious results // Polygon is a hexagon, having one extra point (2,1) on a line which should be filtered out. - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::simplify(geometry, simplified, distance); + bg::read_wkt(wkt, geometry); + bg::simplify(geometry, simplified, distance); { std::ostringstream out; - out << boost::geometry::wkt(simplified); + out << bg::wkt(simplified); BOOST_CHECK_MESSAGE(out.str() == expected, - "simplify: " << boost::geometry::wkt(geometry) + "simplify: " << bg::wkt(geometry) << " expected " << expected - << " got " << boost::geometry::wkt(simplified)); + << " got " << bg::wkt(simplified)); } // Check using user-specified strategy - typedef typename boost::geometry::point_type::type point_type; - typedef typename boost::geometry::cs_tag::type tag; - typedef boost::geometry::strategy::distance::projected_point + typedef typename bg::point_type::type point_type; + typedef typename bg::cs_tag::type tag; + typedef bg::strategy::distance::projected_point < point_type, point_type > strategy; - typedef boost::geometry::strategy::simplify::douglas_peucker + typedef bg::strategy::simplify::douglas_peucker < point_type, strategy > simplify_strategy_type; - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::SimplifyStrategy) ); - boost::geometry::simplify(geometry, simplified, distance, simplify_strategy_type()); + BOOST_CONCEPT_ASSERT( (bg::concept::SimplifyStrategy) ); + bg::simplify(geometry, simplified, distance, simplify_strategy_type()); { std::ostringstream out; - out << boost::geometry::wkt(simplified); + out << bg::wkt(simplified); BOOST_CHECK_EQUAL(out.str(), expected); } // Check inserter (if applicable) test_inserter < - typename boost::geometry::tag::type, + typename bg::tag::type, Geometry >::apply(geometry, expected, distance); } diff --git a/test/algorithms/test_union.hpp b/test/algorithms/test_union.hpp index df5d5ca18..0d50268af 100644 --- a/test/algorithms/test_union.hpp +++ b/test/algorithms/test_union.hpp @@ -39,9 +39,9 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, std::size_t expected_point_count, double expected_area, double percentage) { - typedef typename boost::geometry::coordinate_type::type coordinate_type; + typedef typename bg::coordinate_type::type coordinate_type; std::vector clip; - boost::geometry::union_inserter(g1, g2, std::back_inserter(clip)); + bg::union_inserter(g1, g2, std::back_inserter(clip)); double area = 0; std::size_t n = 0; @@ -49,14 +49,14 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, for (typename std::vector::iterator it = clip.begin(); it != clip.end(); ++it) { - area += boost::geometry::area(*it); - holes += boost::geometry::num_interior_rings(*it); + area += bg::area(*it); + holes += bg::num_interior_rings(*it); // Get a correct point-count without duplicate points // (note that overlay might be adapted to avoid duplicates) OutputType simplified; - boost::geometry::unique(*it); - n += boost::geometry::num_points(*it, true); + bg::unique(*it); + n += bg::num_points(*it, true); } @@ -83,12 +83,12 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, #if defined(TEST_WITH_SVG) { - bool const ccw = - boost::geometry::point_order::value == boost::geometry::counterclockwise - || boost::geometry::point_order::value == boost::geometry::counterclockwise; - bool const open = - boost::geometry::closure::value == boost::geometry::open - || boost::geometry::closure::value == boost::geometry::open; + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + bool const open = + bg::closure::value == bg::open + || bg::closure::value == bg::open; std::ostringstream filename; filename << "union_" @@ -100,9 +100,9 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, std::ofstream svg(filename.str().c_str()); - boost::geometry::svg_mapper + bg::svg_mapper < - typename boost::geometry::point_type::type + typename bg::point_type::type > mapper(svg, 500, 500); mapper.add(g1); mapper.add(g2); @@ -132,14 +132,14 @@ void test_one(std::string const& caseid, std::string const& wkt1, std::string co double percentage = 0.001) { G1 g1; - boost::geometry::read_wkt(wkt1, g1); + bg::read_wkt(wkt1, g1); G2 g2; - boost::geometry::read_wkt(wkt2, g2); + bg::read_wkt(wkt2, g2); // Reverse if necessary - boost::geometry::correct(g1); - boost::geometry::correct(g2); + bg::correct(g1); + bg::correct(g2); test_union(caseid, g1, g2, expected_count, expected_hole_count, expected_point_count, diff --git a/test/algorithms/test_unique.hpp b/test/algorithms/test_unique.hpp index 10e46ae8b..9b4a5a91c 100644 --- a/test/algorithms/test_unique.hpp +++ b/test/algorithms/test_unique.hpp @@ -21,11 +21,11 @@ void test_geometry(std::string const& wkt, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::unique(geometry); + bg::read_wkt(wkt, geometry); + bg::unique(geometry); std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_MESSAGE(out.str() == expected, "unique: " << wkt diff --git a/test/algorithms/test_within.hpp b/test/algorithms/test_within.hpp index cfbd0a87a..545d6c4f4 100644 --- a/test/algorithms/test_within.hpp +++ b/test/algorithms/test_within.hpp @@ -24,7 +24,6 @@ template void test_geometry(std::string const& wkt1, std::string const& wkt2, bool expected) { - namespace bg = boost::geometry; Geometry1 geometry1; Geometry2 geometry2; @@ -45,8 +44,7 @@ template void test_ordered_ring(std::string const& wkt_point, std::string const& wkt_geometry, bool expected, bool on_border) { - namespace bg = boost::geometry; - typedef bg::linear_ring ring_type; + typedef bg::model::linear_ring ring_type; ring_type ring; Point point; @@ -115,7 +113,7 @@ void test_ring(std::string const& wkt_point, test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); - test_geometry >(wkt_point, wkt_geometry, expected); + test_geometry >(wkt_point, wkt_geometry, expected); } #endif diff --git a/test/algorithms/transform.cpp b/test/algorithms/transform.cpp index 20a1ddc25..0ec5aa8f9 100644 --- a/test/algorithms/transform.cpp +++ b/test/algorithms/transform.cpp @@ -26,28 +26,28 @@ template void test_transform_point(double value) { P1 p1; - boost::geometry::set<0>(p1, 1); - boost::geometry::set<1>(p1, 2); + bg::set<0>(p1, 1); + bg::set<1>(p1, 2); P2 p2; - BOOST_CHECK(boost::geometry::transform(p1, p2)); + BOOST_CHECK(bg::transform(p1, p2)); - BOOST_CHECK_CLOSE(value * boost::geometry::get<0>(p1), double(boost::geometry::get<0>(p2)), 0.001); - BOOST_CHECK_CLOSE(value * boost::geometry::get<1>(p1), double(boost::geometry::get<1>(p2)), 0.001); + BOOST_CHECK_CLOSE(value * bg::get<0>(p1), double(bg::get<0>(p2)), 0.001); + BOOST_CHECK_CLOSE(value * bg::get<1>(p1), double(bg::get<1>(p2)), 0.001); } template void test_transform_linestring() { - boost::geometry::linestring line1; - line1.push_back(boost::geometry::make(1, 1)); - line1.push_back(boost::geometry::make(2, 2)); - boost::geometry::linestring line2; - BOOST_CHECK(boost::geometry::transform(line1, line2)); + bg::model::linestring line1; + line1.push_back(bg::make(1, 1)); + line1.push_back(bg::make(2, 2)); + bg::model::linestring line2; + BOOST_CHECK(bg::transform(line1, line2)); BOOST_CHECK_EQUAL(line1.size(), line2.size()); std::ostringstream out1, out2; - out1 << boost::geometry::wkt(line1); - out2 << boost::geometry::wkt(line2); + out1 << bg::wkt(line1); + out2 << bg::wkt(line2); BOOST_CHECK_EQUAL(out1.str(), out1.str()); } @@ -62,14 +62,12 @@ void test_all(double value = 1.0) template void test_transformations(double phi, double theta, double r) { - using namespace boost::geometry; - - typedef point cartesian_type; + typedef bg::model::point cartesian_type; cartesian_type p; // 1: using spherical coordinates { - typedef point > spherical_type; + typedef bg::model::point > spherical_type; spherical_type sph1; assign(sph1, phi, theta, r); BOOST_CHECK(transform(sph1, p)); @@ -77,8 +75,8 @@ void test_transformations(double phi, double theta, double r) spherical_type sph2; BOOST_CHECK(transform(p, sph2)); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(sph1)), double(boost::geometry::get<0>(sph2)), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(sph1)), double(boost::geometry::get<1>(sph2)), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(sph1)), double(bg::get<0>(sph2)), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(sph1)), double(bg::get<1>(sph2)), 0.001); //std::cout << dsv(p) << std::endl; //std::cout << dsv(sph2) << std::endl; @@ -86,14 +84,14 @@ void test_transformations(double phi, double theta, double r) // 2: using spherical coordinates on unit sphere { - typedef point > spherical_type; + typedef bg::model::point > spherical_type; spherical_type sph1, sph2; assign(sph1, phi, theta); BOOST_CHECK(transform(sph1, p)); BOOST_CHECK(transform(p, sph2)); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(sph1)), double(boost::geometry::get<0>(sph2)), 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(sph1)), double(boost::geometry::get<1>(sph2)), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(sph1)), double(bg::get<0>(sph2)), 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(sph1)), double(bg::get<1>(sph2)), 0.001); //std::cout << dsv(sph1) << " " << dsv(p) << " " << dsv(sph2) << std::endl; } @@ -101,29 +99,23 @@ void test_transformations(double phi, double theta, double r) int test_main(int, char* []) { - using namespace boost::geometry; - using namespace boost::geometry::cs; - using namespace boost::geometry::math; - - - typedef boost::geometry::point_xy P; + typedef bg::model::point_xy P; test_all(); - test_all, boost::geometry::point_xy >(); + test_all, bg::model::point_xy >(); - test_all >, - boost::geometry::point > >(d2r); - test_all >, - boost::geometry::point > >(r2d); + test_all >, + bg::model::point > >(bg::math::d2r); + test_all >, + bg::model::point > >(bg::math::r2d); - test_all >, - boost::geometry::point > >(d2r); + test_all >, + bg::model::point > >(bg::math::d2r); - test_transformations(4, 52, 1); - test_transformations(4, 52, 1); - - test_transformations(3 * d2r, 51 * d2r, 1); - test_transformations(3 * d2r, 51 * d2r, 1); + test_transformations(4, 52, 1); + test_transformations(4, 52, 1); + test_transformations(3 * bg::math::d2r, 51 * bg::math::d2r, 1); + test_transformations(3 * bg::math::d2r, 51 * bg::math::d2r, 1); return 0; } diff --git a/test/algorithms/union.cpp b/test/algorithms/union.cpp index b54c0fd10..20b24eac0 100644 --- a/test/algorithms/union.cpp +++ b/test/algorithms/union.cpp @@ -195,7 +195,7 @@ void test_areal() /*** TODO: review this. Even on gcc the number of points are different. { - std::string tn = string_from_type::type>::name(); + std::string tn = string_from_type::type>::name(); //std::cout << tn << std::endl; test_one("isovist", isovist[0], isovist[1], 1, 0, @@ -218,18 +218,18 @@ void test_areal() template void test_all() { - typedef boost::geometry::polygon

polygon; - typedef boost::geometry::linear_ring

ring; - typedef boost::geometry::box

box; + typedef bg::model::polygon

polygon; + typedef bg::model::linear_ring

ring; + typedef bg::model::box

box; test_areal(); - test_areal, - boost::geometry::model::polygon >(); + test_areal, + bg::model::polygon >(); /* TODO: ccw has one new error in 'wrapped' due to new approach, SOLVE THIS - test_areal, - boost::geometry::model::polygon >(); + test_areal, + bg::model::polygon >(); */ test_one("box_ring", example_box, example_ring, 1, 1, 15, 6.38875); @@ -271,12 +271,12 @@ TODO: ccw has one new error in 'wrapped' due to new approach, SOLVE THIS int test_main(int, char* []) { - test_all >(); - test_all >(); - //test_all >(); + test_all >(); + test_all >(); + //test_all >(); -#if defined(HAVE_CLN) - test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/algorithms/unique.cpp b/test/algorithms/unique.cpp index e734aa586..e55bd3426 100644 --- a/test/algorithms/unique.cpp +++ b/test/algorithms/unique.cpp @@ -14,30 +14,30 @@ template void test_all() { - test_geometry >( + test_geometry >( "LINESTRING(0 0,1 1)", "LINESTRING(0 0,1 1)"); - test_geometry >( + test_geometry >( "LINESTRING(0 0,1 1,1 1)", "LINESTRING(0 0,1 1)"); - test_geometry >( + test_geometry >( "LINESTRING(0 0,0 0,1 1)", "LINESTRING(0 0,1 1)"); // Consecutive points - test_geometry >( + test_geometry >( "LINESTRING(0 0,0 0,0 0,0 0,1 1,1 1,1 1)", "LINESTRING(0 0,1 1)"); // Other types - test_geometry >( + test_geometry >( "POLYGON((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0))", "POLYGON((0 0,0 1,1 1,1 0,0 0))"); // With holes - test_geometry >( + test_geometry >( "POLYGON((0 0,0 10,10 10,10 10,10 10,10 0,0 0,0 0))", "POLYGON((0 0,0 10,10 10,10 0,0 0))"); } @@ -46,8 +46,8 @@ void test_all() int test_main(int, char* []) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/algorithms/within.cpp b/test/algorithms/within.cpp index 08d4ab2b7..dc13b2f74 100644 --- a/test/algorithms/within.cpp +++ b/test/algorithms/within.cpp @@ -36,17 +36,17 @@ void test_all() test_ring

("POINT(3 3)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", false, true); // holes - test_geometry >("POINT(2 2)", + test_geometry >("POINT(2 2)", "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 1,3 3,1 3,1 1))", false); - test_geometry >("POINT(1 1)", "BOX(0 0,2 2)", true); + test_geometry >("POINT(1 1)", "BOX(0 0,2 2)", true); // Mixed point types test_geometry < - boost::geometry::point_xy, - boost::geometry::polygon

+ bg::model::point_xy, + bg::model::polygon

>("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); @@ -67,14 +67,11 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/arithmetic/arithmetic.cpp b/test/arithmetic/arithmetic.cpp index 78e1338b4..72eff00ed 100644 --- a/test/arithmetic/arithmetic.cpp +++ b/test/arithmetic/arithmetic.cpp @@ -20,78 +20,76 @@ #include -using namespace boost::geometry; - template void test_addition() { P p1; - boost::geometry::assign(p1, 1, 2, 3); - boost::geometry::add_value(p1, 10); - BOOST_CHECK(get<0>(p1) == 11); - BOOST_CHECK(get<1>(p1) == 12); - BOOST_CHECK(get<2>(p1) == 13); + bg::assign(p1, 1, 2, 3); + bg::add_value(p1, 10); + BOOST_CHECK(bg::get<0>(p1) == 11); + BOOST_CHECK(bg::get<1>(p1) == 12); + BOOST_CHECK(bg::get<2>(p1) == 13); P p2; - boost::geometry::assign(p2, 4, 5, 6); - boost::geometry::add_point(p1, p2); - BOOST_CHECK(get<0>(p1) == 15); - BOOST_CHECK(get<1>(p1) == 17); - BOOST_CHECK(get<2>(p1) == 19); + bg::assign(p2, 4, 5, 6); + bg::add_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 15); + BOOST_CHECK(bg::get<1>(p1) == 17); + BOOST_CHECK(bg::get<2>(p1) == 19); } template void test_subtraction() { P p1; - boost::geometry::assign(p1, 1, 2, 3); - boost::geometry::subtract_value(p1, 10); - BOOST_CHECK(get<0>(p1) == -9); - BOOST_CHECK(get<1>(p1) == -8); - BOOST_CHECK(get<2>(p1) == -7); + bg::assign(p1, 1, 2, 3); + bg::subtract_value(p1, 10); + BOOST_CHECK(bg::get<0>(p1) == -9); + BOOST_CHECK(bg::get<1>(p1) == -8); + BOOST_CHECK(bg::get<2>(p1) == -7); P p2; - boost::geometry::assign(p2, 4, 6, 8); - boost::geometry::subtract_point(p1, p2); - BOOST_CHECK(get<0>(p1) == -13); - BOOST_CHECK(get<1>(p1) == -14); - BOOST_CHECK(get<2>(p1) == -15); + bg::assign(p2, 4, 6, 8); + bg::subtract_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == -13); + BOOST_CHECK(bg::get<1>(p1) == -14); + BOOST_CHECK(bg::get<2>(p1) == -15); } template void test_multiplication() { P p1; - boost::geometry::assign(p1, 1, 2, 3); - boost::geometry::multiply_value(p1, 5); - BOOST_CHECK(get<0>(p1) == 5); - BOOST_CHECK(get<1>(p1) == 10); - BOOST_CHECK(get<2>(p1) == 15); + bg::assign(p1, 1, 2, 3); + bg::multiply_value(p1, 5); + BOOST_CHECK(bg::get<0>(p1) == 5); + BOOST_CHECK(bg::get<1>(p1) == 10); + BOOST_CHECK(bg::get<2>(p1) == 15); P p2; - boost::geometry::assign(p2, 4, 5, 6); - boost::geometry::multiply_point(p1, p2); - BOOST_CHECK(get<0>(p1) == 20); - BOOST_CHECK(get<1>(p1) == 50); - BOOST_CHECK(get<2>(p1) == 90); + bg::assign(p2, 4, 5, 6); + bg::multiply_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 20); + BOOST_CHECK(bg::get<1>(p1) == 50); + BOOST_CHECK(bg::get<2>(p1) == 90); } template void test_division() { P p1; - boost::geometry::assign(p1, 50, 100, 150); - boost::geometry::divide_value(p1, 5); - BOOST_CHECK(get<0>(p1) == 10); - BOOST_CHECK(get<1>(p1) == 20); - BOOST_CHECK(get<2>(p1) == 30); + bg::assign(p1, 50, 100, 150); + bg::divide_value(p1, 5); + BOOST_CHECK(bg::get<0>(p1) == 10); + BOOST_CHECK(bg::get<1>(p1) == 20); + BOOST_CHECK(bg::get<2>(p1) == 30); P p2; - boost::geometry::assign(p2, 2, 4, 6); - boost::geometry::divide_point(p1, p2); - BOOST_CHECK(get<0>(p1) == 5); - BOOST_CHECK(get<1>(p1) == 5); - BOOST_CHECK(get<2>(p1) == 5); + bg::assign(p2, 2, 4, 6); + bg::divide_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 5); + BOOST_CHECK(bg::get<1>(p1) == 5); + BOOST_CHECK(bg::get<2>(p1) == 5); } @@ -111,9 +109,9 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/arithmetic/cross_product.cpp b/test/arithmetic/cross_product.cpp index c8bf99e7a..055363fa0 100644 --- a/test/arithmetic/cross_product.cpp +++ b/test/arithmetic/cross_product.cpp @@ -17,34 +17,33 @@ #include #include -using namespace boost::geometry; template void test_2d() { P p1; - boost::geometry::assign(p1, 20, 30); + bg::assign(p1, 20, 30); P p2; - boost::geometry::assign(p2, 45, 70); - P c = boost::geometry::cross_product(p1, p2); + bg::assign(p2, 45, 70); + P c = bg::cross_product(p1, p2); - typedef typename boost::geometry::coordinate_type

::type scalar_type; - BOOST_CHECK_EQUAL(boost::geometry::get<0>(c), scalar_type(50)); + typedef typename bg::coordinate_type

::type scalar_type; + BOOST_CHECK_EQUAL(bg::get<0>(c), scalar_type(50)); } template void test_3d() { P p1; - boost::geometry::assign(p1, 20, 30, 10); + bg::assign(p1, 20, 30, 10); P p2; - boost::geometry::assign(p2, 45, 70, 20); - P c = boost::geometry::cross_product(p1, p2); + bg::assign(p2, 45, 70, 20); + P c = bg::cross_product(p1, p2); - typedef typename boost::geometry::coordinate_type

::type scalar_type; - BOOST_CHECK_EQUAL(boost::geometry::get<0>(c), scalar_type(-100)); - BOOST_CHECK_EQUAL(boost::geometry::get<1>(c), scalar_type(50)); - BOOST_CHECK_EQUAL(boost::geometry::get<2>(c), scalar_type(50)); + typedef typename bg::coordinate_type

::type scalar_type; + BOOST_CHECK_EQUAL(bg::get<0>(c), scalar_type(-100)); + BOOST_CHECK_EQUAL(bg::get<1>(c), scalar_type(50)); + BOOST_CHECK_EQUAL(bg::get<2>(c), scalar_type(50)); } #ifdef TEST_FAIL_CROSS_PRODUCT @@ -52,27 +51,27 @@ template void test_4d() { P p1; - boost::geometry::assign(p1, 20, 30, 10, 15); + bg::assign(p1, 20, 30, 10, 15); P p2; - boost::geometry::assign(p2, 45, 70, 20, 35); - P c = boost::geometry::cross_product(p1, p2); + bg::assign(p2, 45, 70, 20, 35); + P c = bg::cross_product(p1, p2); } #endif int test_main(int, char* []) { - test_2d >(); - test_2d >(); - test_2d >(); + test_2d >(); + test_2d >(); + test_2d >(); - test_3d >(); - test_3d >(); - test_3d >(); + test_3d >(); + test_3d >(); + test_3d >(); #ifdef TEST_FAIL_CROSS_PRODUCT - test_4d >(); - test_4d >(); - test_4d >(); + test_4d >(); + test_4d >(); + test_4d >(); #endif return 0; diff --git a/test/arithmetic/dot_product.cpp b/test/arithmetic/dot_product.cpp index 31c780fe8..d6a35462b 100644 --- a/test/arithmetic/dot_product.cpp +++ b/test/arithmetic/dot_product.cpp @@ -20,16 +20,14 @@ #include -using namespace boost::geometry; - template void test_all() { P p1; - boost::geometry::assign(p1, 1, 2, 3); + bg::assign(p1, 1, 2, 3); P p2; - boost::geometry::assign(p2, 4, 5, 6); - BOOST_CHECK(boost::geometry::dot_product(p1, p2) == 1*4 + 2*5 + 3*6); + bg::assign(p2, 4, 5, 6); + BOOST_CHECK(bg::dot_product(p1, p2) == 1*4 + 2*5 + 3*6); } int test_main(int, char* []) @@ -38,9 +36,9 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/compile_test.cpp b/test/compile_test.cpp index e3d7343d3..d45f97505 100644 --- a/test/compile_test.cpp +++ b/test/compile_test.cpp @@ -33,7 +33,7 @@ struct modifying_functor p.x(1); } - inline void operator()(boost::geometry::segment

& s) + inline void operator()(bg::segment

& s) { s.first.x(1); } @@ -50,7 +50,7 @@ struct const_functor sum += p.x(); } - inline void operator()(boost::geometry::segment

const& s) + inline void operator()(bg::segment

const& s) { sum += s.first.x() - s.second.x(); } @@ -59,31 +59,31 @@ struct const_functor template class V> void check_linestring() { - typedef boost::geometry::point_xy P; - typedef boost::geometry::linestring line_type; + typedef bg::model::point_xy P; + typedef bg::model::linestring line_type; line_type line; line.push_back(P(0,0)); line.push_back(P(1,1)); - typedef boost::geometry::multi_linestring multi_line_type; + typedef bg::multi_linestring multi_line_type; multi_line_type multi; multi.push_back(line); - double len = boost::geometry::length(line); - len = boost::geometry::length(multi); - double d = boost::geometry::distance(P(0,1), line); - //d = boost::geometry::distance(P(0,1), multi); not defined yet! + double len = bg::length(line); + len = bg::length(multi); + double d = bg::distance(P(0,1), line); + //d = bg::distance(P(0,1), multi); not defined yet! line_type simp; - boost::geometry::simplify(line, simp, 3); + bg::simplify(line, simp, 3); multi_line_type simpm; - boost::geometry::simplify(multi, simpm, 3); + bg::simplify(multi, simpm, 3); - typedef boost::geometry::box

box_type; + typedef bg::model::box

box_type; box_type box1; - boost::geometry::envelope(line, box1); + bg::envelope(line, box1); box_type box2; - boost::geometry::envelope(multi, box2); + bg::envelope(multi, box2); // FIXME: Where is output stream op for line/multi --mloskot //std::stringstream out; @@ -98,20 +98,20 @@ void check_linestring() const line_type& cl = line; const multi_line_type& cm = multi; - boost::geometry::for_each_point(cl, cf); - boost::geometry::for_each_point(cm, cf); - boost::geometry::for_each_segment(cl, cf); - boost::geometry::for_each_segment(cm, cf); + bg::for_each_point(cl, cf); + bg::for_each_point(cm, cf); + bg::for_each_segment(cl, cf); + bg::for_each_segment(cm, cf); // For each, modifying modifying_functor

mf; line_type& ml = line; multi_line_type& mm = multi; std::for_each(line.begin(), line.end(), mf); - boost::geometry::for_each_point(ml, mf); - boost::geometry::for_each_point(mm, mf); - boost::geometry::for_each_segment(ml, mf); - boost::geometry::for_each_segment(mm, mf); + bg::for_each_point(ml, mf); + bg::for_each_point(mm, mf); + bg::for_each_segment(ml, mf); + bg::for_each_segment(mm, mf); */ } @@ -124,51 +124,51 @@ template > void check_polygon() { - typedef boost::geometry::point_xy P; - typedef boost::geometry::polygon Y; + typedef bg::model::point_xy P; + typedef bg::model::polygon Y; Y poly; poly.outer().push_back(P(0,0)); poly.outer().push_back(P(2,0)); poly.outer().push_back(P(2,2)); poly.outer().push_back(P(0,2)); - boost::geometry::correct(poly); + bg::correct(poly); // multi - typedef boost::geometry::multi_polygon MY; + typedef bg::multi_polygon MY; MY multi; multi.push_back(poly); - double a = boost::geometry::area(poly); - a = boost::geometry::area(multi); + double a = bg::area(poly); + a = bg::area(multi); - //double d = boost::geometry::distance(P(0,1), poly); + //double d = bg::distance(P(0,1), poly); Y simp; - boost::geometry::simplify(poly, simp, 3); + bg::simplify(poly, simp, 3); MY msimp; - boost::geometry::simplify(multi, msimp, 3); + bg::simplify(multi, msimp, 3); - typedef boost::geometry::box

box_type; + typedef bg::model::box

box_type; box_type box1; - boost::geometry::envelope(poly, box1); + bg::envelope(poly, box1); box_type box2; - boost::geometry::envelope(multi, box2); + bg::envelope(multi, box2); P ctr; - boost::geometry::centroid(poly, ctr); + bg::centroid(poly, ctr); // within - boost::geometry::point_2d circ_centre(10,10); + bg::model::point_2d circ_centre(10,10); - bool w = boost::geometry::within(P(1, 1), poly); - //w = boost::geometry::within(poly, b); tbd - w = boost::geometry::within(P(1, 1), multi); + bool w = bg::within(P(1, 1), poly); + //w = bg::within(poly, b); tbd + w = bg::within(P(1, 1), multi); - //boost::geometry::circle circ(circ_centre, 10); - //w = boost::geometry::within(poly, circ); - //w = boost::geometry::within(multi, circ); - //w = boost::geometry::within(multi, b); tbd + //bg::circle circ(circ_centre, 10); + //w = bg::within(poly, circ); + //w = bg::within(multi, circ); + //w = bg::within(multi, b); tbd // For each, const /* TODO: Fix for_each/functor @@ -178,20 +178,20 @@ void check_polygon() const Y& cp = poly; const MY& cm = multi; - boost::geometry::for_each_point(cp, cf); - boost::geometry::for_each_point(cm, cf); - boost::geometry::for_each_segment(cp, cf); - boost::geometry::for_each_segment(cm, cf); + bg::for_each_point(cp, cf); + bg::for_each_point(cm, cf); + bg::for_each_segment(cp, cf); + bg::for_each_segment(cm, cf); // For each, modifying modifying_functor

mf; Y& mp = poly; MY& mm = multi; std::for_each(poly.outer().begin(), poly.outer().end(), mf); - boost::geometry::for_each_point(mp, mf); - boost::geometry::for_each_point(mm, mf); - boost::geometry::for_each_segment(mp, mf); - boost::geometry::for_each_segment(mm, mf); + bg::for_each_point(mp, mf); + bg::for_each_point(mm, mf); + bg::for_each_segment(mp, mf); + bg::for_each_segment(mm, mf); */ } diff --git a/test/core/access.cpp b/test/core/access.cpp index 74a99d178..12509b1ee 100644 --- a/test/core/access.cpp +++ b/test/core/access.cpp @@ -30,14 +30,14 @@ template void test_get_set() { - typedef typename boost::geometry::coordinate_type::type coordinate_type; + typedef typename bg::coordinate_type::type coordinate_type; G g; - boost::geometry::set<0>(g, coordinate_type(1)); - boost::geometry::set<1>(g, coordinate_type(2)); + bg::set<0>(g, coordinate_type(1)); + bg::set<1>(g, coordinate_type(2)); - coordinate_type x = boost::geometry::get<0>(g); - coordinate_type y = boost::geometry::get<1>(g); + coordinate_type x = bg::get<0>(g); + coordinate_type y = bg::get<1>(g); BOOST_CHECK_CLOSE(double(x), 1.0, 0.0001); BOOST_CHECK_CLOSE(double(y), 2.0, 0.0001); @@ -46,16 +46,16 @@ void test_get_set() template void test_indexed_get_set(G& g) { - boost::geometry::set<0, 0>(g, 1); - boost::geometry::set<0, 1>(g, 2); - boost::geometry::set<1, 0>(g, 3); - boost::geometry::set<1, 1>(g, 4); + bg::set<0, 0>(g, 1); + bg::set<0, 1>(g, 2); + bg::set<1, 0>(g, 3); + bg::set<1, 1>(g, 4); - typedef typename boost::geometry::coordinate_type::type coordinate_type; - coordinate_type x1 = boost::geometry::get<0, 0>(g); - coordinate_type y1 = boost::geometry::get<0, 1>(g); - coordinate_type x2 = boost::geometry::get<1, 0>(g); - coordinate_type y2 = boost::geometry::get<1, 1>(g); + typedef typename bg::coordinate_type::type coordinate_type; + coordinate_type x1 = bg::get<0, 0>(g); + coordinate_type y1 = bg::get<0, 1>(g); + coordinate_type x2 = bg::get<1, 0>(g); + coordinate_type y2 = bg::get<1, 1>(g); BOOST_CHECK_CLOSE(double(x1), 1.0, 0.0001); BOOST_CHECK_CLOSE(double(y1), 2.0, 0.0001); @@ -66,10 +66,10 @@ void test_indexed_get_set(G& g) template void test_indexed_get(G const& g, T a, T b, T c, T d) { - T x1 = boost::geometry::get<0, 0>(g); - T y1 = boost::geometry::get<0, 1>(g); - T x2 = boost::geometry::get<1, 0>(g); - T y2 = boost::geometry::get<1, 1>(g); + T x1 = bg::get<0, 0>(g); + T y1 = bg::get<0, 1>(g); + T x2 = bg::get<1, 0>(g); + T y2 = bg::get<1, 1>(g); BOOST_CHECK_CLOSE(double(x1), double(a), 0.0001); BOOST_CHECK_CLOSE(double(y1), double(b), 0.0001); @@ -80,28 +80,28 @@ void test_indexed_get(G const& g, T a, T b, T c, T d) template void test_all() { - typedef typename boost::geometry::coordinate_type

::type coordinate_type; + typedef typename bg::coordinate_type

::type coordinate_type; // POINT, setting coordinate test_get_set

(); // BOX, setting left/right/top/bottom - boost::geometry::box

b; + bg::model::box

b; test_indexed_get_set(b); // SEGMENT (in GGL not having default constructor; however that is not a requirement) - P p1 = boost::geometry::make_zero

(); - P p2 = boost::geometry::make_zero

(); - boost::geometry::segment

s(p1, p2); + P p1 = bg::make_zero

(); + P p2 = bg::make_zero

(); + bg::model::referring_segment

s(p1, p2); test_indexed_get_set(s); // CONST SEGMENT - boost::geometry::set<0>(p1, 1); // we don't use assign because dim in {2,3} - boost::geometry::set<1>(p1, 2); - boost::geometry::set<0>(p2, 3); - boost::geometry::set<1>(p2, 4); - boost::geometry::segment cs(p1, p2); + bg::set<0>(p1, 1); // we don't use assign because dim in {2,3} + bg::set<1>(p1, 2); + bg::set<0>(p2, 3); + bg::set<1>(p2, 4); + bg::model::referring_segment

cs(p1, p2); test_indexed_get(cs, coordinate_type(1), coordinate_type(2), coordinate_type(3), coordinate_type(4)); @@ -117,9 +117,9 @@ int test_main(int, char* []) test_get_set >(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/core/coordinate_dimension.cpp b/test/core/coordinate_dimension.cpp index 8887058be..8faa150d6 100644 --- a/test/core/coordinate_dimension.cpp +++ b/test/core/coordinate_dimension.cpp @@ -27,20 +27,20 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(boost::geometry::dimension::type::value, Expected); + BOOST_CHECK_EQUAL(bg::dimension::type::value, Expected); } template void test_all() { test_geometry(); - test_geometry(); - test_geometry , D>(); - test_geometry , D>(); - test_geometry , D>(); - test_geometry , D>(); - test_geometry , D>(); - test_geometry , D>(); + test_geometry

(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); test_geometry, D>(); test_geometry, D>(); @@ -61,9 +61,9 @@ int test_main(int, char* []) test_geometry, 2>(); test_geometry, 3>(); - test_all, 2 >(); - test_all, 2 >(); - test_all, 2 >(); + test_all, 2 >(); + test_all, 2 >(); + test_all, 2 >(); return 0; } diff --git a/test/core/coordinate_system.cpp b/test/core/coordinate_system.cpp index 86ef87570..25c8a7a6e 100644 --- a/test/core/coordinate_system.cpp +++ b/test/core/coordinate_system.cpp @@ -27,7 +27,7 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(typeid(typename boost::geometry::coordinate_system::type).name(), + BOOST_CHECK_EQUAL(typeid(typename bg::coordinate_system::type).name(), typeid(Expected).name()); } @@ -35,13 +35,13 @@ template void test_all() { test_geometry(); - test_geometry(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); + test_geometry

(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); test_geometry, Expected>(); test_geometry, Expected>(); @@ -52,45 +52,45 @@ void test_all() int test_main(int, char* []) { // Because of the included headerfiles, there are always cartesian - test_geometry(); - test_geometry(); - test_geometry(); + test_geometry(); + test_geometry(); + test_geometry(); - test_geometry(); - test_geometry(); - test_geometry(); + test_geometry(); + test_geometry(); + test_geometry(); // Because of the included headerfiles, there are always cartesian - test_geometry, boost::geometry::cs::cartesian>(); - test_geometry, boost::geometry::cs::cartesian>(); + test_geometry, bg::cs::cartesian>(); + test_geometry, bg::cs::cartesian>(); // Test cartesian - test_all, boost::geometry::cs::cartesian>(); - test_all, boost::geometry::cs::cartesian>(); - test_all, boost::geometry::cs::cartesian>(); + test_all, bg::cs::cartesian>(); + test_all, bg::cs::cartesian>(); + test_all, bg::cs::cartesian>(); // Test spherical - test_all >, - boost::geometry::cs::spherical >(); - test_all >, - boost::geometry::cs::spherical >(); - test_all >, - boost::geometry::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); - test_all >, - boost::geometry::cs::spherical >(); - test_all >, - boost::geometry::cs::spherical >(); - test_all >, - boost::geometry::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); // Test other - test_all >, - boost::geometry::cs::polar >(); + test_all >, + bg::cs::polar >(); - test_all >, - boost::geometry::cs::geographic >(); + test_all >, + bg::cs::geographic >(); return 0; } diff --git a/test/core/coordinate_type.cpp b/test/core/coordinate_type.cpp index 33d0b46ba..fb513ceaa 100644 --- a/test/core/coordinate_type.cpp +++ b/test/core/coordinate_type.cpp @@ -27,7 +27,7 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(typeid(typename boost::geometry::coordinate_type::type).name(), + BOOST_CHECK_EQUAL(typeid(typename bg::coordinate_type::type).name(), typeid(Expected).name()); } @@ -35,13 +35,13 @@ template void test_all() { test_geometry(); - test_geometry(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); - test_geometry , Expected>(); + test_geometry

(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); test_geometry, Expected>(); test_geometry, Expected>(); @@ -64,10 +64,10 @@ int test_main(int, char* []) test_geometry, long double>(); test_geometry, double>(); - test_all, int>(); - test_all, float>(); - test_all, double>(); - test_all, long double>(); + test_all, int>(); + test_all, float>(); + test_all, double>(); + test_all, long double>(); return 0; } diff --git a/test/core/geometry_id.cpp b/test/core/geometry_id.cpp index 36502a9a4..eadf424e2 100644 --- a/test/core/geometry_id.cpp +++ b/test/core/geometry_id.cpp @@ -26,20 +26,20 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(boost::geometry::geometry_id::type::value, Expected); + BOOST_CHECK_EQUAL(bg::geometry_id::type::value, Expected); } template void test_all() { test_geometry(); - test_geometry(); - test_geometry , 2>(); - test_geometry , 93>(); - test_geometry , 3>(); - test_geometry , 94>(); - test_geometry , 92>(); - test_geometry , 92>(); + test_geometry

(); + test_geometry , 2>(); + test_geometry , 93>(); + test_geometry , 3>(); + test_geometry , 94>(); + test_geometry , 92>(); + test_geometry , 92>(); test_geometry, 2>(); test_geometry, 2>(); @@ -60,9 +60,9 @@ int test_main(int, char* []) test_geometry, 1>(); test_geometry, 1>(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/core/point_type.cpp b/test/core/point_type.cpp index fe2b0673d..a21d3f45a 100644 --- a/test/core/point_type.cpp +++ b/test/core/point_type.cpp @@ -26,7 +26,7 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(typeid(typename boost::geometry::point_type::type).name(), + BOOST_CHECK_EQUAL(typeid(typename bg::point_type::type).name(), typeid(Expected).name()); } @@ -34,13 +34,13 @@ template void test_all() { test_geometry(); - test_geometry(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); + test_geometry

(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); test_geometry, P>(); test_geometry, P>(); @@ -63,9 +63,9 @@ int test_main(int, char* []) test_geometry, boost::tuple >(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/core/radian_access.cpp b/test/core/radian_access.cpp index a8974b58c..d8ed32bc2 100644 --- a/test/core/radian_access.cpp +++ b/test/core/radian_access.cpp @@ -21,12 +21,12 @@ void test_get(T const& c, T const& e) { //std::cout << "get_as_radian " << typeid(P).name() << std::endl; - typedef typename boost::geometry::coordinate_type

::type coordinate_type; + typedef typename bg::coordinate_type

::type coordinate_type; P p; - boost::geometry::set(p, coordinate_type(c)); + bg::set(p, coordinate_type(c)); - coordinate_type g = boost::geometry::get_as_radian(p); + coordinate_type g = bg::get_as_radian(p); BOOST_CHECK_CLOSE(double(g), double(e), 0.0001); } @@ -37,12 +37,12 @@ void test_set(T const& c, T const& e) { //std::cout << "set_from_radian " << typeid(P).name() << std::endl; - typedef typename boost::geometry::coordinate_type

::type coordinate_type; + typedef typename bg::coordinate_type

::type coordinate_type; P p; - boost::geometry::set_from_radian(p, coordinate_type(c)); + bg::set_from_radian(p, coordinate_type(c)); - coordinate_type g = boost::geometry::get(p); + coordinate_type g = bg::get(p); BOOST_CHECK_CLOSE(double(g), double(e), 0.0001); } @@ -54,40 +54,40 @@ void test() double d2r = 3.1415926535897932384626433832795 / 180.0; // Degree - test_get<0, boost::geometry::point > > + test_get<0, bg::model::point > > (1.0, 1.0 * d2r); - test_get<1, boost::geometry::point > > + test_get<1, bg::model::point > > (2.0, 2.0 * d2r); - test_set<0, boost::geometry::point > > + test_set<0, bg::model::point > > (1.0, 1.0 / d2r); - test_set<1, boost::geometry::point > > + test_set<1, bg::model::point > > (2.0, 2.0 / d2r); // Radian - test_get<0, boost::geometry::point > > + test_get<0, bg::model::point > > (1.0, 1.0); - test_get<1, boost::geometry::point > > + test_get<1, bg::model::point > > (1.0, 1.0); - test_set<0, boost::geometry::point > > + test_set<0, bg::model::point > > (1.0, 1.0); - test_set<1, boost::geometry::point > > + test_set<1, bg::model::point > > (1.0, 1.0); // Cartesian (== untouched, no conversion) - test_get<0, boost::geometry::point > + test_get<0, bg::model::point > (1.0, 1.0); - test_get<1, boost::geometry::point > + test_get<1, bg::model::point > (1.0, 1.0); // Dimension >=2, should always be untouched, even for degree // (assuming lat/lon + height) - test_set<2, boost::geometry::point > > + test_set<2, bg::model::point > > (1.0, 1.0); - test_set<2, boost::geometry::point > > + test_set<2, bg::model::point > > (1.0, 1.0); } diff --git a/test/core/reverse_dispatch.cpp b/test/core/reverse_dispatch.cpp index b4de2f4e7..11b7f7d46 100644 --- a/test/core/reverse_dispatch.cpp +++ b/test/core/reverse_dispatch.cpp @@ -18,7 +18,7 @@ template void test_reversed() { - BOOST_CHECK_EQUAL((boost::geometry::reverse_dispatch::type::value), + BOOST_CHECK_EQUAL((bg::reverse_dispatch::type::value), Expected); } @@ -28,11 +28,11 @@ void test_all() { test_reversed(); - test_reversed, false>(); - test_reversed, P, true>(); - test_reversed, P, true>(); - test_reversed, boost::geometry::linear_ring

, false>(); - test_reversed, boost::geometry::linestring

, true>(); + test_reversed, false>(); + test_reversed, P, true>(); + test_reversed, P, true>(); + test_reversed, bg::model::linear_ring

, false>(); + test_reversed, bg::model::linestring

, true>(); } template @@ -44,16 +44,16 @@ void test_mixed() int test_main(int, char* []) { - test_all >(); + test_all >(); test_mixed < - boost::geometry::point, - boost::geometry::point > + bg::model::point, + bg::model::point > >(); test_mixed < - boost::geometry::point >, - boost::geometry::point > + bg::model::point >, + bg::model::point > >(); return 0; } diff --git a/test/core/ring.cpp b/test/core/ring.cpp index 3a8bd1754..f246597aa 100644 --- a/test/core/ring.cpp +++ b/test/core/ring.cpp @@ -28,24 +28,24 @@ template void test_ring(std::string const& wkt, - std::size_t expected_main_count, + int expected_main_count, int expected_interior_ring_count, - std::size_t expected_first_interior_count) + int expected_first_interior_count) { - typedef boost::geometry::polygon

the_polygon; - typedef typename boost::geometry::ring_type::type the_ring; - typedef typename boost::geometry::interior_type::type the_interior; + typedef bg::model::polygon

the_polygon; + typedef typename bg::ring_type::type the_ring; + typedef typename bg::interior_type::type the_interior; the_polygon poly; - read_wkt(wkt, poly); + bg::read_wkt(wkt, poly); - the_ring ext = boost::geometry::exterior_ring(poly); - the_interior rings = boost::geometry::interior_rings(poly); + the_ring ext = bg::exterior_ring(poly); + the_interior rings = bg::interior_rings(poly); - BOOST_CHECK_EQUAL(boost::geometry::num_interior_rings(poly), expected_interior_ring_count); + BOOST_CHECK_EQUAL(bg::num_interior_rings(poly), std::size_t(expected_interior_ring_count)); BOOST_CHECK_EQUAL(boost::size(rings), expected_interior_ring_count); BOOST_CHECK_EQUAL(boost::size(ext), expected_main_count); - if (boost::size(rings) > 0) + if (boost::size(rings)) { BOOST_CHECK_EQUAL(boost::size(rings.front()), expected_first_interior_count); } @@ -63,6 +63,6 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/core/tag.cpp b/test/core/tag.cpp index ff4cfdc68..7ecc24dd6 100644 --- a/test/core/tag.cpp +++ b/test/core/tag.cpp @@ -25,44 +25,44 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(typeid(typename boost::geometry::tag::type).name(), + BOOST_CHECK_EQUAL(typeid(typename bg::tag::type).name(), typeid(Expected).name()); } template void test_all() { - test_geometry(); - test_geometry(); - test_geometry , boost::geometry::linestring_tag>(); - test_geometry , boost::geometry::ring_tag>(); - test_geometry , boost::geometry::polygon_tag>(); - test_geometry , boost::geometry::box_tag>(); - test_geometry , boost::geometry::segment_tag>(); - test_geometry , boost::geometry::segment_tag>(); + test_geometry(); + test_geometry

(); + test_geometry , bg::linestring_tag>(); + test_geometry , bg::ring_tag>(); + test_geometry , bg::polygon_tag>(); + test_geometry , bg::box_tag>(); + test_geometry , bg::segment_tag>(); + test_geometry , bg::segment_tag>(); - test_geometry, boost::geometry::linestring_tag>(); - test_geometry, boost::geometry::linestring_tag>(); + test_geometry, bg::linestring_tag>(); + test_geometry, bg::linestring_tag>(); - test_geometry, boost::geometry::linestring_tag>(); + test_geometry, bg::linestring_tag>(); } int test_main(int, char* []) { - test_geometry(); - test_geometry(); - test_geometry(); + test_geometry(); + test_geometry(); + test_geometry(); - test_geometry(); - test_geometry(); - test_geometry(); + test_geometry(); + test_geometry(); + test_geometry(); - test_geometry, boost::geometry::point_tag>(); - test_geometry, boost::geometry::point_tag>(); + test_geometry, bg::point_tag>(); + test_geometry, bg::point_tag>(); - test_all, 2 >(); - test_all, 2 >(); - test_all, 2 >(); + test_all, 2 >(); + test_all, 2 >(); + test_all, 2 >(); return 0; } diff --git a/test/core/topological_dimension.cpp b/test/core/topological_dimension.cpp index 1247f3f8b..9414de6e4 100644 --- a/test/core/topological_dimension.cpp +++ b/test/core/topological_dimension.cpp @@ -25,20 +25,20 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(boost::geometry::topological_dimension::type::value, Expected); + BOOST_CHECK_EQUAL(bg::topological_dimension::type::value, Expected); } template void test_all() { test_geometry(); - test_geometry(); - test_geometry , 1>(); - test_geometry , 2>(); // being discussed - test_geometry , 2>(); - test_geometry , 2>(); - test_geometry , 1>(); - test_geometry , 1>(); + test_geometry

(); + test_geometry , 1>(); + test_geometry , 2>(); // being discussed + test_geometry , 2>(); + test_geometry , 2>(); + test_geometry , 1>(); + test_geometry , 1>(); test_geometry, 1>(); test_geometry, 1>(); @@ -59,9 +59,9 @@ int test_main(int, char* []) test_geometry, 0>(); test_geometry, 0>(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/algorithms/buffer/linestring_buffer.cpp b/test/extensions/algorithms/buffer/linestring_buffer.cpp index be4d210cc..2bf4b7160 100644 --- a/test/extensions/algorithms/buffer/linestring_buffer.cpp +++ b/test/extensions/algorithms/buffer/linestring_buffer.cpp @@ -40,10 +40,9 @@ static std::string const reallife1 = "LINESTRING(76396.40464822574 410095.679514 template void test_all() { - namespace bg = boost::geometry; - namespace buf = boost::geometry::strategy::buffer; - typedef bg::linestring

linestring; - typedef bg::polygon

polygon; + namespace buf = bg::strategy::buffer; + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; double factor = +1.0; // does NOT yet work for negative buffer double right = factor * 1.0; @@ -82,9 +81,8 @@ void test_all() int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all >(); - //test_all >(); + test_all >(); + //test_all >(); return 0; diff --git a/test/extensions/algorithms/buffer/polygon_buffer.cpp b/test/extensions/algorithms/buffer/polygon_buffer.cpp index 5225c4db8..bc4bb8619 100644 --- a/test/extensions/algorithms/buffer/polygon_buffer.cpp +++ b/test/extensions/algorithms/buffer/polygon_buffer.cpp @@ -36,22 +36,21 @@ static std::string const flower = "POLYGON ((1 0,1 10,9 10,9 0,4.99 0,4.99 5.5,4.5 6,5 6.5,5.5 6,5.01 5.5,5.01 0.01,5.25 0.01,5.25 5,6 3,8 5,6 6,8 7,6 9,5 7,4 9,2 7,4 6,2 5,4 3,4.75 5,4.75 0,1 0))"; static std::string const saw - = "POLYGON((1 3,1 8,1.5 6,5 8,5.5 6,9 8,9.5 6,13 8,13 3,1 3))"; + = "POLYGON((1 3,1 8,1.5 6,5 8,5.5 6,9 8,9.5 6,13 8,13 3,1 3))"; static std::string const bowl - = "POLYGON((1 2,1 7,2 7,3 5,5 4,7 5,8 7,9 7,9 2,1 2))"; + = "POLYGON((1 2,1 7,2 7,3 5,5 4,7 5,8 7,9 7,9 2,1 2))"; static std::string const county1 - = "POLYGON((-111.700 41.200 ,-111.681388 41.181739 ,-111.682453 41.181506 ,-111.684052 41.180804 ,-111.685295 41.180538 ,-111.686318 41.180776 ,-111.687517 41.181416 ,-111.688982 41.181520 ,-111.690670 41.181523 ,-111.692135 41.181460 ,-111.693646 41.182034 ,-111.695156 41.182204 ,-111.696489 41.182274 ,-111.697775 41.182075 ,-111.698974 41.181539 ,-111.700485 41.182348 ,-111.701374 41.182955 ,-111.700 41.200))"; + = "POLYGON((-111.700 41.200 ,-111.681388 41.181739 ,-111.682453 41.181506 ,-111.684052 41.180804 ,-111.685295 41.180538 ,-111.686318 41.180776 ,-111.687517 41.181416 ,-111.688982 41.181520 ,-111.690670 41.181523 ,-111.692135 41.181460 ,-111.693646 41.182034 ,-111.695156 41.182204 ,-111.696489 41.182274 ,-111.697775 41.182075 ,-111.698974 41.181539 ,-111.700485 41.182348 ,-111.701374 41.182955 ,-111.700 41.200))"; template void test_all() { - namespace bg = boost::geometry; - namespace buf = boost::geometry::strategy::buffer; + namespace buf = bg::strategy::buffer; - typedef bg::polygon

polygon_type; + typedef bg::model::polygon

polygon_type; goto debug; @@ -228,9 +227,8 @@ debug: int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all >(); - //test_all >(); + test_all >(); + //test_all >(); return 0; } diff --git a/test/extensions/algorithms/buffer/test_buffer.hpp b/test/extensions/algorithms/buffer/test_buffer.hpp index 34531b386..6a7e471e2 100644 --- a/test/extensions/algorithms/buffer/test_buffer.hpp +++ b/test/extensions/algorithms/buffer/test_buffer.hpp @@ -86,7 +86,6 @@ void test_buffer(std::string const& caseid, Geometry const& geometry, double expected_area, double distance_left, double distance_right) { - namespace bg = boost::geometry; typedef typename bg::coordinate_type::type coordinate_type; typedef typename bg::point_type::type point_type; @@ -110,64 +109,64 @@ void test_buffer(std::string const& caseid, Geometry const& geometry, > inserter_type; - /*** - typedef bg::box box_type; + /*** + typedef bg::model::box box_type; typedef bg::sections sections_type; sections_type sections; bg::sectionalize(geometry, sections); - std::vector sections_buffered; + std::vector sections_buffered; - // Buffer all sections separately + // Buffer all sections separately BOOST_FOREACH(typename sections_type::value_type const& section, sections) { if (! section.duplicate) { - typedef typename boost::range_iterator - < - typename bg::range_type::type const - >::type iterator_type; + typedef typename boost::range_iterator + < + typename bg::range_type::type const + >::type iterator_type; - inserter_type inserter(sections_buffered); + inserter_type inserter(sections_buffered); - iterator_type begin, end; - typedef std::pair section_range; - bg::get_section(geometry, section, begin, end); - bg::detail::buffer::linestring_buffer - < - section_range, ring_type, distance, join_strategy - >::apply(std::make_pair(begin, end), inserter, - distance(distance_left, distance_left / 2.0), // two times left - join_strategy()); + iterator_type begin, end; + typedef std::pair section_range; + bg::get_section(geometry, section, begin, end); + bg::detail::buffer::linestring_buffer + < + section_range, ring_type, distance, join_strategy + >::apply(std::make_pair(begin, end), inserter, + distance(distance_left, distance_left / 2.0), // two times left + join_strategy()); } } std::vector sections_buffered_unioned; BOOST_FOREACH(GeometryOut const& p, sections_buffered) { - if (sections_buffered_unioned.empty()) - { - bg::union_inserter(geometry, p, std::back_inserter(sections_buffered_unioned)); - } - else if (boost::size(sections_buffered_unioned) == 1) - { - std::vector step; - bg::union_inserter(sections_buffered_unioned.front(), p, std::back_inserter(step)); - step.swap(sections_buffered_unioned); - } - else - { - std::cout << "nyi" << std::endl; - BOOST_FOREACH(GeometryOut const& sbu, sections_buffered_unioned) - { - bg::union_inserter(p, sbu, sections_buffered_unioned); - } - } + if (sections_buffered_unioned.empty()) + { + bg::union_inserter(geometry, p, std::back_inserter(sections_buffered_unioned)); + } + else if (boost::size(sections_buffered_unioned) == 1) + { + std::vector step; + bg::union_inserter(sections_buffered_unioned.front(), p, std::back_inserter(step)); + step.swap(sections_buffered_unioned); + } + else + { + std::cout << "nyi" << std::endl; + BOOST_FOREACH(GeometryOut const& sbu, sections_buffered_unioned) + { + bg::union_inserter(p, sbu, sections_buffered_unioned); + } + } } - ***/ + ***/ std::vector buffered; @@ -213,7 +212,7 @@ void test_buffer(std::string const& caseid, Geometry const& geometry, //inserter_type inserter(buffered); // Display including a margin - bg::box extent; + bg::model::box extent; bg::envelope(geometry, extent); bg::buffer(extent, extent, distance_left * 1.01); mapper.add(extent); @@ -224,8 +223,8 @@ void test_buffer(std::string const& caseid, Geometry const& geometry, #if defined(BOOST_GEOMETRY_TEST_BUFFER_POLYGON) /* - bg::detail::buffer::unioning_buffer(geometry, sections_buffered_unioned, - distance(distance_left, distance_left / 2.0) + bg::detail::buffer::unioning_buffer(geometry, sections_buffered_unioned, + distance(distance_left, distance_left / 2.0) #ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER , join_strategy(mapper), mapper #else @@ -252,8 +251,8 @@ void test_buffer(std::string const& caseid, Geometry const& geometry, #else - bg::detail::buffer::segmenting_buffer(geometry, sections_buffered_unioned, - distance(distance_left, distance_right) + bg::detail::buffer::segmenting_buffer(geometry, sections_buffered_unioned, + distance(distance_left, distance_right) #ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER , join_strategy(mapper), mapper #else @@ -330,16 +329,16 @@ std::cout << bg::wkt(ring) } #endif - /*** + /*** coordinate_type a = coordinate_type(); BOOST_FOREACH(GeometryOut const& polygon, buffered) { a += bg::area(polygon); } - BOOST_CHECK_CLOSE(a, expected_area, join == 'r' + BOOST_CHECK_CLOSE(a, expected_area, join == 'r' ? coordinate_type(0.1) : coordinate_type(0.001)); - ***/ + ***/ } #ifdef BOOST_GEOMETRY_CHECK_WITH_POSTGIS @@ -363,7 +362,6 @@ void test_one(std::string const& caseid, std::string const& wkt, char join, double expected_area, double distance_left, double distance_right = -999) { - namespace bg = boost::geometry; Geometry g; bg::read_wkt(wkt, g); diff --git a/test/extensions/algorithms/connect.cpp b/test/extensions/algorithms/connect.cpp index 1e437ad57..c921320af 100644 --- a/test/extensions/algorithms/connect.cpp +++ b/test/extensions/algorithms/connect.cpp @@ -35,33 +35,32 @@ template -void test_connect(std::string const& caseid, Geometry const& geometry, +void test_connect(std::string const& caseid, Geometry const& geometry, std::size_t expected_count, std::size_t expected_point_count, double expected_length, double limit = -1, double percentage = 0.001) { - namespace bg = boost::geometry; typedef typename bg::coordinate_type::type coordinate_type; - std::vector connected_vector; + std::vector connected_vector; if (limit > 0) { - bg::connect(geometry, connected_vector, limit); + bg::connect(geometry, connected_vector, limit); } else { - bg::connect(geometry, connected_vector); + bg::connect(geometry, connected_vector); } - typename bg::length_result::type length = 0; + typename bg::length_result::type length = 0; std::size_t count = boost::size(connected_vector); - std::size_t point_count = 0; + std::size_t point_count = 0; - BOOST_FOREACH(GeometryOut& connected, connected_vector) - { - bg::unique(connected); - length += bg::length(connected); - point_count += bg::num_points(connected); - } + BOOST_FOREACH(GeometryOut& connected, connected_vector) + { + bg::unique(connected); + length += bg::length(connected); + point_count += bg::num_points(connected); + } BOOST_CHECK_MESSAGE(count == expected_count, "connect: " << caseid @@ -91,18 +90,18 @@ void test_connect(std::string const& caseid, Geometry const& geometry, > mapper(svg, 500, 500); mapper.add(geometry); - bg::box::type> extent; + bg::model::box::type> extent; bg::envelope(geometry, extent); bg::buffer(extent, extent, 0.1); mapper.add(extent); mapper.map(geometry, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1"); - BOOST_FOREACH(GeometryOut& connected, connected_vector) - { - mapper.map(connected, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); - } - } + BOOST_FOREACH(GeometryOut& connected, connected_vector) + { + mapper.map(connected, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); + } + } #endif } @@ -113,7 +112,7 @@ void test_one(std::string const& caseid, std::string const& wkt, double expected_length, double limit = -1, double percentage = 0.001) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_connect(caseid, geometry, expected_count, expected_point_count, @@ -142,7 +141,7 @@ void test_one(std::string const& caseid, std::string const& wkt, out << "_" << index; geometry2.push_back(geometry[index]); } - test_connect(out.str(), geometry2, + test_connect(out.str(), geometry2, expected_point_count, expected_length, percentage); } while (std::next_permutation(indices.begin(), indices.end())); #endif @@ -155,18 +154,17 @@ void test_one(std::string const& caseid, std::string const& wkt, template void test_all() { - namespace bg = boost::geometry; - typedef bg::linestring

linestring; - typedef bg::multi_linestring multi_linestring; + typedef bg::model::linestring

linestring; + typedef bg::model::multi_linestring multi_linestring; goto disconnected; test_one("ls_simplex", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", 1, 3, 2 * std::sqrt(2.0)); - + // Opposites, forming one line test_one("ls_simplex_opposite_to", "MULTILINESTRING((0 0,1 1),(2 2,1 1))", @@ -205,7 +203,7 @@ disconnected: int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/algorithms/midpoints.cpp b/test/extensions/algorithms/midpoints.cpp index 2a88b86a3..b22c17eb5 100644 --- a/test/extensions/algorithms/midpoints.cpp +++ b/test/extensions/algorithms/midpoints.cpp @@ -29,15 +29,15 @@ template void test_midpoints(G const& g, bool start_and_end) { G processed; - boost::geometry::midpoints(g, start_and_end, std::back_inserter(processed)); - std::cout << dsv(processed) << std::endl; + bg::midpoints(g, start_and_end, std::back_inserter(processed)); + std::cout << bg::dsv(processed) << std::endl; } template void test_midpoints(std::string const& wkt) { G g; - boost::geometry::read_wkt(wkt, g); + bg::read_wkt(wkt, g); test_midpoints(g, true); test_midpoints(g, false); } @@ -45,13 +45,13 @@ void test_midpoints(std::string const& wkt) template void test_all() { - test_midpoints >("LINESTRING(1 1,2 2,3 3)"); + test_midpoints >("LINESTRING(1 1,2 2,3 3)"); } int test_main(int, char* []) { - //test_all >(); - test_all >(); + //test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/algorithms/offset.cpp b/test/extensions/algorithms/offset.cpp index 4621b14f3..a77b3a1cb 100644 --- a/test/extensions/algorithms/offset.cpp +++ b/test/extensions/algorithms/offset.cpp @@ -35,7 +35,6 @@ void test_offset(std::string const& caseid, Geometry const& geometry, double distance, double expected_length, double percentage) { - namespace bg = boost::geometry; typedef typename bg::coordinate_type::type coordinate_type; typedef typename bg::point_type::type point_type; @@ -45,12 +44,12 @@ void test_offset(std::string const& caseid, Geometry const& geometry, point_type > join_strategy; - GeometryOut moved_by_offset; - bg::offset(geometry, moved_by_offset, join_strategy(2), distance); + GeometryOut moved_by_offset; + bg::offset(geometry, moved_by_offset, join_strategy(2), distance); - typename bg::length_result::type length + typename bg::length_result::type length = bg::length(moved_by_offset); - std::size_t count = bg::num_points(moved_by_offset); + std::size_t count = bg::num_points(moved_by_offset); /* BOOST_CHECK_MESSAGE(count == expected_point_count, @@ -85,7 +84,7 @@ void test_offset(std::string const& caseid, Geometry const& geometry, mapper.map(geometry, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1"); mapper.map(moved_by_offset, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); - } + } #endif } @@ -95,7 +94,7 @@ void test_one(std::string const& caseid, std::string const& wkt, double distance double expected_length, double percentage = 0.001) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_offset(caseid + "_a", geometry, distance, expected_length, percentage); test_offset(caseid + "_b", geometry, -distance, expected_length, percentage); @@ -107,9 +106,8 @@ void test_one(std::string const& caseid, std::string const& wkt, double distance template void test_all() { - namespace bg = boost::geometry; - typedef bg::linestring

linestring; + typedef bg::model::linestring

linestring; static std::string const simplex = "LINESTRING(0 0,1 1)"; static std::string const one_bend = "LINESTRING(0 0,4 5,7 4)"; @@ -129,7 +127,7 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/algorithms/remove_holes_if.cpp b/test/extensions/algorithms/remove_holes_if.cpp index 9b00c9fab..3d5dec835 100644 --- a/test/extensions/algorithms/remove_holes_if.cpp +++ b/test/extensions/algorithms/remove_holes_if.cpp @@ -29,41 +29,41 @@ void test_remove_holes_if(std::string const& wkt, Predicate const& predicate, int expected_points) { G g; - boost::geometry::read_wkt(wkt, g); - boost::geometry::remove_holes_if(g, predicate); - BOOST_CHECK_EQUAL(boost::geometry::num_points(g), expected_points); + bg::read_wkt(wkt, g); + bg::remove_holes_if(g, predicate); + BOOST_CHECK_EQUAL(bg::num_points(g), expected_points); } template void test_all() { - boost::geometry::elongated_hole > elongated(0.05); + bg::elongated_hole > elongated(0.05); // No holes - test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0))", elongated, 5); + test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0))", elongated, 5); // Square hole (ratio 1/4), kept - test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2,2 2,2 1,1 1))", elongated, 10); + test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2,2 2,2 1,1 1))", elongated, 10); // Elongated hole - test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2,1.02 2,1.02 1,1 1))", elongated, 5); + test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2,1.02 2,1.02 1,1 1))", elongated, 5); // Invalid hole - removed by "elongated" predicate as well - test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2))", elongated, 5); + test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2))", elongated, 5); // Invalid hole - boost::geometry::invalid_hole > invalid; - test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2))", invalid, 5); + bg::invalid_hole > invalid; + test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2))", invalid, 5); // Valid hole - test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2,1.02 2,1.02 1,1 1))", invalid, 10); + test_remove_holes_if >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2,1.02 2,1.02 1,1 1))", invalid, 10); } int test_main(int, char* []) { - //test_all >(); - test_all >(); + //test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/algorithms/remove_spikes.cpp b/test/extensions/algorithms/remove_spikes.cpp index 2bf2a5126..e95a15026 100644 --- a/test/extensions/algorithms/remove_spikes.cpp +++ b/test/extensions/algorithms/remove_spikes.cpp @@ -28,19 +28,17 @@ #endif template -inline void test_remove_spikes(std::string const& id, - Geometry const& geometry, +inline void test_remove_spikes(std::string const& id, + Geometry const& geometry, int expected_count) { - namespace bg = boost::geometry; - typedef typename bg::point_type::type point_type; Geometry processed = geometry; //bg::remove_spikes(processed, bg::remove_elongated_spikes()); bg::remove_spikes(processed, bg::remove_by_normalized()); bg::unique(processed); - + int detected = bg::num_points(processed); @@ -68,7 +66,7 @@ template void test_geometry(std::string const& id, std::string const& wkt, int expected_count) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); test_remove_spikes(id, geometry, expected_count); } @@ -78,26 +76,26 @@ void test_geometry(std::string const& id, std::string const& wkt, int expected_c template void test_all() { - typedef boost::geometry::linear_ring

ring; - typedef boost::geometry::polygon

polygon; + typedef bg::model::linear_ring

ring; + typedef bg::model::polygon

polygon; - test_geometry("box", + test_geometry("box", "POLYGON((0 0,0 4,4 4,4 0,0 0))", 5); - test_geometry("spike_right", + test_geometry("spike_right", "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))", 6); - test_geometry("spike_at_first", + test_geometry("spike_at_first", "POLYGON((0 0,-1 3,0 0,0 4,4 4,4 0,0 0))", 5); - test_geometry("spike_at_closing", + test_geometry("spike_at_closing", "POLYGON((-1 0,0 0,0 4,4 4,4 0,0 0,-1 0))", 5); - test_geometry("double_spike", + test_geometry("double_spike", "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4 2,4 0,0 0))", 6); - test_geometry("three_double_spike", + test_geometry("three_double_spike", "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4.5 2,4 2,4 0,0 0))", 6); } int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } #endif diff --git a/test/extensions/algorithms/selected.cpp b/test/extensions/algorithms/selected.cpp index 4bb1e95ac..9411d599d 100644 --- a/test/extensions/algorithms/selected.cpp +++ b/test/extensions/algorithms/selected.cpp @@ -25,7 +25,7 @@ template void test_selected(G const& g, P const& point, bool result, double dist) { - bool sel = boost::geometry::selected(g, point, dist); + bool sel = bg::selected(g, point, dist); BOOST_CHECK_EQUAL(sel, result); } @@ -33,7 +33,7 @@ template void test_selected(std::string const& wkt, P const& point, bool result, double dist) { G g; - boost::geometry::read_wkt(wkt, g); + bg::read_wkt(wkt, g); test_selected(g, point, result, dist); } @@ -46,44 +46,44 @@ void test_all() test_selected

("POINT(1 1)", P(1,1.99999), true, 1); test_selected

("POINT(1 1)", P(1.99999,1.99999), false, 1); - test_selected >("LINESTRING(1 1,2 2)", P(1,1), true, 0.0001); - test_selected >("LINESTRING(1 1,2 2)", P(2,2), true, 0.0001); - test_selected >("LINESTRING(1 1,2 2)", P(2.01,2.01), false, 0.0001); - test_selected >("LINESTRING(1 1,2 2)", P(1,0.9), false, 0.0001); - test_selected >("LINESTRING(1 1,2 2)", P(1.5,1.5), true, 0.0001); - test_selected >("LINESTRING(1 1,2 2)", P(1.5,1.6), false, 0.0001); - test_selected >("LINESTRING(1 1,2 2,3 0,5 0,5 8)", P(5,5.000001), true, 0.0001); + test_selected >("LINESTRING(1 1,2 2)", P(1,1), true, 0.0001); + test_selected >("LINESTRING(1 1,2 2)", P(2,2), true, 0.0001); + test_selected >("LINESTRING(1 1,2 2)", P(2.01,2.01), false, 0.0001); + test_selected >("LINESTRING(1 1,2 2)", P(1,0.9), false, 0.0001); + test_selected >("LINESTRING(1 1,2 2)", P(1.5,1.5), true, 0.0001); + test_selected >("LINESTRING(1 1,2 2)", P(1.5,1.6), false, 0.0001); + test_selected >("LINESTRING(1 1,2 2,3 0,5 0,5 8)", P(5,5.000001), true, 0.0001); // Lines with zero,one points - test_selected >("LINESTRING( )", P(1,1), false, 0.0001); - test_selected >("LINESTRING(1 1)", P(1,1), true, 0.0001); - test_selected >("LINESTRING(1 2)", P(1,1), false, 0.0001); + test_selected >("LINESTRING( )", P(1,1), false, 0.0001); + test_selected >("LINESTRING(1 1)", P(1,1), true, 0.0001); + test_selected >("LINESTRING(1 2)", P(1,1), false, 0.0001); // nyi - //test_selected >(); + //test_selected >(); - test_selected >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(0.001, 0.001), true, 0.0001); - test_selected >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(1, 1), true, 0.0001); - test_selected >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(2, 5), false, 0.0001); + test_selected >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(0.001, 0.001), true, 0.0001); + test_selected >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(1, 1), true, 0.0001); + test_selected >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(2, 5), false, 0.0001); - typedef boost::geometry::box

B; - test_selected(boost::geometry::make(0,0,4,4), P(2,2), true, 0.001); - test_selected(boost::geometry::make(0,0,4,4), P(5,5), false, 0.001); - test_selected(boost::geometry::make(0,0,4,4), P(0,0), false, 0.001); - test_selected(boost::geometry::make(0,0,4,4), P(4,4), false, 0.001); + typedef bg::model::box

B; + test_selected(bg::make(0,0,4,4), P(2,2), true, 0.001); + test_selected(bg::make(0,0,4,4), P(5,5), false, 0.001); + test_selected(bg::make(0,0,4,4), P(0,0), false, 0.001); + test_selected(bg::make(0,0,4,4), P(4,4), false, 0.001); // nyi - //test_selected >(); - //test_selected >(); + //test_selected >(); + //test_selected >(); } int test_main(int, char* []) { // Integer not applicable here, just because of the tests using floating point - // test_all >(); + // test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/gis/io/wkb/read_wkb.cpp b/test/extensions/gis/io/wkb/read_wkb.cpp index 2b2c3cdf0..6c47b819d 100644 --- a/test/extensions/gis/io/wkb/read_wkb.cpp +++ b/test/extensions/gis/io/wkb/read_wkb.cpp @@ -20,6 +20,8 @@ #include #include +namespace bg = boost::geometry; + namespace { // anonymous typedef std::vector byte_vector; @@ -28,40 +30,40 @@ template void test_geometry_wrong_wkb(std::string const& wkbhex, std::string const& wkt) { byte_vector wkb; - BOOST_CHECK( boost::geometry::hex2wkb(wkbhex, std::back_inserter(wkb)) ); + BOOST_CHECK( bg::hex2wkb(wkbhex, std::back_inserter(wkb)) ); Geometry g_wkb; - std::cout << boost::geometry::read_wkb(wkb.begin(), wkb.end(), g_wkb) << std::endl; + std::cout << bg::read_wkb(wkb.begin(), wkb.end(), g_wkb) << std::endl; } template void test_geometry_equals(std::string const& wkbhex, std::string const& wkt) { byte_vector wkb; - BOOST_CHECK( boost::geometry::hex2wkb(wkbhex, std::back_inserter(wkb)) ); + BOOST_CHECK( bg::hex2wkb(wkbhex, std::back_inserter(wkb)) ); Geometry g_wkb; - BOOST_CHECK( boost::geometry::read_wkb(wkb.begin(), wkb.end(), g_wkb) ); + BOOST_CHECK( bg::read_wkb(wkb.begin(), wkb.end(), g_wkb) ); Geometry g_expected; - boost::geometry::read_wkt(wkt, g_expected); - BOOST_CHECK( boost::geometry::equals(g_wkb, g_expected) == IsEqual ); + bg::read_wkt(wkt, g_expected); + BOOST_CHECK( bg::equals(g_wkb, g_expected) == IsEqual ); } //template //void test_polygon_wkt(std::string const& wkt) //{ -// typedef boost::geometry::linestring

linestring_type; -// typedef boost::geometry::polygon polygon_type; +// typedef bg::model::linestring

linestring_type; +// typedef bg::model::polygon polygon_type; // // polygon_type poly; -// boost::geometry::read_wkb(wkb, poly); +// bg::read_wkb(wkb, poly); //} } // namespace anonymous int test_main(int, char* []) { - typedef boost::geometry::point point_type; - typedef boost::geometry::linestring linestring_type; + typedef bg::model::point point_type; + typedef bg::model::linestring linestring_type; // // POINT diff --git a/test/extensions/gis/io/wkt/multi_wkt.cpp b/test/extensions/gis/io/wkt/multi_wkt.cpp index 25c39fa20..ecd84f947 100644 --- a/test/extensions/gis/io/wkt/multi_wkt.cpp +++ b/test/extensions/gis/io/wkt/multi_wkt.cpp @@ -47,13 +47,13 @@ template void test_all() { using namespace boost::geometry; - typedef point P; + typedef bg::model::point P; - test_wkt >("multipoint((1 2),(3 4))", 2); - test_wkt > >("multilinestring((1 1,2 2,3 3),(4 4,5 5,6 6))", 6, 4 * sqrt(2.0)); - test_wkt > >("multipolygon(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))", 15, 0, 21, 28); + test_wkt >("multipoint((1 2),(3 4))", 2); + test_wkt > >("multilinestring((1 1,2 2,3 3),(4 4,5 5,6 6))", 6, 4 * sqrt(2.0)); + test_wkt > >("multipolygon(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))", 15, 0, 21, 28); - test_wrong_wkt > >( + test_wrong_wkt > >( "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),(0 0,0 4,4 4,4 0,0 0)))", "expected '('"); } diff --git a/test/extensions/gis/io/wkt/wkt.cpp b/test/extensions/gis/io/wkt/wkt.cpp index b654f7622..2d48febeb 100644 --- a/test/extensions/gis/io/wkt/wkt.cpp +++ b/test/extensions/gis/io/wkt/wkt.cpp @@ -28,48 +28,38 @@ #include -#if defined(HAVE_GMP) -# include -#endif -#if defined(HAVE_CLN) -# include -#endif - - - - template void test_wkt(std::string const& wkt, int n, double len = 0, double ar = 0, double peri = 0) { G geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); /* - std::cout << "n=" << boost::geometry::num_points(geometry) - << " dim=" << boost::geometry::topological_dimension::value - << " length=" << boost::geometry::length(geometry) - << " area=" << boost::geometry::area(geometry) - << " perimeter=" << boost::geometry::perimeter(geometry) + std::cout << "n=" << bg::num_points(geometry) + << " dim=" << bg::topological_dimension::value + << " length=" << bg::length(geometry) + << " area=" << bg::area(geometry) + << " perimeter=" << bg::perimeter(geometry) << std::endl << "\t\tgeometry=" << dsv(geometry) << std::endl; */ - BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), n); - BOOST_CHECK_CLOSE(double(boost::geometry::length(geometry)), len, 0.0001); - BOOST_CHECK_CLOSE(double(boost::geometry::area(geometry)), ar, 0.0001); - BOOST_CHECK_CLOSE(double(boost::geometry::perimeter(geometry)), peri, 0.0001); + BOOST_CHECK_EQUAL(bg::num_points(geometry), n); + BOOST_CHECK_CLOSE(double(bg::length(geometry)), len, 0.0001); + BOOST_CHECK_CLOSE(double(bg::area(geometry)), ar, 0.0001); + BOOST_CHECK_CLOSE(double(bg::perimeter(geometry)), peri, 0.0001); // String comparison: only for int/double/float etc // GMP/CLN add +e01, L0, etc if (boost::is_fundamental < - typename boost::geometry::coordinate_type::type + typename bg::coordinate_type::type >::type::value) { std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), boost::to_upper_copy(wkt)); } @@ -80,14 +70,14 @@ void test_relaxed_wkt(std::string const& wkt, std::string const& expected) { if (boost::is_fundamental < - typename boost::geometry::coordinate_type::type + typename bg::coordinate_type::type >::type::value) { std::string e; G geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), boost::to_upper_copy(expected)); } @@ -102,9 +92,9 @@ void test_wrong_wkt(std::string const& wkt, std::string const& start) G geometry; try { - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); } - catch(boost::geometry::read_wkt_exception const& ex) + catch(bg::read_wkt_exception const& ex) { e = ex.what(); boost::to_lower(e); @@ -119,37 +109,37 @@ template void test_all() { using namespace boost::geometry; - typedef point P; + typedef bg::model::point P; test_wkt

("POINT(1 2)", 1); - test_wkt >("LINESTRING(1 1,2 2,3 3)", 3, 2 * sqrt(2.0)); - test_wkt >("POLYGON((0 0,0 4,4 4,4 0,0 0)" + test_wkt >("LINESTRING(1 1,2 2,3 3)", 3, 2 * sqrt(2.0)); + test_wkt >("POLYGON((0 0,0 4,4 4,4 0,0 0)" ",(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))", 15, 0, 18, 24); // Non OGC: a box defined by a polygon //test_wkt >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 4, 0, 1, 4); - test_wkt >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 5, 0, 1, 4); + test_wkt >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 5, 0, 1, 4); // We accept empty sequences as well (much better than EMPTY)... // ...or even POINT() (see below) - test_wkt >("LINESTRING()", 0, 0); - test_wkt >("POLYGON(())", 0); + test_wkt >("LINESTRING()", 0, 0); + test_wkt >("POLYGON(())", 0); // ... or even with empty holes - test_wkt >("POLYGON((),(),())", 0); + test_wkt >("POLYGON((),(),())", 0); // which all make no valid geometries, but they can exist. // These WKT's are incomplete or abnormal but they are considered OK test_relaxed_wkt

("POINT(1)", "POINT(1 0)"); test_relaxed_wkt

("POINT()", "POINT(0 0)"); - test_relaxed_wkt >("LINESTRING(1,2,3)", + test_relaxed_wkt >("LINESTRING(1,2,3)", "LINESTRING(1 0,2 0,3 0)"); test_relaxed_wkt

("POINT ( 1 2) ", "POINT(1 2)"); test_relaxed_wkt

("POINT M ( 1 2)", "POINT(1 2)"); - test_relaxed_wkt >("BOX(1 1,2 2)", "POLYGON((1 1,1 2,2 2,2 1,1 1))"); + test_relaxed_wkt >("BOX(1 1,2 2)", "POLYGON((1 1,1 2,2 2,2 1,1 1))"); - test_relaxed_wkt >("LINESTRING EMPTY", "LINESTRING()"); + test_relaxed_wkt >("LINESTRING EMPTY", "LINESTRING()"); - test_relaxed_wkt >("POLYGON( ( ) , ( ) , ( ) )", + test_relaxed_wkt >("POLYGON( ( ) , ( ) , ( ) )", "POLYGON((),(),())"); // Wrong WKT's @@ -164,18 +154,18 @@ void test_all() test_wrong_wkt

("PIONT (1 2)", "should start with 'point'"); - test_wrong_wkt >("LINESTRING())", "too much tokens"); + test_wrong_wkt >("LINESTRING())", "too much tokens"); - test_wrong_wkt >("POLYGON((1 1,1 4,4 4,4 1,1 1)" + test_wrong_wkt >("POLYGON((1 1,1 4,4 4,4 1,1 1)" ",((2 2,2 3,3 3,3 2,2 2))", "bad lexical cast"); - test_wrong_wkt >("BOX(1 1,2 2,3 3)", "box should have 2"); - test_wrong_wkt >("BOX(1 1,2 2) )", "too much tokens"); + test_wrong_wkt >("BOX(1 1,2 2,3 3)", "box should have 2"); + test_wrong_wkt >("BOX(1 1,2 2) )", "too much tokens"); if (boost::is_floating_point::type::value || ! boost::is_fundamental::type::value) { - test_wkt

("POINT(1.1 2.1)", 1); + test_wkt

("POINT(1.1 2.1)", 1); } } @@ -187,13 +177,8 @@ int test_main(int, char* []) test_all(); test_all(); -#if defined(HAVE_CLN) - std::cout << "testing CLN points" << std::endl; - test_all(); -#endif -#if defined(HAVE_GMP) - std::cout << "testing GMP points" << std::endl; - test_all(); +#if defined(HAVE_TTMATH) + test_all(); #endif return 0; diff --git a/test/extensions/gis/latlong/andoyer.cpp b/test/extensions/gis/latlong/andoyer.cpp index 4c0398dd2..0923ca42f 100644 --- a/test/extensions/gis/latlong/andoyer.cpp +++ b/test/extensions/gis/latlong/andoyer.cpp @@ -22,7 +22,6 @@ # include #endif -namespace bg = boost::geometry; template @@ -62,13 +61,13 @@ int test_main(int, char* []) { //test_all(); //test_all(); - test_all > >(); - test_all > >(); - test_all > >(); + test_all > >(); + test_all > >(); + test_all > >(); #if defined(HAVE_TTMATH) - test_all, 2, bg::cs::geographic > >(); - test_all > >(); + test_all, 2, bg::cs::geographic > >(); + test_all > >(); #endif return 0; diff --git a/test/extensions/gis/latlong/area_ll.cpp b/test/extensions/gis/latlong/area_ll.cpp index ccb1f2e69..312e85141 100644 --- a/test/extensions/gis/latlong/area_ll.cpp +++ b/test/extensions/gis/latlong/area_ll.cpp @@ -28,12 +28,11 @@ #include -using namespace boost::geometry; template void add_to_ring(PRJ const& prj, LL const& ll, - boost::geometry::linear_ring& ring_ll, - boost::geometry::linear_ring& ring_xy) + bg::model::linear_ring& ring_ll, + bg::model::linear_ring& ring_xy) { ring_ll.push_back(ll); @@ -47,35 +46,35 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) { BOOST_ASSERT(! (concave && hole) ); - typedef typename coordinate_type::type T; + typedef typename bg::coordinate_type::type T; // Amsterdam, Rotterdam, The Hague, Utrecht, // these cities together are the city group "Randstad" LL a, r, h, u; // Amsterdam 52 22'23"N 4 53'32"E - a.lat(dms(52, 22, 23)); - a.lon(dms(4, 53, 32)); + a.lat(bg::dms(52, 22, 23)); + a.lon(bg::dms(4, 53, 32)); // Rotterdam 51 55'51"N 4 28'45"E - r.lat(dms(51, 55, 51)); - r.lon(dms(4, 28, 45)); + r.lat(bg::dms(51, 55, 51)); + r.lon(bg::dms(4, 28, 45)); // The hague: 52 4' 48" N, 4 18' 0" E - h.lat(dms(52, 4, 48)); - h.lon(dms(4, 18, 0)); + h.lat(bg::dms(52, 4, 48)); + h.lon(bg::dms(4, 18, 0)); // Utrecht - u.lat(dms(52, 5, 36)); - u.lon(dms(5, 7, 10)); + u.lat(bg::dms(52, 5, 36)); + u.lon(bg::dms(5, 7, 10)); // For checking calculated area, use the Dutch projection (RD), this is EPSG code 28992 - projection::sterea_ellipsoid dutch_prj(projection::init(28992)); + bg::projection::sterea_ellipsoid dutch_prj(bg::projection::init(28992)); // Add them in clockwise direction - polygon randstad; - polygon randstad_xy; + bg::model::polygon randstad; + bg::model::polygon randstad_xy; add_to_ring(dutch_prj, a, randstad.outer(), randstad_xy.outer()); add_to_ring(dutch_prj, u, randstad.outer(), randstad_xy.outer()); @@ -84,7 +83,9 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) { // Add the city "Alphen" to create a concave case // Alphen 52 7' 48" N, 4 39' 0" E - LL alphen(latitude(dms(52, 7, 48)), longitude(dms(4, 39))); + LL alphen( + bg::latitude(bg::dms(52, 7, 48)), + bg::longitude(bg::dms(4, 39))); add_to_ring(dutch_prj, alphen, randstad.outer(), randstad_xy.outer()); } @@ -96,19 +97,27 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) if (hole) { // Gouda 52 1' 12" N, 4 42' 0" E - LL gouda(latitude(dms(52, 1, 12)), longitude(dms(4, 42))); + LL gouda( + bg::latitude(bg::dms(52, 1, 12)), + bg::longitude(bg::dms(4, 42))); // Woerden 52 5' 9" N, 4 53' 0" E - LL woerden(latitude(dms(52, 5, 9)), longitude(dms(4, 53, 0))); + LL woerden( + bg::latitude(bg::dms(52, 5, 9)), + bg::longitude(bg::dms(4, 53, 0))); // Uithoorn 52 13' 48" N, 4 49' 48" E - LL uithoorn(latitude(dms(52, 13, 48)), longitude(dms(4, 49, 48))); + LL uithoorn(bg::latitude + (bg::dms(52, 13, 48)), + bg::longitude(bg::dms(4, 49, 48))); // Alphen 52 7' 48" N, 4 39' 0" E - LL alphen(latitude(dms(52, 7, 48)), longitude(dms(4, 39))); + LL alphen(bg::latitude( + bg::dms(52, 7, 48)), + bg::longitude(bg::dms(4, 39))); randstad.inners().resize(1); randstad_xy.inners().resize(1); - typename polygon::ring_type& ring = randstad.inners()[0]; - typename polygon::ring_type& ring_xy = randstad_xy.inners()[0]; + typename bg::model::polygon::ring_type& ring = randstad.inners()[0]; + typename bg::model::polygon::ring_type& ring_xy = randstad_xy.inners()[0]; // Add them in counter-clockwise direction (see map of the Netherlands) add_to_ring(dutch_prj, gouda, ring, ring_xy); @@ -121,8 +130,8 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) // Check the area in square KM static const double KM2 = 1.0e6; - double d_ll = area(randstad) / KM2; - double d_xy = area(randstad_xy) / KM2; + double d_ll = bg::area(randstad) / KM2; + double d_xy = bg::area(randstad_xy) / KM2; BOOST_CHECK_CLOSE(d_ll, d_xy, 1.0); if (hole) @@ -136,8 +145,8 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) BOOST_CHECK_CLOSE(d_xy, concave ? 980.658 : 1360.140, perc); // No hole: area of outer should be equal to area of ring - double r_ll = area(randstad.outer()) / KM2; - double r_xy = area(randstad_xy.outer()) / KM2; + double r_ll = bg::area(randstad.outer()) / KM2; + double r_xy = bg::area(randstad_xy.outer()) / KM2; BOOST_CHECK_CLOSE(d_ll, r_ll, perc); BOOST_CHECK_CLOSE(d_xy, r_xy, perc); @@ -145,8 +154,8 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) // Calculate are using specified strategy, here with radius in KM // We then don't have to divide by KM*KM to get the same result - boost::geometry::strategy::area::huiller strategy(6372.8); - d_ll = area(randstad, strategy); + bg::strategy::area::huiller strategy(6372.8); + d_ll = bg::area(randstad, strategy); BOOST_CHECK_CLOSE(d_ll, d_xy, 1.0); } @@ -155,13 +164,13 @@ void test_area_polygon_ll(bool concave, bool hole, double perc) template void test_latlong(double perc) { - test_area_polygon_ll, point_ll > >(false, false, perc); + test_area_polygon_ll, bg::model::point_ll > >(false, false, perc); // with concavities - test_area_polygon_ll, point_ll > >(true, false, perc); + test_area_polygon_ll, bg::model::point_ll > >(true, false, perc); // with holes - test_area_polygon_ll, point_ll > >(false, true, perc); + test_area_polygon_ll, bg::model::point_ll > >(false, true, perc); } int test_main(int, char* []) diff --git a/test/extensions/gis/latlong/distance_mixed.cpp b/test/extensions/gis/latlong/distance_mixed.cpp index 51b6c0a02..ab3e8373b 100644 --- a/test/extensions/gis/latlong/distance_mixed.cpp +++ b/test/extensions/gis/latlong/distance_mixed.cpp @@ -21,18 +21,17 @@ int test_main(int, char* []) { - using namespace boost::geometry; - using namespace boost::geometry::strategy::distance; + using namespace bg::strategy::distance; - point_ll_deg paris; - paris.lat(dms(48, 52, 0)); - paris.lon(dms(2, 19, 59)); + bg::model::point_ll_deg paris; + paris.lat(bg::dms(48, 52, 0)); + paris.lon(bg::dms(2, 19, 59)); - point_ll_deg amsterdam; - amsterdam.lat(dms(52, 22, 23)); - amsterdam.lon(dms(4, 53, 32)); + bg::model::point_ll_deg amsterdam; + amsterdam.lat(bg::dms(52, 22, 23)); + amsterdam.lon(bg::dms(4, 53, 32)); - point_ll_rad paris_rad, amsterdam_rad; + bg::model::point_ll_rad paris_rad, amsterdam_rad; transform(amsterdam, amsterdam_rad); transform(paris, paris_rad); @@ -43,26 +42,26 @@ int test_main(int, char* []) double d4 = 0.001 * distance(paris_rad, amsterdam); std::cout << "Distances: " << d1 << " == " << d2 << " == " << d3 << " == " << d4 << std::endl; - double d5 = 0.001 * distance(paris, amsterdam, vincenty()); - double d6 = 0.001 * distance(paris_rad, amsterdam_rad, vincenty()); - double d7 = 0.001 * distance(paris, amsterdam_rad, vincenty()); - double d8 = 0.001 * distance(paris_rad, amsterdam, vincenty()); + double d5 = 0.001 * distance(paris, amsterdam, vincenty()); + double d6 = 0.001 * distance(paris_rad, amsterdam_rad, vincenty()); + double d7 = 0.001 * distance(paris, amsterdam_rad, vincenty()); + double d8 = 0.001 * bg::distance(paris_rad, amsterdam, vincenty()); std::cout << "Distances: " << d5 << " == " << d6 << " == " << d7 << " == " << d8 << std::endl; - point_ll_deg barcelona( - latitude<>(dms(41, 23)), - longitude<>(dms(2, 11)) + bg::model::point_ll_deg barcelona( + bg::latitude<>(bg::dms(41, 23)), + bg::longitude<>(bg::dms(2, 11)) ); // Now declare a line in latlong and calculate the distance, this MUST reverse... - linestring_ll_deg ab; + bg::model::linestring_ll_deg ab; ab.push_back(amsterdam); ab.push_back(barcelona); double d9 = 0.001 * distance(ab, paris); double d10 = 0.001 * distance(paris, ab); - double d11 = 0.001 * distance(paris, ab, vincenty()); - double d12 = 0.001 * distance(ab, paris, vincenty()); + double d11 = 0.001 * distance(paris, ab, vincenty()); + double d12 = 0.001 * distance(ab, paris, vincenty()); std::cout << "Distances: " << d9 << " == " << d10 << " == " << d11 << " == " << d12 << std::endl; // TODO: solve this case, it is reversed -> strategy should be reversed as well diff --git a/test/extensions/gis/latlong/parse.cpp b/test/extensions/gis/latlong/parse.cpp index 27c1bebdb..24bc078a6 100644 --- a/test/extensions/gis/latlong/parse.cpp +++ b/test/extensions/gis/latlong/parse.cpp @@ -27,21 +27,21 @@ void test_2d(double c, bool use_strategy) // normal order, east=x, north=y P p; parse(p, std::string("1dE"), std::string("2N")); - BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 1 * c, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 2 * c, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<0>(p)), (double) 1 * c, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<1>(p)), (double) 2 * c, 1.0e-6); // reversed order, y,x -> should be interpreted correctly parse(p, std::string("1dN"), std::string("2E")); - BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 2 * c, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 1 * c, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<0>(p)), (double) 2 * c, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<1>(p)), (double) 1 * c, 1.0e-6); if (use_strategy) { // DUTCH system NOZW, only for degrees - boost::geometry::strategy::dms_parser strategy; + bg::strategy::dms_parser strategy; parse(p, std::string("1dO"), std::string("2Z"), strategy); - BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 1, 1.0e-6); - BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) -2, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<0>(p)), (double) 1, 1.0e-6); + BOOST_CHECK_CLOSE( ((double) bg::get<1>(p)), (double) -2, 1.0e-6); } // rest of DMS is checked in parse_dms @@ -57,8 +57,8 @@ int test_main(int, char* []) //test_2d > >(); //test_2d > >(); - test_2d > >(1.0, true); - test_2d > >(boost::geometry::math::d2r, false); + test_2d > >(1.0, true); + test_2d > >(bg::math::d2r, false); return 0; } diff --git a/test/extensions/gis/latlong/parse_dms.cpp b/test/extensions/gis/latlong/parse_dms.cpp index cb45740b4..1ff95ad2c 100644 --- a/test/extensions/gis/latlong/parse_dms.cpp +++ b/test/extensions/gis/latlong/parse_dms.cpp @@ -16,7 +16,7 @@ -void check(boost::geometry::dms_result const& r, double v, int axis) +void check(bg::dms_result const& r, double v, int axis) { double const d = r; BOOST_CHECK_CLOSE(d, v, 0.0001); @@ -26,28 +26,28 @@ void check(boost::geometry::dms_result const& r, double v, int axis) template void test_dms(std::string const& s, double v, int axis) { - boost::geometry::strategy::dms_parser parser; + bg::strategy::dms_parser parser; check(parser(s.c_str()), v, axis); } template void test_dms_french(std::string const& s, double v, int axis) { - boost::geometry::strategy::dms_parser parser; + bg::strategy::dms_parser parser; check(parser(s.c_str()), v, axis); } template void test_dms_dutch(std::string const& s, double v, int axis) { - boost::geometry::strategy::dms_parser parser; + bg::strategy::dms_parser parser; check(parser(s.c_str()), v, axis); } template void test_dms_case(std::string const& s, double v, int axis) { - boost::geometry::strategy::dms_parser parser; + bg::strategy::dms_parser parser; check(parser(s.c_str()), v, axis); } diff --git a/test/extensions/gis/latlong/point_ll.cpp b/test/extensions/gis/latlong/point_ll.cpp index 45499f1de..a56b60b34 100644 --- a/test/extensions/gis/latlong/point_ll.cpp +++ b/test/extensions/gis/latlong/point_ll.cpp @@ -21,27 +21,27 @@ template void test_all() { - typedef typename boost::geometry::coordinate_type

::type type; + typedef typename bg::coordinate_type

::type type; - P p1(boost::geometry::latitude(boost::geometry::dms(12, 2, 36)), - boost::geometry::longitude(boost::geometry::dms(77, 1, 42))); + P p1(bg::latitude(bg::dms(12, 2, 36)), + bg::longitude(bg::dms(77, 1, 42))); // Check decimal/degree conversion - BOOST_CHECK_CLOSE(boost::geometry::get<0>(p1), type(-77.0283), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(p1), type(-12.0433), 0.001); + BOOST_CHECK_CLOSE(bg::get<0>(p1), type(-77.0283), 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(p1), type(-12.0433), 0.001); // Check degree/radian conversion - boost::geometry::point_ll > p2; - boost::geometry::transform(p1, p2); + bg::model::point_ll > p2; + bg::transform(p1, p2); - BOOST_CHECK_CLOSE(boost::geometry::get<0>(p2), type(-1.3444), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(p2), type(-0.210196), 0.001); + BOOST_CHECK_CLOSE(bg::get<0>(p2), type(-1.3444), 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(p2), type(-0.210196), 0.001); // Check degree/radian conversion back P p3; - boost::geometry::transform(p2, p3); - BOOST_CHECK_CLOSE(boost::geometry::get<0>(p3), type(-77.0283), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(p3), type(-12.0433), 0.001); + bg::transform(p2, p3); + BOOST_CHECK_CLOSE(bg::get<0>(p3), type(-77.0283), 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(p3), type(-12.0433), 0.001); // Check decimal/degree conversion back @@ -51,7 +51,7 @@ void test_all() bool positive; char cardinal; - boost::geometry::dms d1(boost::geometry::get<0>(p3)); + bg::dms d1(bg::get<0>(p3)); d1.get_dms(d, m, s, positive, cardinal); BOOST_CHECK(d == 77); @@ -69,8 +69,8 @@ void test_all() int test_main(int, char* []) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/gis/latlong/vincenty.cpp b/test/extensions/gis/latlong/vincenty.cpp index f39d06586..07f546e5f 100644 --- a/test/extensions/gis/latlong/vincenty.cpp +++ b/test/extensions/gis/latlong/vincenty.cpp @@ -22,7 +22,6 @@ # include #endif -namespace bg = boost::geometry; template @@ -63,13 +62,13 @@ int test_main(int, char* []) //test_all(); //test_all(); - test_all > >(); - test_all > >(); - test_all > >(); + test_all > >(); + test_all > >(); + test_all > >(); #if defined(HAVE_TTMATH) - test_all, 2, bg::cs::geographic > >(); - test_all > >(); + test_all, 2, bg::cs::geographic > >(); + test_all > >(); #endif diff --git a/test/extensions/gis/projections/projection.cpp b/test/extensions/gis/projections/projection.cpp index 20ead9e73..ce03cf7f3 100644 --- a/test/extensions/gis/projections/projection.cpp +++ b/test/extensions/gis/projections/projection.cpp @@ -31,11 +31,11 @@ template void test_one(double lon, double lat, - typename boost::geometry::coordinate_type::type x, - typename boost::geometry::coordinate_type::type y, + typename bg::coordinate_type::type x, + typename bg::coordinate_type::type y, std::string const& parameters) { - boost::geometry::projection::parameters par = boost::geometry::projection::detail::pj_init_plus(parameters); + bg::projection::parameters par = bg::projection::detail::pj_init_plus(parameters); Prj prj(par); P1 ll; @@ -45,18 +45,18 @@ void test_one(double lon, double lat, P2 xy; prj.forward(ll, xy); - BOOST_CHECK_CLOSE(boost::geometry::get<0>(xy), x, 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(xy), y, 0.001); + BOOST_CHECK_CLOSE(bg::get<0>(xy), x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(xy), y, 0.001); } template void test_all() { - typedef typename boost::geometry::coordinate_type

::type coord_type; - typedef boost::geometry::point_ll > point_type; + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point_ll > point_type; // aea - test_one, point_type, P> + test_one, point_type, P> (4.897000, 52.371000, 334609.583974, 5218502.503686, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); } @@ -67,10 +67,10 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - //test_all >(); - test_all >(); - test_all >(); - test_all >(); + //test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/gis/projections/projection_epsg.cpp b/test/extensions/gis/projections/projection_epsg.cpp index ad41699f1..59bdac998 100644 --- a/test/extensions/gis/projections/projection_epsg.cpp +++ b/test/extensions/gis/projections/projection_epsg.cpp @@ -32,13 +32,13 @@ template void test_one(double lon, double lat, - typename boost::geometry::coordinate_type::type x, - typename boost::geometry::coordinate_type::type y) + typename bg::coordinate_type::type x, + typename bg::coordinate_type::type y) { - typedef typename boost::geometry::coordinate_type::type coord_type; + typedef typename bg::coordinate_type::type coord_type; - typedef boost::geometry::projection::epsg_traits epsg_traits; - boost::geometry::projection::parameters par = boost::geometry::projection::detail::pj_init_plus(epsg_traits::par()); + typedef bg::projection::epsg_traits epsg_traits; + bg::projection::parameters par = bg::projection::detail::pj_init_plus(epsg_traits::par()); typedef typename epsg_traits::type prj_type; prj_type prj(par); @@ -50,15 +50,15 @@ void test_one(double lon, double lat, P2 xy; prj.forward(ll, xy); - BOOST_CHECK_CLOSE(boost::geometry::get<0>(xy), x, 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(xy), y, 0.001); + BOOST_CHECK_CLOSE(bg::get<0>(xy), x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(xy), y, 0.001); } template void test_deg_rad(double factor) { - typedef typename boost::geometry::coordinate_type

::type coord_type; - typedef boost::geometry::point_ll > point_type; + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point_ll > point_type; test_one<28992, point_type, P>(4.897000 * factor, 52.371000 * factor, 121590.388077, 487013.903377); test_one<29118, point_type, P>(4.897000 * factor, 52.371000 * factor, 4852882, 9129373); @@ -67,8 +67,8 @@ void test_deg_rad(double factor) template void test_all() { - test_deg_rad(1.0); - test_deg_rad(boost::geometry::math::d2r); + test_deg_rad(1.0); + test_deg_rad(bg::math::d2r); } int test_main(int, char* []) @@ -77,10 +77,10 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - //test_all >(); - test_all >(); - test_all >(); - test_all >(); + //test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/gis/projections/projections.cpp b/test/extensions/gis/projections/projections.cpp index 98308bd54..9300744a5 100644 --- a/test/extensions/gis/projections/projections.cpp +++ b/test/extensions/gis/projections/projections.cpp @@ -45,57 +45,57 @@ inline void check(double v, double ve, std::string const& name, std::string cons template void test_forward(std::string const& name, double lon, double lat, - typename boost::geometry::coordinate_type

::type x, - typename boost::geometry::coordinate_type

::type y, + typename bg::coordinate_type

::type x, + typename bg::coordinate_type

::type y, std::string const& parameters) { - typedef typename boost::geometry::coordinate_type

::type coord_type; - typedef boost::geometry::point_ll > lonlat_type; + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point_ll > lonlat_type; lonlat_type ll; ll.lon(lon); ll.lat(lat); - boost::geometry::projection::parameters params = boost::geometry::projection::detail::pj_init_plus(parameters); - boost::geometry::projection::factory pf; + bg::projection::parameters params = bg::projection::detail::pj_init_plus(parameters); + bg::projection::factory pf; - boost::shared_ptr > prj(pf.create_new(params)); + boost::shared_ptr > prj(pf.create_new(params)); P xy; prj->forward(ll, xy); - //std::cout << std::setprecision(16) << boost::geometry::get<0>(xy) << " " << boost::geometry::get<1>(xy) << std::endl; + //std::cout << std::setprecision(16) << bg::get<0>(xy) << " " << bg::get<1>(xy) << std::endl; - check(boost::geometry::get<0>(xy), x, name, "x"); - check(boost::geometry::get<1>(xy), y, name, "y"); + check(bg::get<0>(xy), x, name, "x"); + check(bg::get<1>(xy), y, name, "y"); } template void test_inverse(std::string const& name, - typename boost::geometry::coordinate_type

::type x, - typename boost::geometry::coordinate_type

::type y, + typename bg::coordinate_type

::type x, + typename bg::coordinate_type

::type y, double lon, double lat, std::string const& parameters) { - typedef typename boost::geometry::coordinate_type

::type coord_type; - typedef boost::geometry::point_ll > lonlat_type; + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point_ll > lonlat_type; P xy; - boost::geometry::set<0>(xy, x); - boost::geometry::set<1>(xy, y); + bg::set<0>(xy, x); + bg::set<1>(xy, y); - boost::geometry::projection::parameters params = boost::geometry::projection::detail::pj_init_plus(parameters); - boost::geometry::projection::factory pf; + bg::projection::parameters params = bg::projection::detail::pj_init_plus(parameters); + bg::projection::factory pf; - boost::shared_ptr > prj(pf.create_new(params)); + boost::shared_ptr > prj(pf.create_new(params)); lonlat_type ll; prj->inverse(xy, ll); - //std::cout << std::setprecision(16) << boost::geometry::get<0>(ll) << " " << boost::geometry::get<1>(ll) << std::endl; + //std::cout << std::setprecision(16) << bg::get<0>(ll) << " " << bg::get<1>(ll) << std::endl; - check(boost::geometry::get<0>(ll), lon, name, "lon"); - check(boost::geometry::get<1>(ll), lat, name, "lat"); + check(bg::get<0>(ll), lon, name, "lon"); + check(bg::get<1>(ll), lat, name, "lat"); } @@ -347,12 +347,12 @@ int test_main(int, char* []) //test_all(); //test_all(); //test_all(); - //test_all >(); - //test_all >(); - //test_all >(); + //test_all >(); + //test_all >(); + //test_all >(); // Leave only one here, because this divides compilation time with 6 or 7 - test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/index/rtree.cpp b/test/extensions/index/rtree.cpp index 5eb09f1ca..2f31ec82a 100644 --- a/test/extensions/index/rtree.cpp +++ b/test/extensions/index/rtree.cpp @@ -15,12 +15,14 @@ #include +namespace bg = boost::geometry; + int test_main(int, char* []) { // TODO: mloskot - This is ONLY compilation test and // placeholder to implement real test. - boost::geometry::index::rtree si(1, 6); - return 0; + bg::index::rtree si(1, 6); +x return 0; } diff --git a/test/extensions/nsphere/access.cpp b/test/extensions/nsphere/access.cpp index 6ace40609..eabd6d095 100644 --- a/test/extensions/nsphere/access.cpp +++ b/test/extensions/nsphere/access.cpp @@ -18,14 +18,14 @@ template void test_get_set() { - typedef typename boost::geometry::coordinate_type::type coordinate_type; + typedef typename bg::coordinate_type::type coordinate_type; G g; - boost::geometry::set<0>(g, coordinate_type(1)); - boost::geometry::set<1>(g, coordinate_type(2)); + bg::set<0>(g, coordinate_type(1)); + bg::set<1>(g, coordinate_type(2)); - coordinate_type x = boost::geometry::get<0>(g); - coordinate_type y = boost::geometry::get<1>(g); + coordinate_type x = bg::get<0>(g); + coordinate_type y = bg::get<1>(g); BOOST_CHECK_CLOSE(double(x), 1.0, 0.0001); BOOST_CHECK_CLOSE(double(y), 2.0, 0.0001); @@ -35,10 +35,10 @@ void test_get_set() template void test_all() { - typedef typename boost::geometry::coordinate_type

::type coordinate_type; + typedef typename bg::coordinate_type

::type coordinate_type; // N-SPHERE, setting sphere center - test_get_set >(); + test_get_set >(); } @@ -52,9 +52,9 @@ int test_main(int, char* []) test_get_set >(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/nsphere/area.cpp b/test/extensions/nsphere/area.cpp index 6b9a82891..f086dc6ae 100644 --- a/test/extensions/nsphere/area.cpp +++ b/test/extensions/nsphere/area.cpp @@ -17,13 +17,13 @@ template void test_area_circle() { - boost::geometry::nsphere c; + bg::model::nsphere c; - boost::geometry::set<0>(c.center(), 0); - boost::geometry::set<1>(c.center(), 0); + bg::set<0>(c.center(), 0); + bg::set<1>(c.center(), 0); c.radius(2); - double d = boost::geometry::area(c); + double d = bg::area(c); BOOST_CHECK_CLOSE(d, 4 * 3.1415926535897932384626433832795, 0.001); } @@ -31,6 +31,6 @@ void test_area_circle() int test_main(int, char* []) { - test_area_circle, double>(); + test_area_circle, double>(); return 0; } diff --git a/test/extensions/nsphere/circle.cpp b/test/extensions/nsphere/circle.cpp index 45ad96f25..9e8cdacd1 100644 --- a/test/extensions/nsphere/circle.cpp +++ b/test/extensions/nsphere/circle.cpp @@ -21,7 +21,7 @@ -using namespace boost::geometry; +namespace bg = boost::geometry; // define a custom circle struct custom_circle @@ -42,7 +42,7 @@ struct tag template<> struct point_type { - typedef point type; + typedef model::point type; }; template<> @@ -93,37 +93,37 @@ struct radius_access } }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits template void check_nsphere(S& to_check, RT radius, CT center_x, CT center_y, CT center_z) { - BOOST_CONCEPT_ASSERT( (concept::ConstNsphere) ); - BOOST_CONCEPT_ASSERT( (concept::Nsphere) ); + BOOST_CONCEPT_ASSERT( (bg::concept::ConstNsphere) ); + BOOST_CONCEPT_ASSERT( (bg::concept::Nsphere) ); - BOOST_CHECK_EQUAL(get_radius<0>(to_check), radius); + BOOST_CHECK_EQUAL(bg::get_radius<0>(to_check), radius); - BOOST_CHECK_EQUAL(get<0>(to_check), center_x); - BOOST_CHECK_EQUAL(get<1>(to_check), center_y); - if (dimension::value >= 3) + BOOST_CHECK_EQUAL(bg::get<0>(to_check), center_x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check), center_y); + if (bg::dimension::value >= 3) { - BOOST_CHECK_EQUAL(get<2>(to_check), center_z); + BOOST_CHECK_EQUAL(bg::get<2>(to_check), center_z); } } template void test_construction() { - typedef typename coordinate_type

::type ctype; + typedef typename bg::coordinate_type

::type ctype; - nsphere c1; + bg::model::nsphere c1; check_nsphere(c1, 0, 0,0,0); P center; - boost::geometry::assign(center, 1, 2, 3); - nsphere c2(center, 4); + bg::assign(center, 1, 2, 3); + bg::model::nsphere c2(center, 4); check_nsphere(c2, 4, 1,2,3); } @@ -133,14 +133,14 @@ void test_assignment_3d() C c; // by hand - set<0>(c, 5); - set<1>(c, 50); - set<2>(c, 500); + bg::set<0>(c, 5); + bg::set<1>(c, 50); + bg::set<2>(c, 500); - set_radius<0>(c, 5000); + bg::set_radius<0>(c, 5000); check_nsphere(c, 5000, 5,50,500); - assign(c, 6, 60, 600); + bg::assign(c, 6, 60, 600); check_nsphere(c, 5000, 6,60,600); } @@ -150,10 +150,10 @@ void test_assignment_2d() C c; // by hand - set<0>(c, 5); - set<1>(c, 50); + bg::set<0>(c, 5); + bg::set<1>(c, 50); - set_radius<0>(c, 5000); + bg::set_radius<0>(c, 5000); } @@ -161,7 +161,7 @@ template void test_all() { test_construction(); - test_assignment_3d >(); + test_assignment_3d >(); } template @@ -178,9 +178,9 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); test_assignment_2d(); diff --git a/test/extensions/nsphere/multi_within.cpp b/test/extensions/nsphere/multi_within.cpp index 677a36153..cf726af74 100644 --- a/test/extensions/nsphere/multi_within.cpp +++ b/test/extensions/nsphere/multi_within.cpp @@ -22,11 +22,11 @@ int test_main( int , char* [] ) { - typedef boost::geometry::point_xy gl_point; - typedef boost::geometry::circle gl_circle; - typedef boost::geometry::linear_ring gl_ring; - typedef boost::geometry::polygon gl_polygon; - typedef boost::geometry::multi_polygon gl_multi_polygon; + typedef bg::model::point_xy gl_point; + typedef bg::circle gl_circle; + typedef bg::model::linear_ring gl_ring; + typedef bg::model::polygon gl_polygon; + typedef bg::multi_polygon gl_multi_polygon; gl_circle circle(gl_point(1, 1), 2.5); @@ -35,7 +35,7 @@ int test_main( int , char* [] ) ring.push_back(gl_point(1,0)); ring.push_back(gl_point(1,1)); ring.push_back(gl_point(0,1)); - boost::geometry::correct(ring); + bg::correct(ring); gl_polygon pol; pol.outer() = ring; diff --git a/test/extensions/nsphere/point_type.cpp b/test/extensions/nsphere/point_type.cpp index fa6753c8e..6184b2d89 100644 --- a/test/extensions/nsphere/point_type.cpp +++ b/test/extensions/nsphere/point_type.cpp @@ -26,7 +26,7 @@ template void test_geometry() { - BOOST_CHECK_EQUAL(typeid(typename boost::geometry::point_type::type).name(), + BOOST_CHECK_EQUAL(typeid(typename bg::point_type::type).name(), typeid(Expected).name()); } @@ -35,13 +35,13 @@ void test_all() { test_geometry(); test_geometry(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); - test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); test_geometry, P>(); test_geometry, P>(); @@ -64,9 +64,9 @@ int test_main(int, char* []) test_geometry, boost::tuple >(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/extensions/nsphere/within.cpp b/test/extensions/nsphere/within.cpp index 963744362..5f390b204 100644 --- a/test/extensions/nsphere/within.cpp +++ b/test/extensions/nsphere/within.cpp @@ -18,13 +18,13 @@ template void test_circle(std::string const& wkt_geometry, bool expected) { - boost::geometry::circle circle; - boost::geometry::assign(circle, 1.0, 1.0, 3.0); + bg::model::circle circle; + bg::assign(circle, 1.0, 1.0, 3.0); Geometry geometry; - boost::geometry::read_wkt(wkt_geometry, geometry); + bg::read_wkt(wkt_geometry, geometry); - bool detected = boost::geometry::within(geometry, circle); + bool detected = bg::within(geometry, circle); BOOST_CHECK_MESSAGE(detected == expected, "within: " << wkt_geometry @@ -39,18 +39,17 @@ void test_circle(std::string const& wkt_geometry, bool expected) template void test_circles() { - // Circles do not yet run on CLN/GMP test_circle

("POINT(2 1)", true); test_circle

("POINT(12 1)", false); - test_circle >("LINESTRING(1 1,2 1,2 2)", true); - test_circle >("LINESTRING(1 1,2 1,2 2,10 10)", false); + test_circle >("LINESTRING(1 1,2 1,2 2)", true); + test_circle >("LINESTRING(1 1,2 1,2 2,10 10)", false); } int test_main( int , char* [] ) { - test_circles >(); + test_circles >(); return 0; } diff --git a/test/geometries/adapted.cpp b/test/geometries/adapted.cpp index a5e389444..ad8661921 100644 --- a/test/geometries/adapted.cpp +++ b/test/geometries/adapted.cpp @@ -55,15 +55,15 @@ template void test_geometry(G const& geometry, int expected_size = 0) { #if defined(BOOST_GEOMETRY_TEST_RING) - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstRing) ); + BOOST_CONCEPT_ASSERT( (bg::concept::ConstRing) ); #elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstMultiPoint) ); + BOOST_CONCEPT_ASSERT( (bg::concept::ConstMultiPoint) ); #else - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstLinestring) ); + BOOST_CONCEPT_ASSERT( (bg::concept::ConstLinestring) ); #endif - typedef typename boost::geometry::point_type::type P; - typedef typename boost::geometry::coordinate_type

::type C; + typedef typename bg::point_type::type P; + typedef typename bg::coordinate_type

::type C; // Check range-like behaviour BOOST_CHECK_EQUAL(boost::size(geometry), expected_size); @@ -93,13 +93,13 @@ int test_main(int, char* []) { /* test_all(); test_all >(); - test_all >(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); */ - test_all >(); - //test_all >(); + test_all >(); + //test_all >(); return 0; } diff --git a/test/geometries/boost_array_as_point.cpp b/test/geometries/boost_array_as_point.cpp index f6de5fd87..1959f4a5b 100644 --- a/test/geometries/boost_array_as_point.cpp +++ b/test/geometries/boost_array_as_point.cpp @@ -19,14 +19,13 @@ int test_main(int, char* []) { - using namespace boost::geometry; - point p1(1,2,3); + bg::model::point p1(1,2,3); double p2[3] = {4,5,6}; boost::tuple p3(7,8,9); - boost::array p4={{10,11,12}}; - std::clog << distance(p1,p2) << std::endl; - std::clog << distance(p2,p3) << std::endl; - std::clog << distance(p3,p4) << std::endl; + boost::array p4 = {{10,11,12}}; + std::clog << bg::distance(p1, p2) << std::endl; + std::clog << bg::distance(p2, p3) << std::endl; + std::clog << bg::distance(p3, p4) << std::endl; return 0; } diff --git a/test/geometries/box.cpp b/test/geometries/box.cpp index 28d1c5b55..d2842e188 100644 --- a/test/geometries/box.cpp +++ b/test/geometries/box.cpp @@ -18,16 +18,15 @@ #include #include -using namespace boost::geometry; template -box

create_box() +bg::model::box

create_box() { P p1; P p2; - assign(p1, 1, 2, 5); - assign(p2, 3, 4, 6); - return box

(p1, p2); + bg::assign(p1, 1, 2, 5); + bg::assign(p2, 3, 4, 6); + return bg::model::box

(p1, p2); } template @@ -35,26 +34,26 @@ void check_box(B& to_check, T min_x, T min_y, T min_z, T max_x, T max_y, T max_z) { - BOOST_CHECK_EQUAL(get<0>(to_check.min_corner()), min_x); - BOOST_CHECK_EQUAL(get<1>(to_check.min_corner()), min_y); - BOOST_CHECK_EQUAL(get<2>(to_check.min_corner()), min_z); - BOOST_CHECK_EQUAL(get<0>(to_check.max_corner()), max_x); - BOOST_CHECK_EQUAL(get<1>(to_check.max_corner()), max_y); - BOOST_CHECK_EQUAL(get<2>(to_check.max_corner()), max_z); + BOOST_CHECK_EQUAL(bg::get<0>(to_check.min_corner()), min_x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check.min_corner()), min_y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check.min_corner()), min_z); + BOOST_CHECK_EQUAL(bg::get<0>(to_check.max_corner()), max_x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check.max_corner()), max_y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check.max_corner()), max_z); } template void test_construction() { - typedef typename coordinate_type

::type T; + typedef typename bg::coordinate_type

::type T; - box

b1 = make_zero >(); + bg::model::box

b1 = bg::make_zero >(); check_box(b1, T(),T(),T(),T(),T(),T()); - box

b2(create_box

()); + bg::model::box

b2(create_box

()); check_box(b2, 1,2,5,3,4,6); - box

b3 = make_inverse >(); + bg::model::box

b3 = bg::make_inverse >(); check_box(b3, boost::numeric::bounds::highest(), boost::numeric::bounds::highest(), boost::numeric::bounds::highest(), @@ -66,13 +65,13 @@ void test_construction() template void test_assignment() { - box

b(create_box

()); - set<0>(b.min_corner(), 10); - set<1>(b.min_corner(), 20); - set<2>(b.min_corner(), 30); - set<0>(b.max_corner(), 40); - set<1>(b.max_corner(), 50); - set<2>(b.max_corner(), 60); + bg::model::box

b(create_box

()); + bg::set<0>(b.min_corner(), 10); + bg::set<1>(b.min_corner(), 20); + bg::set<2>(b.min_corner(), 30); + bg::set<0>(b.max_corner(), 40); + bg::set<1>(b.max_corner(), 50); + bg::set<2>(b.max_corner(), 60); check_box(b, 10,20,30,40,50,60); } @@ -89,9 +88,9 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/geometries/concepts/check.cpp b/test/geometries/concepts/check.cpp index 01cdcd13e..4209df3ea 100644 --- a/test/geometries/concepts/check.cpp +++ b/test/geometries/concepts/check.cpp @@ -26,7 +26,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -44,7 +44,7 @@ template <> struct access template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -60,11 +60,11 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() { - boost::geometry::concept::check(); - boost::geometry::concept::check(); + bg::concept::check(); + bg::concept::check(); } diff --git a/test/geometries/custom_linestring.cpp b/test/geometries/custom_linestring.cpp index bc33e092f..b8616fd60 100644 --- a/test/geometries/custom_linestring.cpp +++ b/test/geometries/custom_linestring.cpp @@ -38,7 +38,7 @@ struct custom_linestring1 : std::vector

{}; namespace boost { namespace geometry { namespace traits { template struct tag< custom_linestring1

> { typedef linestring_tag type; }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits // ---------------------------------------------------------------------------- // Second custom linestring, decides to implement all edit operations itself @@ -60,28 +60,28 @@ namespace boost { namespace geometry { namespace traits { }; #endif -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits // ---------------------------------------------------------------------------- template void test_linestring() { - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::Linestring) ); - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstLinestring) ); + BOOST_CONCEPT_ASSERT( (bg::concept::Linestring) ); + BOOST_CONCEPT_ASSERT( (bg::concept::ConstLinestring) ); G geometry; - typedef typename boost::geometry::point_type::type P; + typedef typename bg::point_type::type P; - boost::geometry::clear(geometry); + bg::clear(geometry); BOOST_CHECK_EQUAL(boost::size(geometry), 0); - boost::geometry::append(geometry, boost::geometry::make_zero

()); + bg::append(geometry, bg::make_zero

()); BOOST_CHECK_EQUAL(boost::size(geometry), 1); //std::cout << geometry << std::endl; - boost::geometry::clear(geometry); + bg::clear(geometry); BOOST_CHECK_EQUAL(boost::size(geometry), 0); @@ -91,9 +91,9 @@ void test_linestring() template void test_all() { - test_linestring >(); - test_linestring >(); - test_linestring >(); + test_linestring >(); + test_linestring >(); + test_linestring >(); test_linestring >(); test_linestring >(); @@ -107,9 +107,9 @@ int test_main(int, char* []) { test_all(); test_all >(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/geometries/segment.cpp b/test/geometries/segment.cpp index ac592548f..26d848bf3 100644 --- a/test/geometries/segment.cpp +++ b/test/geometries/segment.cpp @@ -29,7 +29,7 @@ template void test_all() { - typedef boost::geometry::segment

S; + typedef bg::segment

S; P p1; P p2; @@ -38,22 +38,22 @@ void test_all() BOOST_CHECK_EQUAL(&s.second, &p2); // Compilation tests, all things should compile. - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstSegment) ); - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::Segment) ); + BOOST_CONCEPT_ASSERT( (bg::concept::ConstSegment) ); + BOOST_CONCEPT_ASSERT( (bg::concept::Segment) ); - typedef typename boost::geometry::coordinate_type::type T; - typedef typename boost::geometry::point_type::type SP; + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type SP; //std::cout << sizeof(typename coordinate_type::type) << std::endl; - typedef boost::geometry::segment

CS; + typedef bg::segment

CS; //BOOST_CONCEPT_ASSERT( (concept::ConstSegment) ); CS cs(p1, p2); - typedef typename boost::geometry::coordinate_type::type CT; - typedef typename boost::geometry::point_type::type CSP; + typedef typename bg::coordinate_type::type CT; + typedef typename bg::point_type::type CSP; } @@ -62,12 +62,12 @@ template void test_custom() { S seg; - boost::geometry::set<0,0>(seg, 1); - boost::geometry::set<0,1>(seg, 2); - boost::geometry::set<1,0>(seg, 3); - boost::geometry::set<1,1>(seg, 4); + bg::set<0,0>(seg, 1); + bg::set<0,1>(seg, 2); + bg::set<1,0>(seg, 3); + bg::set<1,1>(seg, 4); std::ostringstream out; - out << boost::geometry::dsv(seg); + out << bg::dsv(seg); BOOST_CHECK_EQUAL(out.str(), "((1, 2), (3, 4))"); } @@ -78,12 +78,12 @@ int test_main(int, char* []) test_all(); test_all(); //test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); test_custom(); - test_custom > >(); + test_custom > >(); test_custom >(); test_custom(); diff --git a/test/geometry_test_common.hpp b/test/geometry_test_common.hpp index eff5422d2..79b5e2975 100644 --- a/test/geometry_test_common.hpp +++ b/test/geometry_test_common.hpp @@ -80,5 +80,11 @@ template <> struct string_from_type #endif +// For all tests: +// - do NOT use "using namespace boost::geometry" to make clear what is Boost.Geometry +// - use bg:: as short alias +#include +namespace bg = boost::geometry; + #endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP diff --git a/test/iterators/box_iterator.cpp b/test/iterators/box_iterator.cpp index 4aba032ef..48f015718 100644 --- a/test/iterators/box_iterator.cpp +++ b/test/iterators/box_iterator.cpp @@ -24,14 +24,14 @@ template void test_geometry(std::string const& wkt, std::string const& expected) { Box box; - boost::geometry::read_wkt(wkt, box); + bg::read_wkt(wkt, box); { std::ostringstream out; - boost::geometry::box_iterator it(box), end(box, true); + bg::box_iterator it(box), end(box, true); for ( ; it != end; ++it) { - out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it); + out << " " << bg::get<0>(*it) << bg::get<1>(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -41,14 +41,14 @@ void test_geometry(std::string const& wkt, std::string const& expected) template void test_all() { - test_geometry >("polygon((1 1,2 2))", " 11 12 22 21 11"); - test_geometry >("polygon((3 3,5 5))", " 33 35 55 53 33"); + test_geometry >("polygon((1 1,2 2))", " 11 12 22 21 11"); + test_geometry >("polygon((3 3,5 5))", " 33 35 55 53 33"); } int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/iterators/circular_iterator.cpp b/test/iterators/circular_iterator.cpp index 05a83ad0d..f006288f6 100644 --- a/test/iterators/circular_iterator.cpp +++ b/test/iterators/circular_iterator.cpp @@ -24,13 +24,13 @@ template void test_forward(Geometry const& geometry, CircularIterator end, int offset, std::string const& expected) { - CircularIterator it(boost::begin(geometry), boost::end(geometry), + CircularIterator it(boost::begin(geometry), boost::end(geometry), boost::begin(geometry) + offset); std::ostringstream out; for (; it != end; ++it) { - out << boost::geometry::get<0>(*it); + out << bg::get<0>(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -40,13 +40,13 @@ template void test_backward(Geometry const& geometry, CircularIterator end, int offset, std::string const& expected) { - CircularIterator it(boost::begin(geometry), boost::end(geometry), + CircularIterator it(boost::begin(geometry), boost::end(geometry), boost::begin(geometry) + offset); std::ostringstream out; for (; it != end; --it) { - out << boost::geometry::get<0>(*it); + out << bg::get<0>(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -57,9 +57,9 @@ template void test_geometry(std::string const& wkt) { G geo; - boost::geometry::read_wkt(wkt, geo); + bg::read_wkt(wkt, geo); typedef typename boost::range_const_iterator::type normal_iterator; - typedef boost::geometry::circular_iterator circular_iterator; + typedef bg::circular_iterator circular_iterator; circular_iterator end(boost::end(geo)); @@ -86,7 +86,7 @@ void test_geometry(std::string const& wkt) std::ostringstream out; for (normal_iterator cit = boost::begin(copy); cit != boost::end(copy); ++cit) { - out << boost::geometry::get<0>(*cit); + out << bg::get<0>(*cit); } BOOST_CHECK_EQUAL(out.str(), "34512"); } @@ -95,13 +95,13 @@ void test_geometry(std::string const& wkt) template void test_all() { - test_geometry >("linestring(1 1,2 2,3 3,4 4,5 5)"); + test_geometry >("linestring(1 1,2 2,3 3,4 4,5 5)"); } int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/iterators/closing_iterator.cpp b/test/iterators/closing_iterator.cpp index e76266554..b8787759b 100644 --- a/test/iterators/closing_iterator.cpp +++ b/test/iterators/closing_iterator.cpp @@ -28,7 +28,7 @@ void test_non_geometry() v.push_back(2); v.push_back(3); - typedef boost::geometry::closing_iterator + typedef bg::closing_iterator < std::vector const > closing_iterator; @@ -53,8 +53,8 @@ template void test_geometry(std::string const& wkt) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - typedef boost::geometry::closing_iterator closing_iterator; + bg::read_wkt(wkt, geometry); + typedef bg::closing_iterator closing_iterator; // 1. Test normal behaviour @@ -65,7 +65,7 @@ void test_geometry(std::string const& wkt) std::ostringstream out; for (; it != end; ++it) { - out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it); + out << " " << bg::get<0>(*it) << bg::get<1>(*it); } BOOST_CHECK_EQUAL(out.str(), " 11 14 44 41 11"); @@ -83,13 +83,13 @@ void test_geometry(std::string const& wkt) std::copy( closing_iterator(geometry), - closing_iterator(geometry, true), + closing_iterator(geometry, true), std::back_inserter(copy)); std::ostringstream out; for (normal_iterator cit = boost::begin(copy); cit != boost::end(copy); ++cit) { - out << " " << boost::geometry::get<0>(*cit) << boost::geometry::get<1>(*cit); + out << " " << bg::get<0>(*cit) << bg::get<1>(*cit); } BOOST_CHECK_EQUAL(out.str(), " 11 14 44 41 11"); } @@ -100,13 +100,13 @@ template void test_all() { test_non_geometry(); - test_geometry >("POLYGON((1 1,1 4,4 4,4 1))"); + test_geometry >("POLYGON((1 1,1 4,4 4,4 1))"); } int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/iterators/ever_circling_iterator.cpp b/test/iterators/ever_circling_iterator.cpp index 7fb48a575..f44e469a6 100644 --- a/test/iterators/ever_circling_iterator.cpp +++ b/test/iterators/ever_circling_iterator.cpp @@ -21,7 +21,7 @@ template void test_geometry(std::string const& wkt) { G geo; - boost::geometry::read_wkt(wkt, geo); + bg::read_wkt(wkt, geo); typedef typename boost::range_iterator::type iterator_type; @@ -30,10 +30,10 @@ void test_geometry(std::string const& wkt) { std::ostringstream out; - boost::geometry::ever_circling_iterator it(boost::begin(geo), boost::end(geo)); + bg::ever_circling_iterator it(boost::begin(geo), boost::end(geo)); for (int i = 0; i < n; ++i, ++it) { - out << boost::geometry::get<0>(*it); + out << bg::get<0>(*it); } BOOST_CHECK_EQUAL(out.str(), "123451234512345"); } @@ -41,11 +41,11 @@ void test_geometry(std::string const& wkt) { std::ostringstream out; // Start somewhere - boost::geometry::ever_circling_iterator it( + bg::ever_circling_iterator it( boost::begin(geo), boost::end(geo), boost::begin(geo) + 1); for (int i = 0; i < n; ++i, ++it) { - out << boost::geometry::get<0>(*it); + out << bg::get<0>(*it); } BOOST_CHECK_EQUAL(out.str(), "234512345123451"); } @@ -54,12 +54,12 @@ void test_geometry(std::string const& wkt) std::ostringstream out; // Navigate to somewhere - boost::geometry::ever_circling_iterator it(boost::begin(geo), boost::end(geo)); + bg::ever_circling_iterator it(boost::begin(geo), boost::end(geo)); for (int i = 0; i < n; ++i, ++it) { const int m = boost::size(geo); it.moveto(boost::begin(geo) + m - (i % m) - 1); - out << boost::geometry::get<0>(*it); + out << bg::get<0>(*it); } BOOST_CHECK_EQUAL(out.str(), "543215432154321"); } @@ -67,10 +67,10 @@ void test_geometry(std::string const& wkt) // Check the range_iterator-one { std::ostringstream out; - boost::geometry::ever_circling_range_iterator it(geo); + bg::ever_circling_range_iterator it(geo); for (int i = 0; i < n; ++i, ++it) { - out << boost::geometry::get<0>(*it); + out << bg::get<0>(*it); } BOOST_CHECK_EQUAL(out.str(), "123451234512345"); } @@ -79,12 +79,12 @@ void test_geometry(std::string const& wkt) template void test_all() { - test_geometry >("linestring(1 1,2 2,3 3,4 4,5 5)"); + test_geometry >("linestring(1 1,2 2,3 3,4 4,5 5)"); } int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/iterators/segment_range_iterator.cpp b/test/iterators/segment_range_iterator.cpp index bb48ff64f..879f025e9 100644 --- a/test/iterators/segment_range_iterator.cpp +++ b/test/iterators/segment_range_iterator.cpp @@ -24,13 +24,13 @@ template void test_geometry(std::string const& wkt, std::string const& expected) { Segment segment; - boost::geometry::read_wkt(wkt, segment); + bg::read_wkt(wkt, segment); std::ostringstream out; - boost::geometry::segment_range_iterator it(segment), end(segment, true); + bg::segment_range_iterator it(segment), end(segment, true); for ( ; it != end; ++it) { - out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it); + out << " " << bg::get<0>(*it) << bg::get<1>(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -46,7 +46,7 @@ void test_all() int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/iterators/segment_returning_iterator.cpp b/test/iterators/segment_returning_iterator.cpp index 6c74d3c9a..575f97768 100644 --- a/test/iterators/segment_returning_iterator.cpp +++ b/test/iterators/segment_returning_iterator.cpp @@ -28,12 +28,12 @@ void test_linestring(std::string const& wkt, std::string const& expected) typedef C point_list; typedef typename C::value_type point; typedef typename C::iterator base_iterator; - typedef boost::geometry::segment_returning_iterator segment_returning_iterator; + typedef bg::segment_returning_iterator segment_returning_iterator; typedef typename segment_returning_iterator::value_type segment; - typedef boost::geometry::linestring linestring; + typedef bg::model::linestring linestring; linestring g; - boost::geometry::read_wkt(wkt, g); + bg::read_wkt(wkt, g); point_list v; std::copy(g.begin(), g.end(), std::back_insert_iterator(v)); @@ -46,8 +46,8 @@ void test_linestring(std::string const& wkt, std::string const& expected) while (it != end) { segment const& s = *it; - oss << boost::geometry::get<0>(s.first) << boost::geometry::get<1>(s.first) - << boost::geometry::get<0>(s.second) << boost::geometry::get<1>(s.second); + oss << bg::get<0>(s.first) << bg::get<1>(s.first) + << bg::get<0>(s.second) << bg::get<1>(s.second); ++it; } BOOST_CHECK_EQUAL(oss.str(), expected); @@ -56,7 +56,7 @@ void test_linestring(std::string const& wkt, std::string const& expected) int test_main(int, char* []) { // Test std::vector - typedef std::vector points_v; + typedef std::vector points_v; test_linestring("linestring empty", ""); test_linestring("linestring ()", ""); test_linestring("linestring (1 1)", ""); @@ -65,7 +65,7 @@ int test_main(int, char* []) test_linestring("linestring (1 1, 2 2, 3 3, 4 4, 5 5, 6 6)", "11222233334444555566"); // Test std::list - typedef std::list points_l; + typedef std::list points_l; test_linestring("linestring empty", ""); test_linestring("linestring ()", ""); test_linestring("linestring (1 1)", ""); diff --git a/test/multi/algorithms/multi_area.cpp b/test/multi/algorithms/multi_area.cpp index ecb95db8c..0bf3b1c3c 100644 --- a/test/multi/algorithms/multi_area.cpp +++ b/test/multi/algorithms/multi_area.cpp @@ -20,13 +20,13 @@ template void test_all() { - typedef boost::geometry::multi_polygon > mp; + typedef bg::model::multi_polygon > mp; test_geometry("MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))", 16.0); } int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_centroid.cpp b/test/multi/algorithms/multi_centroid.cpp index ca392e674..5db72b9cb 100644 --- a/test/multi/algorithms/multi_centroid.cpp +++ b/test/multi/algorithms/multi_centroid.cpp @@ -26,25 +26,25 @@ template void test_2d(bool is_integer = false) { - typedef typename boost::geometry::coordinate_type

::type ct; + typedef typename bg::coordinate_type

::type ct; #ifdef REPORT_RESULTS std::cout << std::endl << "type: " << typeid(ct).name() << " size: " << sizeof(ct) << std::endl; #endif if (! is_integer) { - test_centroid >( + test_centroid >( "MULTIPOINT((1 1),(2 3),(5 0))", 2.666666666666667, 1.33333); // Only working for floating point: - test_centroid > >( + test_centroid > >( "MULTIPOLYGON(((1 1,1 3,3 3,3 1,1 1)),((4 1,4 3,8 3,8 1,4 1)))", 4.666666666666667, 2.0); - test_centroid > >( + test_centroid > >( "MULTIPOLYGON(((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))," "((10 10,10 12,12 12,12 10,10 10)))", @@ -56,7 +56,7 @@ void test_2d(bool is_integer = false) // Test using real-world polygon with large (Y) coordinates // (coordinates can be used for integer and floating point point-types) // Note that this will fail (overflow) if centroid calculation uses float - test_centroid > >( + test_centroid > >( "MULTIPOLYGON(((426062 4527794,426123 4527731" ",426113 4527700,426113 4527693,426115 4527671" ",426133 4527584,426135 4527569,426124 4527558" @@ -96,11 +96,11 @@ void test_2d(bool is_integer = false) int test_main(int, char* []) { - //test_2d >(); - test_2d >(); - test_2d >(true); - //test_2d >(true); - test_2d >(); + //test_2d >(); + test_2d >(); + test_2d >(true); + //test_2d >(true); + test_2d >(); return 0; } diff --git a/test/multi/algorithms/multi_convex_hull.cpp b/test/multi/algorithms/multi_convex_hull.cpp index aa586376f..766b1713c 100644 --- a/test/multi/algorithms/multi_convex_hull.cpp +++ b/test/multi/algorithms/multi_convex_hull.cpp @@ -35,9 +35,9 @@ template void test_all() { - typedef boost::geometry::multi_point

mp; - typedef boost::geometry::multi_linestring > ml; - typedef boost::geometry::multi_polygon > mpoly; + typedef bg::model::multi_point

mp; + typedef bg::model::multi_linestring > ml; + typedef bg::model::multi_polygon > mpoly; test_geometry("multipoint((1.1 1.1), (2.5 2.1), (3.1 3.1), (4.9 1.1), (3.1 1.9))", 5, 4, 3.8); test_geometry("multilinestring((2 4, 3 4, 3 5), (4 3,4 4,5 4))", 6, 5, 3.0); test_geometry("multipolygon(((1 4,1 6,2 5,3 5,4 6,4 4,1 4)), ((4 2,4 3,6 3,6 2,4 2)))", 12, 7, 14.0); @@ -46,9 +46,9 @@ void test_all() int test_main(int, char* []) { - //test_all >(); - //test_all >(); - test_all >(); + //test_all >(); + //test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_correct.cpp b/test/multi/algorithms/multi_correct.cpp index a8d8ecf8a..9b41adec1 100644 --- a/test/multi/algorithms/multi_correct.cpp +++ b/test/multi/algorithms/multi_correct.cpp @@ -29,11 +29,11 @@ void test_geometry(std::string const& wkt, std::string const& expected) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); - boost::geometry::correct(geometry); + bg::read_wkt(wkt, geometry); + bg::correct(geometry); std::ostringstream out; - out << boost::geometry::wkt(geometry); + out << bg::wkt(geometry); BOOST_CHECK_EQUAL(out.str(), expected); } @@ -41,7 +41,7 @@ void test_geometry(std::string const& wkt, std::string const& expected) template void test_all() { - typedef boost::geometry::multi_polygon > cw_type; + typedef bg::model::multi_polygon > cw_type; std::string cw_mp = "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))"; test_geometry(cw_mp, cw_mp); @@ -52,7 +52,7 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_dissolve.cpp b/test/multi/algorithms/multi_dissolve.cpp index 5558037bd..5f0ba177a 100644 --- a/test/multi/algorithms/multi_dissolve.cpp +++ b/test/multi/algorithms/multi_dissolve.cpp @@ -30,9 +30,8 @@ template void test_all() { - namespace bg = boost::geometry; - typedef bg::polygon

polygon; - typedef bg::multi_polygon multi_polygon; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon multi_polygon; test_one("three_triangles", "MULTIPOLYGON(((1 1,5 5,8 0,1 1)),((4 2,0 8,5 9,4 2)),((5 3,4 8,10 4,5 3)))" , @@ -63,7 +62,7 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_distance.cpp b/test/multi/algorithms/multi_distance.cpp index 8b0c51530..0e26e23f5 100644 --- a/test/multi/algorithms/multi_distance.cpp +++ b/test/multi/algorithms/multi_distance.cpp @@ -33,9 +33,9 @@ void test_distance(std::string const& wkt1, std::string const& wkt2, double expe { Geometry1 g1; Geometry2 g2; - boost::geometry::read_wkt(wkt1, g1); - boost::geometry::read_wkt(wkt2, g2); - double d = boost::geometry::distance(g1, g2); + bg::read_wkt(wkt1, g1); + bg::read_wkt(wkt2, g2); + double d = bg::distance(g1, g2); BOOST_CHECK_CLOSE(d, expected, 0.0001); } @@ -46,9 +46,9 @@ void test_distance(Strategy const& strategy, std::string const& wkt1, { Geometry1 g1; Geometry2 g2; - boost::geometry::read_wkt(wkt1, g1); - boost::geometry::read_wkt(wkt2, g2); - double d = boost::geometry::distance(g1, g2, strategy); + bg::read_wkt(wkt1, g1); + bg::read_wkt(wkt2, g2); + double d = bg::distance(g1, g2, strategy); BOOST_CHECK_CLOSE(d, expected, 0.0001); } @@ -57,8 +57,8 @@ void test_distance(Strategy const& strategy, std::string const& wkt1, template void test_2d() { - typedef boost::geometry::multi_point

mp; - typedef boost::geometry::multi_linestring > ml; + typedef bg::model::multi_point

mp; + typedef bg::model::multi_linestring > ml; test_distance("POINT(0 0)", "POINT(1 1)", sqrt(2.0)); test_distance("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); @@ -68,7 +68,7 @@ void test_2d() test_distance("MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", "MULTIPOINT((0 0),(1 1))", 0.0); // Test with a strategy - boost::geometry::strategy::distance::pythagoras pyth; + bg::strategy::distance::pythagoras pyth; test_distance(pyth, "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); test_distance(pyth, "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); test_distance(pyth, "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); @@ -78,7 +78,7 @@ void test_2d() template void test_3d() { - typedef boost::geometry::multi_point

mp; + typedef bg::model::multi_point

mp; test_distance("POINT(0 0 0)", "POINT(1 1 1)", sqrt(3.0)); test_distance("POINT(0 0 0)", "MULTIPOINT((1 1 1),(1 0 0),(0 1 2))", 1.0); test_distance("MULTIPOINT((1 1 1),(1 0 0),(0 0 2))", "MULTIPOINT((2 2 2),(2 3 4))", sqrt(3.0)); @@ -88,8 +88,8 @@ void test_3d() template void test_mixed() { - typedef boost::geometry::multi_point mp1; - typedef boost::geometry::multi_point mp2; + typedef bg::model::multi_point mp1; + typedef bg::model::multi_point mp2; test_distance("POINT(0 0)", "POINT(1 1)", sqrt(2.0)); @@ -108,7 +108,7 @@ void test_mixed() test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "MULTIPOINT((2 2),(2 3))", sqrt(2.0)); // Test with a strategy - using namespace boost::geometry::strategy::distance; + using namespace bg::strategy::distance; test_distance(pythagoras(), "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); @@ -129,13 +129,13 @@ void test_mixed() int test_main( int , char* [] ) { test_2d >(); - test_2d >(); - test_2d >(); + test_2d >(); + test_2d >(); test_3d >(); - test_3d >(); + test_3d >(); - test_mixed, boost::geometry::point_xy >(); + test_mixed, bg::model::point_xy >(); return 0; } diff --git a/test/multi/algorithms/multi_envelope.cpp b/test/multi/algorithms/multi_envelope.cpp index 8a72efe22..4061bd0b9 100644 --- a/test/multi/algorithms/multi_envelope.cpp +++ b/test/multi/algorithms/multi_envelope.cpp @@ -28,12 +28,12 @@ template void test_2d() { - /*test_envelope >( + /*test_envelope >( "MULTIPOINT((1 1),(1 0),(1 2))", 1, 1, 0, 2); - test_envelope > >( + test_envelope > >( "MULTILINESTRING((0 0,1 1),(1 1,2 2),(2 2,3 3))", 0, 3, 0, 3); */ - test_envelope > >( + test_envelope > >( "MULTIPOLYGON(((1 1,1 3,3 3,3 1,1 1)),((4 4,4 6,6 6,6 4,4 4)))", 1, 6, 1, 6); } @@ -41,18 +41,18 @@ void test_2d() template void test_3d() { - typedef boost::geometry::multi_point

mp; + typedef bg::model::multi_point

mp; } int test_main( int , char* [] ) { test_2d >(); - test_2d >(); - test_2d >(); + test_2d >(); + test_2d >(); test_3d >(); - test_3d >(); + test_3d >(); return 0; } diff --git a/test/multi/algorithms/multi_equals.cpp b/test/multi/algorithms/multi_equals.cpp index 6ff9415b2..4e3b83888 100644 --- a/test/multi/algorithms/multi_equals.cpp +++ b/test/multi/algorithms/multi_equals.cpp @@ -23,18 +23,18 @@ void test_all() std::string case1 = "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))"; std::string case1_p = "POLYGON((0 0,0 7,4 2,2 0,0 0))"; - typedef boost::geometry::polygon

polygon; - typedef boost::geometry::multi_polygon mp; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon mp; test_geometry("c1", case1, case1, true); - test_geometry("c2", + test_geometry("c2", "MULTIPOLYGON(((0 0,0 7.01,4 2,2 0,0 0)))", case1, false); // Different order == equal - test_geometry("c3", + test_geometry("c3", "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)),((10 10,10 12,12 10,10 10)))", - "MULTIPOLYGON(((10 10,10 12,12 10,10 10)),((0 0,0 7,4 2,2 0,0 0)))", + "MULTIPOLYGON(((10 10,10 12,12 10,10 10)),((0 0,0 7,4 2,2 0,0 0)))", true); // check different types @@ -45,7 +45,7 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_for_each.cpp b/test/multi/algorithms/multi_for_each.cpp index 368f289a7..135c9a472 100644 --- a/test/multi/algorithms/multi_for_each.cpp +++ b/test/multi/algorithms/multi_for_each.cpp @@ -28,7 +28,7 @@ template void test_all() { - test_geometry > + test_geometry > ( "MULTIPOINT((1 1))" @@ -42,7 +42,7 @@ void test_all() , "MULTIPOINT((1 1))" ); - test_geometry > > + test_geometry > > ( "MULTILINESTRING((1 1,2 2))" @@ -55,7 +55,7 @@ void test_all() , "MULTILINESTRING((10 1,2 2))" ); - typedef boost::geometry::multi_polygon > mp; + typedef bg::model::multi_polygon > mp; test_geometry ( "MULTIPOLYGON(((1 1,1 4,4 4,4 1,1 1)))" @@ -72,7 +72,7 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_intersection.cpp b/test/multi/algorithms/multi_intersection.cpp index adb2daaa3..11a1da1f4 100644 --- a/test/multi/algorithms/multi_intersection.cpp +++ b/test/multi/algorithms/multi_intersection.cpp @@ -104,7 +104,7 @@ void test_areal_clip() template void test_linear() { - typedef typename boost::geometry::point_type::type point; + typedef typename bg::point_type::type point; test_one("case_multi_ml_ml_1", "MULTILINESTRING((0 0,1 1))", "MULTILINESTRING((0 1,1 0))", 1, 1, 0); @@ -116,14 +116,14 @@ void test_linear() "LINESTRING(0 0,1 1)", "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", 2, 2, 0); test_one("case_multi_ml_l", - "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", "LINESTRING(0 0,1 1)", + "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", "LINESTRING(0 0,1 1)", 2, 2, 0); test_one("case_multi_ml_b", "MULTILINESTRING((0 0,3 3)(1 0,4 3))", "POLYGON((1 1,3 2))", 2, 4, 2 * std::sqrt(2.0)); test_one("case_multi_b_ml", - "POLYGON((1 1,3 2))", "MULTILINESTRING((0 0,3 3)(1 0,4 3))", + "POLYGON((1 1,3 2))", "MULTILINESTRING((0 0,3 3)(1 0,4 3))", 2, 4, 2 * std::sqrt(2.0)); } @@ -131,26 +131,23 @@ void test_linear() template void test_all() { - namespace bg = boost::geometry; - - - typedef bg::box

box; - typedef bg::linear_ring

ring; - typedef bg::polygon

polygon; - typedef bg::multi_polygon multi_polygon; + typedef bg::model::box

box; + typedef bg::model::linear_ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon multi_polygon; test_areal(); return; - typedef bg::linear_ring ring_ccw; - typedef bg::polygon polygon_ccw; - typedef bg::multi_polygon multi_polygon_ccw; + typedef bg::model::linear_ring ring_ccw; + typedef bg::model::polygon polygon_ccw; + typedef bg::model::multi_polygon multi_polygon_ccw; test_areal(); test_areal_clip(); test_areal_clip(); - typedef bg::linestring

linestring; - typedef bg::multi_linestring multi_linestring; + typedef bg::model::linestring

linestring; + typedef bg::model::multi_linestring multi_linestring; test_linear(); @@ -162,7 +159,7 @@ return; int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_length.cpp b/test/multi/algorithms/multi_length.cpp index fef954b2e..7d0e20177 100644 --- a/test/multi/algorithms/multi_length.cpp +++ b/test/multi/algorithms/multi_length.cpp @@ -19,13 +19,13 @@ template void test_all() { - test_geometry > > + test_geometry > > ("MULTILINESTRING((0 0,3 4,4 3))", 5 + sqrt(2.0)); } int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_perimeter.cpp b/test/multi/algorithms/multi_perimeter.cpp index 2b8c908db..6abb51853 100644 --- a/test/multi/algorithms/multi_perimeter.cpp +++ b/test/multi/algorithms/multi_perimeter.cpp @@ -21,13 +21,13 @@ template void test_all() { - test_geometry > >( + test_geometry > >( "MULTIPOLYGON(((0 0,0 1,1 0,0 0)))", 1.0 + 1.0 + sqrt(2.0)); } int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_reverse.cpp b/test/multi/algorithms/multi_reverse.cpp index 81bbc3675..06abcdd96 100644 --- a/test/multi/algorithms/multi_reverse.cpp +++ b/test/multi/algorithms/multi_reverse.cpp @@ -25,15 +25,15 @@ template void test_all() { // Multi point, should happen nothing. - test_geometry >( + test_geometry >( "MULTIPOINT((0 0),(1 1))", "MULTIPOINT((0 0),(1 1))"); - test_geometry > >( + test_geometry > >( "MULTILINESTRING((0 0,1 1),(3 3,4 4))", "MULTILINESTRING((1 1,0 0),(4 4,3 3))"); - typedef boost::geometry::multi_polygon > mp; + typedef bg::model::multi_polygon > mp; test_geometry( "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))", "MULTIPOLYGON(((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0)))"); @@ -44,8 +44,8 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_simplify.cpp b/test/multi/algorithms/multi_simplify.cpp index a811131f4..daeabc222 100644 --- a/test/multi/algorithms/multi_simplify.cpp +++ b/test/multi/algorithms/multi_simplify.cpp @@ -27,15 +27,15 @@ template void test_all() { - test_geometry >( + test_geometry >( "MULTIPOINT((0 0),(1 1))", "MULTIPOINT((0 0),(1 1))", 1.0); - test_geometry > >( + test_geometry > >( "MULTILINESTRING((0 0,5 5,10 10))", "MULTILINESTRING((0 0,10 10))", 1.0); - typedef boost::geometry::multi_polygon > mp; + typedef bg::model::multi_polygon > mp; test_geometry( "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))", "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0)))", 1.0); @@ -46,7 +46,7 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_union.cpp b/test/multi/algorithms/multi_union.cpp index 966f2dc96..6e64d379e 100644 --- a/test/multi/algorithms/multi_union.cpp +++ b/test/multi/algorithms/multi_union.cpp @@ -107,19 +107,18 @@ void test_areal() template void test_all() { - namespace bg = boost::geometry; { - typedef bg::linear_ring

ring; - typedef bg::polygon

polygon; - typedef bg::multi_polygon multi_polygon; + typedef bg::model::linear_ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon multi_polygon; test_areal(); } { - typedef bg::linear_ring ring_ccw; - typedef bg::polygon polygon_ccw; - typedef bg::multi_polygon multi_polygon_ccw; + typedef bg::model::linear_ring ring_ccw; + typedef bg::model::polygon polygon_ccw; + typedef bg::model::multi_polygon multi_polygon_ccw; // TODO: ccw has issues with multi-touch //test_areal(); } @@ -129,7 +128,7 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_unique.cpp b/test/multi/algorithms/multi_unique.cpp index 59f8f8e7b..d77880a79 100644 --- a/test/multi/algorithms/multi_unique.cpp +++ b/test/multi/algorithms/multi_unique.cpp @@ -25,15 +25,15 @@ template void test_all() { // Multi point, should happen nothing, even if there are duplicate points - test_geometry >( + test_geometry >( "MULTIPOINT((0 0),(0 0),(1 1))", "MULTIPOINT((0 0),(0 0),(1 1))"); - test_geometry > >( + test_geometry > >( "MULTILINESTRING((0 0,1 1,1 1),(3 3,3 3,4 4))", "MULTILINESTRING((0 0,1 1),(3 3,4 4))"); - typedef boost::geometry::multi_polygon > mp; + typedef bg::model::multi_polygon > mp; test_geometry( "MULTIPOLYGON(((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0)))", "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))"); @@ -47,8 +47,8 @@ void test_all() int test_main( int , char* [] ) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/multi/algorithms/multi_within.cpp b/test/multi/algorithms/multi_within.cpp index c9f8660f6..1b045ad77 100644 --- a/test/multi/algorithms/multi_within.cpp +++ b/test/multi/algorithms/multi_within.cpp @@ -25,7 +25,7 @@ template void test_all() { - typedef boost::geometry::multi_polygon > mp; + typedef bg::model::multi_polygon > mp; // trivial cases test_geometry("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true); @@ -41,14 +41,11 @@ void test_all() int test_main( int , char* [] ) { - //test_all >(); - test_all >(); + //test_all >(); + test_all >(); -#if defined(HAVE_CLN) - test_all >(); -#endif -#if defined(HAVE_GMP) - test_all >(); +#if defined(HAVE_TTMATH) + test_all >(); #endif return 0; diff --git a/test/multi/algorithms/overlay/multi_overlay_common.hpp b/test/multi/algorithms/overlay/multi_overlay_common.hpp index 312436c60..631d10afb 100644 --- a/test/multi/algorithms/overlay/multi_overlay_common.hpp +++ b/test/multi/algorithms/overlay/multi_overlay_common.hpp @@ -25,8 +25,8 @@ void test_all(std::vector const& expected, double precision = 0.01) typename boost::range_const_iterator >::type iterator = boost::begin(expected); - typedef boost::geometry::multi_polygon > mp; - typedef boost::geometry::box

box; + typedef bg::model::multi_polygon > mp; + typedef bg::model::box

box; BOOST_ASSERT(iterator != boost::end(expected)); test_overlay("1", *iterator, diff --git a/test/multi/algorithms/overlay/multi_svg_mapper.hpp b/test/multi/algorithms/overlay/multi_svg_mapper.hpp index 206f4ea43..16b31251b 100644 --- a/test/multi/algorithms/overlay/multi_svg_mapper.hpp +++ b/test/multi/algorithms/overlay/multi_svg_mapper.hpp @@ -24,7 +24,7 @@ namespace dispatch template -struct svg_map +struct svg_map { template static inline void apply(std::ostream& stream, @@ -32,9 +32,9 @@ struct svg_map MultiPolygon const& multi_polygon, TransformStrategy const& strategy) { - boost::geometry::multi_polygon > > impoly; - boost::geometry::transform(multi_polygon, impoly, strategy); - stream << boost::geometry::svg(impoly, style, size) << std::endl; + bg::model::multi_polygon > > impoly; + bg::transform(multi_polygon, impoly, strategy); + stream << bg::svg(impoly, style, size) << std::endl; } }; diff --git a/test/multi/algorithms/overlay/multi_traverse.cpp b/test/multi/algorithms/overlay/multi_traverse.cpp index 594534a79..d4ecd84c7 100644 --- a/test/multi/algorithms/overlay/multi_traverse.cpp +++ b/test/multi/algorithms/overlay/multi_traverse.cpp @@ -46,14 +46,13 @@ template void test_all() { //goto wrong; - namespace bg = boost::geometry; - namespace ov = boost::geometry::detail::overlay; + namespace ov = bg::detail::overlay; - typedef bg::multi_polygon + typedef bg::model::multi_polygon < - bg::polygon + bg::model::polygon < - bg::point + bg::model::point > > multi_polygon; @@ -426,7 +425,7 @@ void test_all() "case_106_multi", boost::make_tuple(1, 25), case_106_multi[0], case_106_multi[1] ); - + test_overlay, Tuple> diff --git a/test/point_concept/concept_checker.cpp b/test/point_concept/concept_checker.cpp index 01cdcd13e..587bf43e1 100644 --- a/test/point_concept/concept_checker.cpp +++ b/test/point_concept/concept_checker.cpp @@ -26,7 +26,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -44,7 +44,7 @@ template <> struct access template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -60,7 +60,7 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() diff --git a/test/point_concept/function_asserting_a_point.hpp b/test/point_concept/function_asserting_a_point.hpp index d82183c4f..1e335c42e 100644 --- a/test/point_concept/function_asserting_a_point.hpp +++ b/test/point_concept/function_asserting_a_point.hpp @@ -13,15 +13,17 @@ #include +namespace bg = boost::geometry; + namespace test { template void function_asserting_a_point(P& p1, const CP& p2) { - BOOST_CONCEPT_ASSERT((boost::geometry::concept::Point

)); - BOOST_CONCEPT_ASSERT((boost::geometry::concept::ConstPoint

)); + BOOST_CONCEPT_ASSERT((bg::concept::Point

)); + BOOST_CONCEPT_ASSERT((bg::concept::ConstPoint

)); - get<0>(p1) = get<0>(p2); + bg::get<0>(p1) = bg::get<0>(p2); } } diff --git a/test/point_concept/function_requiring_a_point.hpp b/test/point_concept/function_requiring_a_point.hpp index a1a7cb632..64700f3a6 100644 --- a/test/point_concept/function_requiring_a_point.hpp +++ b/test/point_concept/function_requiring_a_point.hpp @@ -13,17 +13,19 @@ #include +namespace bg = boost::geometry; + namespace test { template inline BOOST_CONCEPT_REQUIRES( - ((boost::geometry::concept::Point

)) - ((boost::geometry::concept::ConstPoint)), + ((bg::concept::Point

)) + ((bg::concept::ConstPoint)), (void)) function_requiring_a_point(P& p1, const C& p2) { - boost::geometry::set<0>(p1, boost::geometry::get<0>(p2)); + bg::set<0>(p1, bg::get<0>(p2)); } } diff --git a/test/point_concept/point_with_incorrect_dimension.cpp b/test/point_concept/point_with_incorrect_dimension.cpp index e7531d74d..43d050d28 100644 --- a/test/point_concept/point_with_incorrect_dimension.cpp +++ b/test/point_concept/point_with_incorrect_dimension.cpp @@ -23,7 +23,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; template <> struct dimension { enum { value = 3 }; }; template <> struct access @@ -39,7 +39,7 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() diff --git a/test/point_concept/point_without_coordinate_type.cpp b/test/point_concept/point_without_coordinate_type.cpp index 2fe685b4c..daf5fd855 100644 --- a/test/point_concept/point_without_coordinate_type.cpp +++ b/test/point_concept/point_without_coordinate_type.cpp @@ -20,7 +20,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; //template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -36,7 +36,7 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() { diff --git a/test/point_concept/point_without_dimension.cpp b/test/point_concept/point_without_dimension.cpp index fac035d47..083b03ccc 100644 --- a/test/point_concept/point_without_dimension.cpp +++ b/test/point_concept/point_without_dimension.cpp @@ -21,7 +21,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; //template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -37,7 +37,7 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() diff --git a/test/point_concept/point_without_getter.cpp b/test/point_concept/point_without_getter.cpp index 344e6fa18..9bf8a0957 100644 --- a/test/point_concept/point_without_getter.cpp +++ b/test/point_concept/point_without_getter.cpp @@ -20,7 +20,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -34,7 +34,7 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() { diff --git a/test/point_concept/point_without_setter.cpp b/test/point_concept/point_without_setter.cpp index 01b250a63..b729cf78f 100644 --- a/test/point_concept/point_without_setter.cpp +++ b/test/point_concept/point_without_setter.cpp @@ -20,7 +20,7 @@ namespace boost { namespace geometry { namespace traits { template <> struct tag { typedef point_tag type; }; template <> struct coordinate_type { typedef float type; }; -template <> struct coordinate_system { typedef boost::geometry::cs::cartesian type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; template <> struct dimension { enum { value = 2 }; }; template <> struct access @@ -34,7 +34,7 @@ template <> struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() { diff --git a/test/point_concept/well_formed_point_traits.cpp b/test/point_concept/well_formed_point_traits.cpp index 5f2b05933..2a3942da8 100644 --- a/test/point_concept/well_formed_point_traits.cpp +++ b/test/point_concept/well_formed_point_traits.cpp @@ -33,7 +33,7 @@ struct coordinate_type template <> struct coordinate_system { - typedef boost::geometry::cs::cartesian type; + typedef bg::cs::cartesian type; }; template <> @@ -71,7 +71,7 @@ struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits int main() { diff --git a/test/policies/compare.cpp b/test/policies/compare.cpp index 304dd8db2..7e8d319c2 100644 --- a/test/policies/compare.cpp +++ b/test/policies/compare.cpp @@ -32,7 +32,7 @@ inline std::string coordinates(Container const& points) it != boost::end(points); ++it) { - out << boost::geometry::dsv(*it); + out << bg::dsv(*it); } return out.str(); } @@ -40,17 +40,17 @@ inline std::string coordinates(Container const& points) template void test_2d_compare() { - P p1 = boost::geometry::make

(3, 1); - P p2 = boost::geometry::make

(3, 1); - P p3 = boost::geometry::make

(1, 3); - P p4 = boost::geometry::make

(5, 2); - P p5 = boost::geometry::make

(3, 2); + P p1 = bg::make

(3, 1); + P p2 = bg::make

(3, 1); + P p3 = bg::make

(1, 3); + P p4 = bg::make

(5, 2); + P p5 = bg::make

(3, 2); // Test in all dimensions { - boost::geometry::equal_to

et; - boost::geometry::less

lt; - boost::geometry::greater

gt; + bg::equal_to

et; + bg::less

lt; + bg::greater

gt; BOOST_CHECK_EQUAL(et(p1, p2), true); BOOST_CHECK_EQUAL(et(p1, p3), false); @@ -74,9 +74,9 @@ void test_2d_compare() // Test in dimension 0, X { - boost::geometry::equal_to et; - boost::geometry::less lt; - boost::geometry::greater gt; + bg::equal_to et; + bg::less lt; + bg::greater gt; BOOST_CHECK_EQUAL(et(p1, p2), true); BOOST_CHECK_EQUAL(et(p1, p3), false); @@ -99,9 +99,9 @@ void test_2d_compare() // Test in dimension 1, Y { - boost::geometry::equal_to et; - boost::geometry::less lt; - boost::geometry::greater gt; + bg::equal_to et; + bg::less lt; + bg::greater gt; BOOST_CHECK_EQUAL(et(p1, p2), true); BOOST_CHECK_EQUAL(et(p1, p3), false); @@ -127,69 +127,69 @@ void test_2d_compare() template void test_2d_sort() { - typedef typename boost::geometry::coordinate_type

::type ct; + typedef typename bg::coordinate_type

::type ct; std::vector

v; - v.push_back(boost::geometry::make

(3, 1)); - v.push_back(boost::geometry::make

(2, 3)); - v.push_back(boost::geometry::make

(2, 2)); - v.push_back(boost::geometry::make

(1, 3)); + v.push_back(bg::make

(3, 1)); + v.push_back(bg::make

(2, 3)); + v.push_back(bg::make

(2, 2)); + v.push_back(bg::make

(1, 3)); // Sort on coordinates in order x,y,z - std::sort(v.begin(), v.end(), boost::geometry::less

()); + std::sort(v.begin(), v.end(), bg::less

()); std::string s = coordinates(v); BOOST_CHECK_EQUAL(s, "(1, 3)(2, 2)(2, 3)(3, 1)"); // Reverse sort - std::sort(v.begin(), v.end(), boost::geometry::greater

()); + std::sort(v.begin(), v.end(), bg::greater

()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(3, 1)(2, 3)(2, 2)(1, 3)"); // Sort backwards on coordinates in order x,y,z - //std::sort(v.begin(), v.end(), boost::geometry::greater

()); + //std::sort(v.begin(), v.end(), bg::greater

()); //std::string s = coordinates(v); //BOOST_CHECK_EQUAL(s, "(1, 3)(2, 2)(2, 3)(3, 1)"); // Refill to remove duplicate coordinates v.clear(); - v.push_back(boost::geometry::make

(4, 1)); - v.push_back(boost::geometry::make

(3, 2)); - v.push_back(boost::geometry::make

(2, 3)); - v.push_back(boost::geometry::make

(1, 4)); + v.push_back(bg::make

(4, 1)); + v.push_back(bg::make

(3, 2)); + v.push_back(bg::make

(2, 3)); + v.push_back(bg::make

(1, 4)); // Sort ascending on only x-coordinate - std::sort(v.begin(), v.end(), boost::geometry::less()); + std::sort(v.begin(), v.end(), bg::less()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(1, 4)(2, 3)(3, 2)(4, 1)"); // Sort ascending on only y-coordinate - std::sort(v.begin(), v.end(), boost::geometry::less()); + std::sort(v.begin(), v.end(), bg::less()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(4, 1)(3, 2)(2, 3)(1, 4)"); // Sort descending on only x-coordinate - std::sort(v.begin(), v.end(), boost::geometry::greater()); + std::sort(v.begin(), v.end(), bg::greater()); s = coordinates(v); //BOOST_CHECK_EQUAL(s, "(4, 1)(3, 2)(2, 3)(1, 4)"); // Sort descending on only y-coordinate - std::sort(v.begin(), v.end(), boost::geometry::greater()); + std::sort(v.begin(), v.end(), bg::greater()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(1, 4)(2, 3)(3, 2)(4, 1)"); // Make non-unique vector - v.push_back(boost::geometry::make

(4, 1)); - v.push_back(boost::geometry::make

(3, 2)); - v.push_back(boost::geometry::make

(2, 3)); - v.push_back(boost::geometry::make

(1, 4)); - v.push_back(boost::geometry::make

(1, 5)); - std::sort(v.begin(), v.end(), boost::geometry::less

()); + v.push_back(bg::make

(4, 1)); + v.push_back(bg::make

(3, 2)); + v.push_back(bg::make

(2, 3)); + v.push_back(bg::make

(1, 4)); + v.push_back(bg::make

(1, 5)); + std::sort(v.begin(), v.end(), bg::less

()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(1, 4)(1, 4)(1, 5)(2, 3)(2, 3)(3, 2)(3, 2)(4, 1)(4, 1)"); std::vector

v2; - std::unique_copy(v.begin(), v.end(), std::back_inserter(v2), boost::geometry::equal_to

()); + std::unique_copy(v.begin(), v.end(), std::back_inserter(v2), bg::equal_to

()); s = coordinates(v2); BOOST_CHECK_EQUAL(s, "(1, 4)(1, 5)(2, 3)(3, 2)(4, 1)"); } @@ -198,27 +198,27 @@ void test_2d_sort() template void test_spherical() { - typedef typename boost::geometry::coordinate_type

::type ct; + typedef typename bg::coordinate_type

::type ct; std::vector

v; - v.push_back(boost::geometry::make

( 179.73, 71.56)); // east - v.push_back(boost::geometry::make

( 177.47, 71.23)); // less east - v.push_back(boost::geometry::make

(-178.78, 70.78)); // further east, = west, this is the most right point + v.push_back(bg::make

( 179.73, 71.56)); // east + v.push_back(bg::make

( 177.47, 71.23)); // less east + v.push_back(bg::make

(-178.78, 70.78)); // further east, = west, this is the most right point // Sort on coordinates in order x,y,z - std::sort(v.begin(), v.end(), boost::geometry::less

()); + std::sort(v.begin(), v.end(), bg::less

()); std::string s = coordinates(v); BOOST_CHECK_EQUAL(s, "(177.47, 71.23)(179.73, 71.56)(-178.78, 70.78)"); // Sort ascending on only x-coordinate - std::sort(v.begin(), v.end(), boost::geometry::less()); + std::sort(v.begin(), v.end(), bg::less()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(177.47, 71.23)(179.73, 71.56)(-178.78, 70.78)"); // Sort ascending on only x-coordinate, but override with std-comparison, // (so this is the normal sorting behaviour that would have been used // if it would not have been spherical) - std::sort(v.begin(), v.end(), boost::geometry::less >()); + std::sort(v.begin(), v.end(), bg::less >()); s = coordinates(v); BOOST_CHECK_EQUAL(s, "(-178.78, 70.78)(177.47, 71.23)(179.73, 71.56)"); } @@ -226,15 +226,15 @@ void test_spherical() int test_main(int, char* []) { - test_2d_compare >(); - test_2d_compare >(); + test_2d_compare >(); + test_2d_compare >(); - test_2d_sort >(); - test_2d_sort >(); + test_2d_sort >(); + test_2d_sort >(); test_2d_sort >(); - test_2d_sort >(); + test_2d_sort >(); - test_spherical > >(); + test_spherical > >(); return 0; } diff --git a/test/ranges/box_range.cpp b/test/ranges/box_range.cpp index 59d47e803..377a3084b 100644 --- a/test/ranges/box_range.cpp +++ b/test/ranges/box_range.cpp @@ -21,7 +21,6 @@ template void test_geometry(std::string const& wkt, std::string const& expected) { - namespace bg = boost::geometry; Box box; bg::read_wkt(wkt, box); @@ -34,7 +33,7 @@ void test_geometry(std::string const& wkt, std::string const& expected) for (typename boost::range_iterator::type it = boost::begin(range); it != boost::end(range); ++it) { - out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it); + out << " " << bg::get<0>(*it) << bg::get<1>(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -58,13 +57,13 @@ void test_geometry(std::string const& wkt, std::string const& expected) template void test_all() { - test_geometry >("polygon((1 1,2 2))", " 11 12 22 21 11"); - test_geometry >("polygon((3 3,5 5))", " 33 35 55 53 33"); + test_geometry >("polygon((1 1,2 2))", " 11 12 22 21 11"); + test_geometry >("polygon((3 3,5 5))", " 33 35 55 53 33"); } int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/ranges/segment_range.cpp b/test/ranges/segment_range.cpp index 7285b702f..2b83d5b8c 100644 --- a/test/ranges/segment_range.cpp +++ b/test/ranges/segment_range.cpp @@ -22,7 +22,6 @@ template void test_geometry(std::string const& wkt, std::string const& expected) { - namespace bg = boost::geometry; Segment segment; bg::read_wkt(wkt, segment); @@ -32,10 +31,10 @@ void test_geometry(std::string const& wkt, std::string const& expected) { std::ostringstream out; - for (typename boost::range_iterator::type it = boost::begin(range); + for (typename boost::range_iterator::type it = boost::begin(range); it != boost::end(range); ++it) { - out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it); + out << " " << bg::get<0>(*it) << bg::get<1>(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -43,13 +42,13 @@ void test_geometry(std::string const& wkt, std::string const& expected) { // Check forward/backward behaviour std::ostringstream out; - typename boost::range_iterator::type it = boost::begin(range); + typename boost::range_iterator::type it = boost::begin(range); it++; it--; - out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it); + out << " " << bg::get<0>(*it) << bg::get<1>(*it); typename boost::range_iterator::type it2 = boost::end(range); it2--; - out << " " << boost::geometry::get<0>(*it2) << boost::geometry::get<1>(*it2); + out << " " << bg::get<0>(*it2) << bg::get<1>(*it2); BOOST_CHECK_EQUAL(out.str(), expected); } @@ -71,6 +70,6 @@ void test_all() int test_main(int, char* []) { - test_all(); + test_all(); return 0; } diff --git a/test/strategies/cross_track.cpp b/test/strategies/cross_track.cpp index a216239f7..d61eeb2d7 100644 --- a/test/strategies/cross_track.cpp +++ b/test/strategies/cross_track.cpp @@ -31,7 +31,7 @@ void test_distance(double lon1, double lat1, double lon3, double lat3, double radius, double expected, double tolerance) { - typedef boost::geometry::strategy::distance::cross_track + typedef bg::strategy::distance::cross_track < Point, Point @@ -42,16 +42,16 @@ void test_distance(double lon1, double lat1, BOOST_CONCEPT_ASSERT ( - (boost::geometry::concept::PointSegmentDistanceStrategy) + (bg::concept::PointSegmentDistanceStrategy) ); strategy_type strategy(radius); Point p1, p2, p3; - boost::geometry::assign(p1, lon1, lat1); - boost::geometry::assign(p2, lon2, lat2); - boost::geometry::assign(p3, lon3, lat3); + bg::assign(p1, lon1, lat1); + bg::assign(p2, lon2, lat2); + bg::assign(p3, lon3, lat3); return_type d = strategy.apply(p1, p2, p3); BOOST_CHECK_CLOSE(d, return_type(expected), tolerance); @@ -73,11 +73,11 @@ void test_all() int test_main(int, char* []) { - test_all > >(); + test_all > >(); #if defined(HAVE_TTMATH) typedef ttmath::Big<1,4> tt; - test_all > >(); + test_all > >(); #endif diff --git a/test/strategies/haversine.cpp b/test/strategies/haversine.cpp index ee778aef6..8f4ee55db 100644 --- a/test/strategies/haversine.cpp +++ b/test/strategies/haversine.cpp @@ -23,7 +23,6 @@ # include #endif -namespace bg = boost::geometry; double const average_earth_radius = 6372795.0; @@ -38,7 +37,7 @@ struct test_distance Point > haversine_type; - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::PointDistanceStrategy) ); + BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy) ); typedef typename bg::strategy::distance::services::return_type::type return_type; @@ -131,7 +130,7 @@ void test_services() // 3: "comparable" to construct a "comparable strategy" for P1/P2 - // a "comparable strategy" is a strategy which does not calculate the exact distance, but + // a "comparable strategy" is a strategy which does not calculate the exact distance, but // which returns results which can be mutually compared (e.g. avoid sqrt) // 3a: "comparable_type" @@ -148,7 +147,7 @@ void test_services() // And that one should be equa. BOOST_CHECK_CLOSE(c_result, return_type(c_expected), 0.001); - // 4: the comparable_type should have a distance_strategy_constructor as well, + // 4: the comparable_type should have a distance_strategy_constructor as well, // knowing how to compare something with a fixed distance return_type c_dist_lower = services::result_from_distance::apply(comparable, expected_lower); return_type c_dist_higher = services::result_from_distance::apply(comparable, expected_higher); @@ -239,26 +238,25 @@ double time_normal(int n) int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all > >(); - test_all > >(); - test_all > >(); + test_all > >(); + test_all > >(); + test_all > >(); //double t1 = time_sqrt(20000); //double t2 = time_normal(20000); //std::cout << "Factor: " << (t1 / t2) << std::endl; - //time_compare > >(10000); + //time_compare > >(10000); #if defined(HAVE_TTMATH) typedef ttmath::Big<1,4> tt; - test_all > >(); + test_all > >(); #endif test_services < - bg::point >, - bg::point >, + bg::model::point >, + bg::model::point >, double >(); diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index ad64969af..c6f3c81ed 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -24,7 +24,6 @@ # include #endif -namespace bg = boost::geometry; template @@ -37,7 +36,7 @@ void test_services() P p; bg::assign(p, 2, 0); - CalculationType const sqr_expected = 4; + CalculationType const sqr_expected = 4; CalculationType const expected = 2; @@ -66,7 +65,7 @@ void test_services() // 3: "comparable" to construct a "comparable strategy" for P1/P2 - // a "comparable strategy" is a strategy which does not calculate the exact distance, but + // a "comparable strategy" is a strategy which does not calculate the exact distance, but // which returns results which can be mutually compared (e.g. avoid sqrt) // 3a: "comparable_type" @@ -111,38 +110,41 @@ void test_all_2d() template void test_all_2d() { - using bg::point; - using bg::cs::cartesian; - //test_all_2d(); //test_all_2d(); //test_all_2d(); //test_all_2d(); - test_all_2d >(); - test_all_2d >(); - test_all_2d >(); - test_all_2d >(); + test_all_2d >(); + test_all_2d >(); + test_all_2d >(); + test_all_2d >(); } int test_main(int, char* []) { - using bg::point; - using bg::cs::cartesian; - test_all_2d(); test_all_2d(); test_all_2d(); //test_all_2d(); - test_all_2d >(); - test_all_2d >(); - test_all_2d >(); + test_all_2d >(); + test_all_2d >(); + test_all_2d >(); - test_services, point, long double>(); + test_services + < + bg::model::point, + bg::model::point, + long double + >(); #if defined(HAVE_TTMATH) - test_all_2d, point >(); + test_all_2d + < + bg::model::point, + bg::model::point + >(); #endif return 0; diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index fbf2e91b4..e736c7dad 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -34,7 +34,6 @@ #endif -namespace bg = boost::geometry; template void test_null_distance_3d() @@ -109,8 +108,8 @@ void test_arbitrary_3d() template void test_services() { - namespace bgsd = boost::geometry::strategy::distance; - namespace services = boost::geometry::strategy::distance::services; + namespace bgsd = bg::strategy::distance; + namespace services = bg::strategy::distance::services; { @@ -132,7 +131,7 @@ void test_services() typedef bgsd::pythagoras strategy_type; - BOOST_CONCEPT_ASSERT( (boost::geometry::concept::PointDistanceStrategy) ); + BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy) ); typedef typename bgsd::services::return_type::type return_type; @@ -152,7 +151,7 @@ void test_services() // 3: "comparable" to construct a "comparable strategy" for P1/P2 - // a "comparable strategy" is a strategy which does not calculate the exact distance, but + // a "comparable strategy" is a strategy which does not calculate the exact distance, but // which returns results which can be mutually compared (e.g. avoid sqrt) // 3a: "comparable_type" @@ -164,7 +163,7 @@ void test_services() return_type c_result = comparable.apply(p1, p2); BOOST_CHECK_CLOSE(c_result, return_type(sqr_expected), 0.001); - // 4: the comparable_type should have a distance_strategy_constructor as well, + // 4: the comparable_type should have a distance_strategy_constructor as well, // knowing how to compare something with a fixed distance return_type c_dist5 = services::result_from_distance::apply(comparable, 5.0); return_type c_dist6 = services::result_from_distance::apply(comparable, 6.0); @@ -183,7 +182,7 @@ template point_type; + typedef bg::model::point point_type; typedef bg::strategy::distance::pythagoras < point_type, @@ -239,16 +238,13 @@ void test_all_3d() template void test_all_3d() { - using bg::point; - using bg::cs::cartesian; - test_all_3d(); test_all_3d(); test_all_3d(); test_all_3d(); - test_all_3d >(); - test_all_3d >(); - test_all_3d >(); + test_all_3d >(); + test_all_3d >(); + test_all_3d >(); } template @@ -280,34 +276,31 @@ void time_compare(int const n) int test_main(int, char* []) { - using bg::point; - using bg::cs::cartesian; - test_all_3d(); test_all_3d(); test_all_3d(); test_all_3d(); - test_all_3d >(); - test_all_3d >(); - test_all_3d >(); + test_all_3d >(); + test_all_3d >(); + test_all_3d >(); test_big_2d(); test_big_2d(); test_big_2d(); test_big_2d(); - test_services, double[3], long double>(); + test_services, double[3], long double>(); test_services(); - time_compare >(10000); + time_compare >(10000); #if defined(HAVE_TTMATH) typedef ttmath::Big<1,4> tt; - typedef point tt_point; + typedef bg::model::point tt_point; //test_all_3d(); test_all_3d(); diff --git a/test/strategies/segment_intersection.cpp b/test/strategies/segment_intersection.cpp index 369a0dcc9..b35d95cb4 100644 --- a/test/strategies/segment_intersection.cpp +++ b/test/strategies/segment_intersection.cpp @@ -43,14 +43,14 @@ void print_is(R const& is) for (int i = 0; i < is.count; i++) { std::cout - << " (" << boost::geometry::get<0>(is.intersections[i]) - << "," << boost::geometry::get<1>(is.intersections[i]) + << " (" << bg::get<0>(is.intersections[i]) + << "," << bg::get<1>(is.intersections[i]) << ")"; } #endif } /* -void print_im(boost::geometry::de9im const& im) +void print_im(bg::de9im const& im) { #ifdef REPORT if (im.equals()) std::cout << " EQUALS"; @@ -83,14 +83,14 @@ static void test_segment_intersection(int caseno, std::cout << "CASE " << caseno << std::endl; #endif - typedef typename boost::geometry::coordinate_type

::type coordinate_type; + typedef typename bg::coordinate_type

::type coordinate_type; typedef segment segment_type; P p1, p2, p3, p4; - boost::geometry::assign(p1, x1, y1); - boost::geometry::assign(p2, x2, y2); - boost::geometry::assign(p3, x3, y3); - boost::geometry::assign(p4, x4, y4); + bg::assign(p1, x1, y1); + bg::assign(p2, x2, y2); + bg::assign(p3, x3, y3); + bg::assign(p4, x4, y4); segment_type s12(p1,p2); segment_type s34(p3,p4); @@ -130,9 +130,9 @@ static void test_segment_intersection(int caseno, expected_count++; BOOST_CHECK(is.count >= 1); - BOOST_CHECK_CLOSE(boost::geometry::get<0>(is.intersections[0]), + BOOST_CHECK_CLOSE(bg::get<0>(is.intersections[0]), coordinate_type(expected_x1), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(is.intersections[0]), + BOOST_CHECK_CLOSE(bg::get<1>(is.intersections[0]), coordinate_type(expected_y1), 0.001); } if (expected_x2 != -99 && expected_y2 != -99) @@ -140,9 +140,9 @@ static void test_segment_intersection(int caseno, expected_count++; BOOST_CHECK(is.count >= 2); - BOOST_CHECK_CLOSE(boost::geometry::get<0>(is.intersections[1]), + BOOST_CHECK_CLOSE(bg::get<0>(is.intersections[1]), coordinate_type(expected_x2), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(is.intersections[1]), + BOOST_CHECK_CLOSE(bg::get<1>(is.intersections[1]), coordinate_type(expected_y2), 0.001); } BOOST_CHECK_EQUAL(is.count, expected_count); @@ -213,7 +213,7 @@ static void test_segment_intersection(int caseno, // Now use generic intersection. std::vector

out; - boost::geometry::intersection_inserter

(s12, s34, std::back_inserter(out)); + bg::intersection_inserter

(s12, s34, std::back_inserter(out)); BOOST_CHECK_EQUAL(boost::size(out), expected_count); @@ -221,18 +221,18 @@ static void test_segment_intersection(int caseno, && is.count >= 1 && boost::size(out) >= 1) { - BOOST_CHECK_CLOSE(boost::geometry::get<0>(out[0]), + BOOST_CHECK_CLOSE(bg::get<0>(out[0]), coordinate_type(expected_x1), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(out[0]), + BOOST_CHECK_CLOSE(bg::get<1>(out[0]), coordinate_type(expected_y1), 0.001); } if (expected_x2 != -99 && expected_y2 != -99 && is.count >= 2 && boost::size(out) >= 2) { - BOOST_CHECK_CLOSE(boost::geometry::get<0>(out[1]), + BOOST_CHECK_CLOSE(bg::get<0>(out[1]), coordinate_type(expected_x2), 0.001); - BOOST_CHECK_CLOSE(boost::geometry::get<1>(out[1]), + BOOST_CHECK_CLOSE(bg::get<1>(out[1]), coordinate_type(expected_y2), 0.001); } } @@ -361,7 +361,7 @@ int test_main(int, char* []) { std::cout << "Note this test is out-of-date and either obsolete or should be updated" << std::endl; test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/strategies/segment_intersection_collinear.cpp b/test/strategies/segment_intersection_collinear.cpp index d0793fa4c..da06b248f 100644 --- a/test/strategies/segment_intersection_collinear.cpp +++ b/test/strategies/segment_intersection_collinear.cpp @@ -29,7 +29,6 @@ template static int check(IntersectionPoints const& is, std::size_t index, double expected_x, double expected_y) { - namespace bg = boost::geometry; if (expected_x != -99 && expected_y != -99 && is.count > index) { double x = bg::get<0>(is.intersections[index]); @@ -53,7 +52,6 @@ static void test_segment_intersection(std::string const& case_id, int expected_x2 = -99, int expected_y2 = -99) { - namespace bg = boost::geometry; //#ifdef REPORT std::cout << "Case: " << case_id << std::endl; @@ -243,7 +241,6 @@ void test_all() int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all >(); + test_all >(); return 0; } diff --git a/test/strategies/side_by_cross_track.cpp b/test/strategies/side_by_cross_track.cpp index 0d04f7513..98eae77f5 100644 --- a/test/strategies/side_by_cross_track.cpp +++ b/test/strategies/side_by_cross_track.cpp @@ -24,13 +24,12 @@ void test_side(double lon1, double lat1, double lon3, double lat3, int expected) { - namespace bg = boost::geometry; typedef bg::strategy::side::side_by_cross_track strategy; Point p1, p2, p3; - boost::geometry::assign(p1, lon1, lat1); - boost::geometry::assign(p2, lon2, lat2); - boost::geometry::assign(p3, lon3, lat3); + bg::assign(p1, lon1, lat1); + bg::assign(p2, lon2, lat2); + bg::assign(p3, lon3, lat3); int s = strategy::apply(p1, p2, p3); } @@ -44,8 +43,7 @@ void test_all() int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all > >(); + test_all > >(); double a = 0; double b = sin(a); diff --git a/test/strategies/transformer.cpp b/test/strategies/transformer.cpp index e8947d094..bbb9fca1b 100644 --- a/test/strategies/transformer.cpp +++ b/test/strategies/transformer.cpp @@ -27,64 +27,64 @@ template void check_inverse(P const& p, T const& trans) { - boost::geometry::strategy::transform::inverse_transformer inverse(trans); + bg::strategy::transform::inverse_transformer inverse(trans); P i; - boost::geometry::transform(p, i, inverse); + bg::transform(p, i, inverse); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(i)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(i)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(i)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(i)), 1.0, 0.001); } template void test_all() { P p; - boost::geometry::assign(p, 1, 1); + bg::assign(p, 1, 1); { - boost::geometry::strategy::transform::translate_transformer trans(1, 1); + bg::strategy::transform::translate_transformer trans(1, 1); P tp; - boost::geometry::transform(p, tp, trans); + bg::transform(p, tp, trans); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 2.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(tp)), 2.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(tp)), 2.0, 0.001); check_inverse(tp, trans); } { - boost::geometry::strategy::transform::scale_transformer trans(10, 10); + bg::strategy::transform::scale_transformer trans(10, 10); P tp; - boost::geometry::transform(p, tp, trans); + bg::transform(p, tp, trans); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 10.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), 10.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(tp)), 10.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(tp)), 10.0, 0.001); check_inverse(tp, trans); } { - boost::geometry::strategy::transform::rotate_transformer trans(90.0); + bg::strategy::transform::rotate_transformer trans(90.0); P tp; - boost::geometry::transform(p, tp, trans); + bg::transform(p, tp, trans); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 1.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), -1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(tp)), 1.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(tp)), -1.0, 0.001); check_inverse(tp, trans); } { // Map from 0,0,2,2 to 0,0,500,500 - boost::geometry::strategy::transform::map_transformer trans + bg::strategy::transform::map_transformer trans ( 0.0, 0.0, 2.0, 2.0, 500, 500 ); P tp; - boost::geometry::transform(p, tp, trans); + bg::transform(p, tp, trans); - BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 250.0, 0.001); - BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), 250.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<0>(tp)), 250.0, 0.001); + BOOST_CHECK_CLOSE(double(bg::get<1>(tp)), 250.0, 0.001); check_inverse(tp, trans); } @@ -99,8 +99,8 @@ int test_main(int, char* []) test_all >(); //test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/strategies/within.cpp b/test/strategies/within.cpp index 0ff71a3bd..45db86172 100644 --- a/test/strategies/within.cpp +++ b/test/strategies/within.cpp @@ -25,13 +25,12 @@ -namespace bg = boost::geometry; template -void test_point_in_polygon(std::string const& case_id, - Point const& point, Polygon const& polygon, +void test_point_in_polygon(std::string const& case_id, + Point const& point, Polygon const& polygon, Strategy const& strategy, std::string const& strategy_id, bool expected) { @@ -59,11 +58,11 @@ void test_geometry(std::string const& case_id, std::string const& wkt_point bg::read_wkt(wkt_polygon, polygon); namespace sw = bg::strategy::within; - test_point_in_polygon(case_id, point, polygon, sw::winding(), + test_point_in_polygon(case_id, point, polygon, sw::winding(), "winding", expected); - test_point_in_polygon(case_id, point, polygon, sw::franklin(), + test_point_in_polygon(case_id, point, polygon, sw::franklin(), "franklin", boost::contains(deviations, "f") ? !expected : expected); - test_point_in_polygon(case_id, point, polygon, sw::crossings_multiply(), + test_point_in_polygon(case_id, point, polygon, sw::crossings_multiply(), "cross.mult", boost::contains(deviations, "c") ? !expected : expected); } @@ -72,7 +71,7 @@ void test_geometry(std::string const& case_id, std::string const& wkt_point template void test_all() { - typedef bg::polygon polygon; + typedef bg::model::polygon polygon; std::string const box = "POLYGON((0 0,0 2,2 2,2 0,0 0))"; std::string const triangle = "POLYGON((0 0,0 4,6 0,0 0))"; @@ -125,11 +124,11 @@ void test_all() int test_main(int, char* []) { - test_all >(); - test_all >(); + test_all >(); + test_all >(); #if defined(HAVE_TTMATH) - test_all >(); + test_all >(); #endif return 0; diff --git a/test/test_common/test_point.hpp b/test/test_common/test_point.hpp index eb2f5e910..60a6e44e8 100644 --- a/test/test_common/test_point.hpp +++ b/test/test_common/test_point.hpp @@ -85,6 +85,6 @@ template<> struct access } }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits #endif // GEOMETRY_TEST_TEST_COMMON_TEST_POINT_HPP diff --git a/test/test_common/with_pointer.hpp b/test/test_common/with_pointer.hpp index 8cbb4c4f5..b7df76429 100644 --- a/test/test_common/with_pointer.hpp +++ b/test/test_common/with_pointer.hpp @@ -75,7 +75,7 @@ struct access }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits #endif // #ifndef GEOMETRY_TEST_COMMON_WITH_POINTER_HPP diff --git a/test/test_geometries/custom_segment.hpp b/test/test_geometries/custom_segment.hpp index 29c724d39..501bb088b 100644 --- a/test/test_geometries/custom_segment.hpp +++ b/test/test_geometries/custom_segment.hpp @@ -46,7 +46,7 @@ struct custom_segment_4 } // namespace test -BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, boost::geometry::cs::cartesian, x, y) +BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, bg::cs::cartesian, x, y) BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two) BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2) diff --git a/test/test_geometries/wrapped_boost_array.hpp b/test/test_geometries/wrapped_boost_array.hpp index 2de95e715..7baa4167c 100644 --- a/test/test_geometries/wrapped_boost_array.hpp +++ b/test/test_geometries/wrapped_boost_array.hpp @@ -124,7 +124,7 @@ namespace boost { namespace geometry { namespace traits }; -}}} // namespace boost::geometry::traits +}}} // namespace bg::traits diff --git a/test/util/as_range.cpp b/test/util/as_range.cpp index a1940c118..8fe96a877 100644 --- a/test/util/as_range.cpp +++ b/test/util/as_range.cpp @@ -25,7 +25,7 @@ double sum(Range const& range) for (typename boost::range_const_iterator::type it = boost::begin(range); it != boost::end(range); ++it) { - s += boost::geometry::get(*it); + s += bg::get(*it); } return s; } @@ -37,14 +37,14 @@ void test_geometry(std::string const& wkt, double expected_x, double expected_y) // Declare a range-type, compatible with boost::range, // such that range_iterator etc could be called - typedef typename boost::geometry::range_type::type range_type; + typedef typename bg::range_type::type range_type; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); - double s = sum<0>(boost::geometry::as_range(geometry)); + double s = sum<0>(bg::as_range(geometry)); BOOST_CHECK_CLOSE(s, expected_x, 0.001); - s = sum<1>(boost::geometry::as_range(geometry)); + s = sum<1>(bg::as_range(geometry)); BOOST_CHECK_CLOSE(s, expected_y, 0.001); } @@ -54,11 +54,11 @@ void test_all() { // As-range utility should consider a geometry as a range, so // linestring stays linestring - test_geometry >("LINESTRING(1 2,3 4)", 4, 6); + test_geometry >("LINESTRING(1 2,3 4)", 4, 6); // polygon will only be outer-ring - test_geometry >("POLYGON((1 2,3 4))", 4, 6); - test_geometry >("POLYGON((1 2,3 4),(5 6,7 8,9 10))", 4, 6); + test_geometry >("POLYGON((1 2,3 4))", 4, 6); + test_geometry >("POLYGON((1 2,3 4),(5 6,7 8,9 10))", 4, 6); // the utility is useful for: // - convex hull (holes do not count) @@ -67,7 +67,7 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); return 0; } diff --git a/test/util/closeable_view.cpp b/test/util/closeable_view.cpp index 5b67f942e..d5ff7abe9 100644 --- a/test/util/closeable_view.cpp +++ b/test/util/closeable_view.cpp @@ -19,14 +19,17 @@ #include #include + + + // The closeable view should also work on normal std:: containers void test_non_geometry() { - typedef boost::geometry::closeable_view + typedef bg::closeable_view < std::vector const, true > view_type; - + std::vector v; v.push_back(1); v.push_back(2); @@ -76,7 +79,7 @@ void test_non_geometry() template void test_optionally_closing(Range const& range, std::string const& expected) { - typedef boost::geometry::closeable_view view_type; + typedef bg::closeable_view view_type; typedef typename boost::range_iterator::type iterator; view_type view(range); @@ -86,18 +89,17 @@ void test_optionally_closing(Range const& range, std::string const& expected) iterator end = boost::end(view); for (iterator it = boost::begin(view); it != end; ++it, first = false) { - out << (first ? "" : " ") << boost::geometry::dsv(*it); + out << (first ? "" : " ") << bg::dsv(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } template -void test_geometry(std::string const& wkt, - std::string const& expected_false, +void test_geometry(std::string const& wkt, + std::string const& expected_false, std::string const& expected_true) { - namespace bg = boost::geometry; Geometry geo; bg::read_wkt(wkt, geo); @@ -109,8 +111,8 @@ void test_geometry(std::string const& wkt, template void test_all() { - test_geometry >( - "POLYGON((1 1,1 4,4 4,4 1))", + test_geometry >( + "POLYGON((1 1,1 4,4 4,4 1))", "(1, 1) (1, 4) (4, 4) (4, 1)", "(1, 1) (1, 4) (4, 4) (4, 1) (1, 1)"); } @@ -120,9 +122,8 @@ int test_main(int, char* []) { test_non_geometry(); - namespace bg = boost::geometry; - test_all(); - test_all >(); + test_all(); + test_all >(); test_all >(); return 0; diff --git a/test/util/copy.cpp b/test/util/copy.cpp index 627f7e0c3..799a55c9f 100644 --- a/test/util/copy.cpp +++ b/test/util/copy.cpp @@ -22,12 +22,12 @@ template void test_all() { P p1; - boost::geometry::assign(p1, 1, 22, 333); + bg::assign(p1, 1, 22, 333); P p2; - boost::geometry::copy_coordinates(p1, p2); - BOOST_CHECK(boost::geometry::get<0>(p2) == 1); - BOOST_CHECK(boost::geometry::get<1>(p2) == 22); - BOOST_CHECK(boost::geometry::get<2>(p2) == 333); + bg::copy_coordinates(p1, p2); + BOOST_CHECK(bg::get<0>(p2) == 1); + BOOST_CHECK(bg::get<1>(p2) == 22); + BOOST_CHECK(bg::get<2>(p2) == 333); } int test_main(int, char* []) @@ -36,9 +36,9 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/util/for_each_coordinate.cpp b/test/util/for_each_coordinate.cpp index 897cdff07..78bb5cf26 100644 --- a/test/util/for_each_coordinate.cpp +++ b/test/util/for_each_coordinate.cpp @@ -21,7 +21,6 @@ #include #include -namespace bg = boost::geometry; struct test_operation { @@ -50,15 +49,15 @@ template void test_all() { P p; - boost::geometry::assign(p, 1, 2, 3); - boost::geometry::for_each_coordinate(p, test_operation()); + bg::assign(p, 1, 2, 3); + bg::for_each_coordinate(p, test_operation()); BOOST_CHECK(bg::get<0>(p) == 10); BOOST_CHECK(bg::get<1>(p) == 20); BOOST_CHECK(bg::get<2>(p) == 30); P const& cp = p; get_operation op; - op = boost::geometry::for_each_coordinate(cp, op); + op = bg::for_each_coordinate(cp, op); BOOST_CHECK(op.s == std::string("102030")); } @@ -68,9 +67,9 @@ int test_main(int, char* []) test_all(); test_all(); test_all(); - test_all >(); - test_all >(); - test_all >(); + test_all >(); + test_all >(); + test_all >(); return 0; } diff --git a/test/util/reversible_closeable.cpp b/test/util/reversible_closeable.cpp index d823bd17f..2167c68b4 100644 --- a/test/util/reversible_closeable.cpp +++ b/test/util/reversible_closeable.cpp @@ -21,6 +21,8 @@ #include + + template void test_option(Range const& range, std::string const& expected) { @@ -33,94 +35,89 @@ void test_option(Range const& range, std::string const& expected) iterator end = boost::end(view); for (iterator it = boost::begin(view); it != end; ++it, first = false) { - out << (first ? "" : " ") << boost::geometry::dsv(*it); + out << (first ? "" : " ") << bg::dsv(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } -template +template void test_close_reverse(Range const& range, std::string const& expected) { - namespace bg = boost::geometry; test_option < bg::closeable_view < - bg::reversible_view const, + bg::reversible_view const, Close - > + > >(range, expected); } -/* +/* This should NOT compile, or at least not instantiate Use the code as above, so reversible_view should be nested inside closeable_view -template +template void test_reverse_close(Range const& range, std::string const& expected) { - namespace bg = boost::geometry; test_option < bg::reversible_view < - bg::closeable_view const, + bg::closeable_view const, Direction - > + > >(range, expected); } */ -template +template < - boost::geometry::iterate_direction Direction1, - boost::geometry::iterate_direction Direction2, + bg::iterate_direction Direction1, + bg::iterate_direction Direction2, typename Range > void test_reverse_reverse(Range const& range, std::string const& expected) { - namespace bg = boost::geometry; test_option < bg::reversible_view < - bg::reversible_view const, + bg::reversible_view const, Direction1 - > + > >(range, expected); } -template +template < - bool Close1, - bool Close2, + bool Close1, + bool Close2, typename Range > void test_close_close(Range const& range, std::string const& expected) { - namespace bg = boost::geometry; test_option < bg::closeable_view < - bg::closeable_view const, + bg::closeable_view const, Close1 - > + > >(range, expected); } template -void test_geometry(std::string const& wkt, - std::string const& expected_1, +void test_geometry(std::string const& wkt, + std::string const& expected_1, std::string const& expected_2, - std::string const& expected_3, + std::string const& expected_3, std::string const& expected_4, std::string const& expected_cc - ) + ) { - namespace bg = boost::geometry; Geometry geo; bg::read_wkt(wkt, geo); @@ -129,7 +126,7 @@ void test_geometry(std::string const& wkt, test_close_reverse(geo, expected_3); test_close_reverse(geo, expected_4); - /* + /* This should NOT compile on purpose Because the closing_iterator can only be used forward test_reverse_close(geo, expected_1); @@ -149,15 +146,15 @@ void test_geometry(std::string const& wkt, // Ranges basically support nesting, but the closing iterator does not. // It is not necessary for the closing iterator to do so. - //test_close_close(geo, expected_cc); + //test_close_close(geo, expected_cc); } template void test_all() { - test_geometry >( - "POLYGON((1 1,1 4,4 4,4 1))", + test_geometry >( + "POLYGON((1 1,1 4,4 4,4 1))", "(1, 1) (1, 4) (4, 4) (4, 1)", "(1, 1) (1, 4) (4, 4) (4, 1) (1, 1)", "(4, 1) (4, 4) (1, 4) (1, 1)", @@ -169,9 +166,8 @@ void test_all() int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all(); - test_all >(); + test_all(); + test_all >(); test_all >(); return 0; diff --git a/test/util/reversible_view.cpp b/test/util/reversible_view.cpp index fdfe65b63..dfb33a780 100644 --- a/test/util/reversible_view.cpp +++ b/test/util/reversible_view.cpp @@ -20,12 +20,12 @@ #include -template +template void test_forward_or_reverse(Range const& range, std::string const& expected) { - typedef boost::geometry::reversible_view + typedef bg::reversible_view < - Range const, + Range const, Direction > view_type; @@ -34,11 +34,11 @@ void test_forward_or_reverse(Range const& range, std::string const& expected) bool first = true; std::ostringstream out; for (typename boost::range_iterator::type - it = boost::begin(view); - it != boost::end(view); + it = boost::begin(view); + it != boost::end(view); ++it, first = false) { - out << (first ? "" : " ") << boost::geometry::dsv(*it); + out << (first ? "" : " ") << bg::dsv(*it); } BOOST_CHECK_EQUAL(out.str(), expected); } @@ -49,7 +49,6 @@ template void test_geometry(std::string const& wkt, std::string const& expected_forward, std::string const& expected_reverse) { - namespace bg = boost::geometry; Geometry geo; bg::read_wkt(wkt, geo); @@ -61,8 +60,8 @@ void test_geometry(std::string const& wkt, template void test_all() { - test_geometry >( - "linestring(1 1,2 2,3 3)", + test_geometry >( + "linestring(1 1,2 2,3 3)", "(1, 1) (2, 2) (3, 3)", "(3, 3) (2, 2) (1, 1)"); } @@ -70,9 +69,8 @@ void test_all() int test_main(int, char* []) { - namespace bg = boost::geometry; - test_all(); - test_all >(); + test_all(); + test_all >(); test_all >(); return 0; diff --git a/test/util/select_most_precise.cpp b/test/util/select_most_precise.cpp index 70a00e9ea..7339b6e9a 100644 --- a/test/util/select_most_precise.cpp +++ b/test/util/select_most_precise.cpp @@ -36,7 +36,7 @@ template <> struct check_selection : public boost::mpl::int_<98> {}; template void test() { - typedef typename boost::geometry::select_most_precise::type type; + typedef typename bg::select_most_precise::type type; BOOST_CHECK_EQUAL(check_selection::type::value, check_selection::type::value); } diff --git a/test/util/write_dsv.cpp b/test/util/write_dsv.cpp index c2a6d3da2..ddf4eeb5a 100644 --- a/test/util/write_dsv.cpp +++ b/test/util/write_dsv.cpp @@ -25,10 +25,10 @@ void test_dsv(std::string const& wkt, std::string const& dsv) { G geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); std::ostringstream out; - out << boost::geometry::dsv(geometry); + out << bg::dsv(geometry); BOOST_CHECK_EQUAL(out.str(), dsv); } @@ -38,7 +38,7 @@ template void test_all() { using namespace boost::geometry; - typedef point P; + typedef point P; test_dsv

("POINT(1 2)", "(1, 2)"); test_dsv >(