[test] Calculate convex hull with a non-default spherical side strategy

This commit is contained in:
Vissarion Fysikopoulos
2020-10-16 11:30:16 +03:00
parent eaf904f1e2
commit 9c1905d1a5
2 changed files with 19 additions and 0 deletions

View File

@@ -52,6 +52,14 @@ void test_all()
>("polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))",
9, 5, 0.003652987070377825, 147615606532.65408);
// calculate convex hull with a non-default spherical side strategy
test_geometry
<
bg::model::polygon<SphericalPoint>,
sphrerical_side_by_cross_track<>
>("polygon((359 0,1 1,1 -1,359 0))", 4, 4,
0.00060931217091786914);
test_empty_input<bg::model::linestring<SphericalPoint>>();
test_empty_input<bg::model::ring<SphericalPoint>>();
test_empty_input<bg::model::polygon<SphericalPoint>>();

View File

@@ -28,6 +28,7 @@
#include <boost/geometry/strategies/strategies.hpp>
#include <boost/geometry/strategies/area/services.hpp>
#include <boost/geometry/strategies/spherical/side_by_cross_track.hpp>
#include <boost/geometry/strategy/cartesian/side_robust.hpp>
#include <boost/geometry/strategy/cartesian/side_non_robust.hpp>
@@ -62,6 +63,15 @@ struct non_robust_cartesian_sbt : boost::geometry::strategies::detail::cartesian
}
};
template <typename CalculationType = void>
struct sphrerical_side_by_cross_track : boost::geometry::strategies::detail::spherical_base<void>
{
static auto side()
{
return boost::geometry::strategy::side::side_by_cross_track<>();
}
};
struct precise_cartesian : boost::geometry::strategies::detail::cartesian_base
{
template <typename Geometry>
@@ -318,6 +328,7 @@ void test_geometry_sph_geo(std::string const& wkt,
size_hull_closed, geographic_expected_area);
}
template <typename Geometry>
void test_empty_input()
{