mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-12 05:51:47 +00:00
[test][is_valid] Add case in EPSG4053.
This commit is contained in:
parent
9eefd8284e
commit
4eaf6a39d6
@ -36,3 +36,21 @@ BOOST_AUTO_TEST_CASE( test_is_valid_geo_polygon )
|
|||||||
|
|
||||||
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);
|
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<double, 2, bg::cs::geographic<bg::degree> > pt;
|
||||||
|
typedef bg::model::polygon<pt, false> po;
|
||||||
|
|
||||||
|
std::string wkt = "POLYGON((-152 -54,-56 43,142 -52,-152 -54))";
|
||||||
|
|
||||||
|
bg::srs::spheroid<double> sph(6371228, 6371228);
|
||||||
|
bg::strategy::intersection::geographic_segments<> is(sph);
|
||||||
|
bg::strategy::area::geographic<pt> as(sph);
|
||||||
|
|
||||||
|
po p;
|
||||||
|
bg::read_wkt(wkt, p);
|
||||||
|
bg::correct(p, as);
|
||||||
|
|
||||||
|
BOOST_CHECK(bg::is_valid(p, is));
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user