Skip to content

Commit 9c1905d

Browse files
committed
[test] Calculate convex hull with a non-default spherical side strategy
1 parent eaf904f commit 9c1905d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/algorithms/convex_hull/convex_hull_sph_geo.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ void test_all()
5252
>("polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))",
5353
9, 5, 0.003652987070377825, 147615606532.65408);
5454

55+
// calculate convex hull with a non-default spherical side strategy
56+
test_geometry
57+
<
58+
bg::model::polygon<SphericalPoint>,
59+
sphrerical_side_by_cross_track<>
60+
>("polygon((359 0,1 1,1 -1,359 0))", 4, 4,
61+
0.00060931217091786914);
62+
5563
test_empty_input<bg::model::linestring<SphericalPoint>>();
5664
test_empty_input<bg::model::ring<SphericalPoint>>();
5765
test_empty_input<bg::model::polygon<SphericalPoint>>();

test/algorithms/convex_hull/test_convex_hull.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <boost/geometry/strategies/strategies.hpp>
3030
#include <boost/geometry/strategies/area/services.hpp>
31+
#include <boost/geometry/strategies/spherical/side_by_cross_track.hpp>
3132

3233
#include <boost/geometry/strategy/cartesian/side_robust.hpp>
3334
#include <boost/geometry/strategy/cartesian/side_non_robust.hpp>
@@ -62,6 +63,15 @@ struct non_robust_cartesian_sbt : boost::geometry::strategies::detail::cartesian
6263
}
6364
};
6465

66+
template <typename CalculationType = void>
67+
struct sphrerical_side_by_cross_track : boost::geometry::strategies::detail::spherical_base<void>
68+
{
69+
static auto side()
70+
{
71+
return boost::geometry::strategy::side::side_by_cross_track<>();
72+
}
73+
};
74+
6575
struct precise_cartesian : boost::geometry::strategies::detail::cartesian_base
6676
{
6777
template <typename Geometry>
@@ -318,6 +328,7 @@ void test_geometry_sph_geo(std::string const& wkt,
318328
size_hull_closed, geographic_expected_area);
319329
}
320330

331+
321332
template <typename Geometry>
322333
void test_empty_input()
323334
{

0 commit comments

Comments
 (0)