// Boost.Geometry (aka GGL, Generic Geometry Library) // // Copyright (c) 2007-2011 Barend Gehrels, 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 template void test_all() { // trivial case test_ring

("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true, false); // on border/corner test_ring

("POINT(0 0)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true); test_ring

("POINT(0 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true); // aligned to segment/vertex test_ring

("POINT(1 1)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", true, false); test_ring

("POINT(1 1)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", true, false); // same polygon, but point on border test_ring

("POINT(3 3)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", false, true); 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)", "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); // Mixed point types test_geometry < bg::model::d2::point_xy, bg::model::polygon

>("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); // Real-life problem (solved now), point is in the middle, 409623 is also a coordinate // on the border, it was wrong first. test_ring

("POINT(146383 409623)", "POLYGON((146351 410597,146521 410659,147906 410363,148088 410420" ",148175 410296,148281 409750,148215 409623,148154 409666,148154 409666" ",148130 409625,148035 409626,148035 409626,148008 409544,147963 409510" ",147993 409457,147961 409352,147261 408687,147008 408586,145714 408840" ",145001 409033,144486 409066,144616 409308,145023 410286,145254 410488" ",145618 410612,145618 410612,146015 410565,146190 410545,146351 410597))", true, false); } int test_main( int , char* [] ) { test_all >(); test_all >(); #if defined(HAVE_TTMATH) test_all >(); #endif return 0; }