123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671 |
- // Boost.Geometry (aka GGL, Generic Geometry Library)
- // Unit Test
- // Copyright (c) 2014-2018, Oracle and/or its affiliates.
- // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
- // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
- // Licensed under the Boost Software License version 1.0.
- // http://www.boost.org/users/license.html
- #include <iostream>
- #ifndef BOOST_TEST_MODULE
- #define BOOST_TEST_MODULE test_distance_cartesian_pointlike_areal
- #endif
- #include <boost/test/included/unit_test.hpp>
- #include "test_distance_common.hpp"
- typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
- typedef bg::model::multi_point<point_type> multi_point_type;
- typedef bg::model::point<double,3,bg::cs::cartesian> point_type_3d;
- typedef bg::model::multi_point<point_type_3d> multi_point_type_3d;
- typedef bg::model::polygon<point_type, false> polygon_type;
- typedef bg::model::multi_polygon<polygon_type> multi_polygon_type;
- typedef bg::model::ring<point_type, false> ring_type;
- typedef bg::model::box<point_type> box_type;
- typedef bg::model::box<point_type_3d> box_type_3d;
- namespace services = bg::strategy::distance::services;
- typedef bg::default_distance_result<point_type>::type return_type;
- typedef bg::strategy::distance::pythagoras<> point_point_strategy;
- typedef bg::strategy::distance::projected_point<> point_segment_strategy;
- typedef bg::strategy::distance::pythagoras_point_box<> point_box_strategy;
- //===========================================================================
- template <typename Strategy>
- void test_distance_point_polygon(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "point/polygon distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<point_type, polygon_type> tester;
- tester::apply("point(0 -20)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 10, 100, strategy);
- tester::apply("point(12 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 2, 4, strategy);
- tester::apply("point(0 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 0, 0, strategy);
- tester::apply("point(0 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),\
- (-5 -5,-5 5,5 5,5 -5,-5 -5))",
- 5, 25, strategy);
- // polygons with single-point rings
- tester::apply("point(0 0)",
- "polygon((-5 5))",
- sqrt(50.0), 50, strategy);
- tester::apply("point(0 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),(-5 5))",
- 0, 0, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_point_ring(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "point/ring distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<point_type, ring_type> tester;
- tester::apply("point(0 -20)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 10, 100, strategy);
- tester::apply("point(12 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 2, 4, strategy);
- tester::apply("point(0 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 0, 0, strategy);
- // single-point rings
- tester::apply("point(0 0)",
- "polygon((-10 -10))",
- sqrt(200.0), 200, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_point_multipolygon(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "point/multipolygon distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<point_type, multi_polygon_type> tester;
- tester::apply("point(0 -20)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
- ((0 22,-1 30,2 40,0 22)))",
- 10, 100, strategy);
- tester::apply("point(12 0)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
- ((20 -1,21 2,30 -10,20 -1)))",
- 2, 4, strategy);
- tester::apply("point(0 0)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
- ((20 -1,21 2,30 -10,20 -1)))",
- 0, 0, strategy);
- tester::apply("point(0 0)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10),\
- (-5 -5,-5 5,5 5,5 -5,-5 -5)),\
- ((100 0,101 0,101 1,100 1,100 0)))",
- 5, 25, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_multipoint_polygon(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "multipoint/polygon distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<multi_point_type, polygon_type> tester;
- tester::apply("multipoint(0 -20,0 -15)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 5, 25, strategy);
- tester::apply("multipoint(16 0,12 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 2, 4, strategy);
- tester::apply("multipoint(0 0,5 5,4 4)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 0, 0, strategy);
- tester::apply("multipoint(0 0,2 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),\
- (-5 -5,-5 5,5 5,5 -5,-5 -5))",
- 3, 9, strategy);
- tester::apply("multipoint(4 4,11 11)",
- "polygon((0 0,0 10,10 10,10 0,0 0))",
- 0, 0, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_multipoint_ring(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "multipoint/ring distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<multi_point_type, ring_type> tester;
- tester::apply("multipoint(0 -20,0 -15)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 5, 25, strategy);
- tester::apply("multipoint(16 0,12 0)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 2, 4, strategy);
- tester::apply("multipoint(0 0,5 5,4 4)",
- "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
- 0, 0, strategy);
- // single-point ring
- tester::apply("multipoint(0 0,5 5,4 4)",
- "polygon((10 10))",
- sqrt(50.0), 50, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_multipoint_multipolygon(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "multipoint/multipolygon distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries
- <
- multi_point_type, multi_polygon_type
- > tester;
- tester::apply("multipoint(0 -20,0 -15)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
- ((0 22,-1 30,2 40,0 22)))",
- 5, 25, strategy);
- tester::apply("multipoint(16 0,12 0)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
- ((20 -1,21 2,30 -10,20 -1)))",
- 2, 4, strategy);
- tester::apply("multipoint(0 0,4 4,5 5)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
- ((20 -1,21 2,30 -10,20 -1)))",
- 0, 0, strategy);
- tester::apply("multipoint(0 0,2 0)",
- "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10),\
- (-5 -5,-5 5,5 5,5 -5,-5 -5)),\
- ((100 0,101 0,101 1,100 1,100 0)))",
- 3, 9, strategy);
- tester::apply("MULTIPOINT(19 19,100 100)",
- "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),\
- (4 4,4 6,6 6,6 4,4 4)), ((10 10,10 20,20 20,20 10,10 10),\
- (14 14,14 16,16 16,16 14,14 14)))",
- 0, 0, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_point_box_2d(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "2D point/box distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<box_type, point_type> tester;
- // point inside box
- tester::apply("box(-1 -1,1 1)",
- "point(0 0)", 0, 0, strategy);
- // points on box corners
- tester::apply("box(-1 -1,1 1)",
- "point(-1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(-1 1)", 0, 0, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(1 1)", 0, 0, strategy);
- // points on box boundary edges
- tester::apply("box(-1 -1,1 1)",
- "point(0 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(-1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(0 1)", 0, 0, strategy);
- // points outside box
- tester::apply("box(-1 -1,1 1)",
- "point(0 4)", 3, 9, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(0.5 4)", 3, 9, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(-0.5 5)", 4, 16, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(3 0.25)", 2, 4, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(-3 -0.25)", 2, 4, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(3 5)", sqrt(20.0), 20, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(-5 -4)", 5, 25, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(2 -2)", sqrt(2.0), 2, strategy);
- tester::apply("box(-1 -1,1 1)",
- "point(-3 4)", sqrt(13.0), 13, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_point_box_different_point_types(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "2D point/box distance tests with different points"
- << std::endl;
- #endif
- typedef point_type double_point;
- typedef box_type double_box;
- typedef bg::model::point<int,2,bg::cs::cartesian> int_point;
- typedef bg::model::box<int_point> int_box;
- test_distance_of_geometries
- <
- int_point, int_box
- >::apply("point(0 0)",
- "box(1 1, 2 2)",
- sqrt(2.0), 2, strategy);
- test_distance_of_geometries
- <
- double_point, int_box
- >::apply("point(0.5 0)",
- "box(1 -1,2 1)",
- 0.5, 0.25, strategy);
- test_distance_of_geometries
- <
- double_point, double_box
- >::apply("point(1.5 0)",
- "box(1 -1,2 1)",
- 0, 0, strategy);
- test_distance_of_geometries
- <
- double_point, int_box
- >::apply("point(1.5 0)",
- "box(1 -1,2 1)",
- 0, 0, strategy);
- test_distance_of_geometries
- <
- int_point, double_box
- >::apply("point(1 0)",
- "box(0.5 -1,1.5 1)",
- 0, 0, strategy);
- test_distance_of_geometries
- <
- int_point, double_box
- >::apply("point(0 0)",
- "box(0.5, -1,1.5, 1)",
- 0.5, 0.25, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_point_box_3d(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "3D point/box distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<box_type_3d, point_type_3d> tester;
- // point inside box
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 0 0)", 0, 0, strategy);
- // points on box corners
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 -1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 -1 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 1 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 -1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 -1 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 1 1)", 0, 0, strategy);
- // points on box boundary edges
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 -1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 -1 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 1 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 1 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 0 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 0 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 0 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 0 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 -1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 -1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 1 0)", 0, 0, strategy);
- // point on box faces
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 0 -1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 0 1)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 -1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 1 0)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-1 0 0)", 0, 0, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(1 0 0)", 0, 0, strategy);
- // points outside box -- closer to box corners
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-2 -3 -4)", sqrt(14.0), 14, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-2 -3 3)", 3, 9, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-2 5 -2)", sqrt(18.0), 18, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-2 5 3)", sqrt(21.0), 21, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(4 -6 -3)", sqrt(38.0), 38, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(4 -6 4)", sqrt(43.0), 43, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(4 7 -2)", sqrt(46.0), 46, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(4 7 8)", sqrt(94.0), 94, strategy);
- // points closer to box facets
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 0 10)", 9, 81, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 0 -5)", 4, 16, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 7 0)", 6, 36, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 -6 0)", 5, 25, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(4 0 0)", 3, 9, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-3 0 0)", 2, 4, strategy);
- // points closer to box edges
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 -4 -5)", 5, 25, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 -3 6)", sqrt(29.0), 29, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 2 -7)", sqrt(37.0), 37, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(0 8 7)", sqrt(85.0), 85, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-4 0 -4)", sqrt(18.0), 18, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-3 0 5)", sqrt(20.0), 20, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(2 0 -6)", sqrt(26.0), 26, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(8 0 6)", sqrt(74.0), 74, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-5 -5 0)", sqrt(32.0), 32, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(-4 6 0)", sqrt(34.0), 34, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(3 -7 0)", sqrt(40.0), 40, strategy);
- tester::apply("box(-1 -1 -1,1 1 1)",
- "point(9 7 0)", 10, 100, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_multipoint_box_2d(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "2D multipoint/box distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries<box_type, multi_point_type> tester;
- // at least one point inside the box
- tester::apply("box(0 0,10 10)",
- "multipoint(0 0,-1 -1,20 20)",
- 0, 0, strategy);
- tester::apply("box(0 0,10 10)",
- "multipoint(1 1,-1 -1,20 20)",
- 0, 0, strategy);
- tester::apply("box(0 0,10 10)",
- "multipoint(1 1,2 2,3 3)",
- 0, 0, strategy);
- // all points outside the box
- tester::apply("box(0 0,10 10)",
- "multipoint(-1 -1,20 20)",
- sqrt(2.0), 2, strategy);
- tester::apply("box(0 0,10 10)",
- "multipoint(5 13, 50 50)",
- 3, 9, strategy);
- }
- //===========================================================================
- template <typename Strategy>
- void test_distance_multipoint_box_3d(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "3D multipoint/box distance tests" << std::endl;
- #endif
- typedef test_distance_of_geometries
- <
- box_type_3d, multi_point_type_3d
- > tester;
- // at least one point inside the box
- tester::apply("box(0 0 0,10 10 10)",
- "multipoint(0 0 0,-1 -1 -1,20 20 20)",
- 0, 0, strategy);
- tester::apply("box(0 0 0,10 10 10)",
- "multipoint(1 1 1,-1 -1 -1,20 20 20)",
- 0, 0, strategy);
- tester::apply("box(0 0 0,10 10 10)",
- "multipoint(1 1 1,2 2 2,3 3 3)",
- 0, 0, strategy);
- // all points outside the box
- tester::apply("box(0 0 0,10 10 10)",
- "multipoint(-1 -1 -1,20 20 20)",
- sqrt(3.0), 3, strategy);
- tester::apply("box(0 0 0,10 10 10)",
- "multipoint(5 5 13,50 50 50)",
- 3, 9, strategy);
- }
- //===========================================================================
- template <typename Point, typename Strategy>
- void test_more_empty_input_pointlike_areal(Strategy const& strategy)
- {
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << std::endl;
- std::cout << "testing on empty inputs... " << std::flush;
- #endif
- bg::model::multi_point<Point> multipoint_empty;
- bg::model::polygon<Point> polygon_empty;
- bg::model::multi_polygon<bg::model::polygon<Point> > multipolygon_empty;
- bg::model::ring<Point> ring_empty;
- Point point = from_wkt<Point>("point(0 0)");
- bg::model::polygon<Point> polygon =
- from_wkt<bg::model::polygon<Point> >("polygon((0 0,1 0,0 1))");
- bg::model::ring<Point> ring =
- from_wkt<bg::model::ring<Point> >("polygon((0 0,1 0,0 1))");
- // 1st geometry is empty
- test_empty_input(multipoint_empty, polygon, strategy);
- test_empty_input(multipoint_empty, ring, strategy);
- // 2nd geometry is empty
- test_empty_input(point, polygon_empty, strategy);
- test_empty_input(point, multipolygon_empty, strategy);
- test_empty_input(point, ring_empty, strategy);
- // both geometries are empty
- test_empty_input(multipoint_empty, polygon_empty, strategy);
- test_empty_input(multipoint_empty, multipolygon_empty, strategy);
- test_empty_input(multipoint_empty, ring_empty, strategy);
- #ifdef BOOST_GEOMETRY_TEST_DEBUG
- std::cout << "done!" << std::endl;
- #endif
- }
- //===========================================================================
- BOOST_AUTO_TEST_CASE( test_all_pointlike_polygon )
- {
- test_distance_point_polygon(point_point_strategy()); // back-compatibility
- test_distance_point_polygon(point_segment_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_point_multipolygon )
- {
- test_distance_point_multipolygon(point_point_strategy()); // back-compatibility
- test_distance_point_multipolygon(point_segment_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_point_ring )
- {
- test_distance_point_ring(point_point_strategy()); // back-compatibility
- test_distance_point_ring(point_segment_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_multipoint_polygon )
- {
- test_distance_multipoint_polygon(point_point_strategy()); // back-compatibility
- test_distance_multipoint_polygon(point_segment_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_multipoint_multipolygon )
- {
- test_distance_multipoint_multipolygon(point_point_strategy()); // back-compatibility
- test_distance_multipoint_multipolygon(point_segment_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_multipoint_ring )
- {
- test_distance_multipoint_ring(point_segment_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_point_box_2d )
- {
- point_box_strategy pb_strategy;
- test_distance_point_box_2d(pb_strategy);
- test_distance_point_box_different_point_types(pb_strategy);
- }
- BOOST_AUTO_TEST_CASE( test_all_point_box_3d )
- {
- test_distance_point_box_3d(point_box_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_multipoint_box_2d )
- {
- test_distance_multipoint_box_2d(point_box_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_multipoint_box_3d )
- {
- test_distance_multipoint_box_3d(point_box_strategy());
- }
- BOOST_AUTO_TEST_CASE( test_all_empty_input_pointlike_areal )
- {
- test_more_empty_input_pointlike_areal
- <
- point_type
- >(point_segment_strategy());
- }
|