// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2014-2017, Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_TEST_MODULE #define BOOST_TEST_MODULE test_is_valid_geo #endif #include #include #include #include "test_is_valid.hpp" #include #include #include #include BOOST_AUTO_TEST_CASE( test_is_valid_geo_polygon ) { typedef bg::model::point > pt; typedef bg::model::polygon G; typedef validity_tester_geo_areal tester; typedef test_valid test; test::apply("p01", "POLYGON((-1 -1, 1 -1, 1 1, -1 1, -1 -1),(-0.5 -0.5, -0.5 0.5, 0.0 0.0, -0.5 -0.5),(0.0 0.0, 0.5 0.5, 0.5 -0.5, 0.0 0.0))", true); } BOOST_AUTO_TEST_CASE( test_is_valid_epsg4053_polygon ) { typedef bg::model::point > pt; typedef bg::model::polygon po; std::string wkt = "POLYGON((-152 -54,-56 43,142 -52,-152 -54))"; bg::srs::spheroid sph(6371228, 6371228); bg::strategy::intersection::geographic_segments<> is(sph); bg::strategy::area::geographic as(sph); po p; bg::read_wkt(wkt, p); bg::correct(p, as); BOOST_CHECK(bg::is_valid(p, is)); }