// Boost.Geometry (aka GGL, Generic Geometry Library) // // Copyright Barend Gehrels, Geodan B.V. Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include 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); Geometry geometry; boost::geometry::read_wkt(wkt_geometry, geometry); bool detected = boost::geometry::within(geometry, circle); BOOST_CHECK_MESSAGE(detected == expected, "within: " << wkt_geometry << " in circle (1,1) with radius 3" << " -> Expected: " << expected << " detected: " << detected); } 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); } int test_main( int , char* [] ) { test_circles >(); return 0; }