+ tester::apply("s02",
+ from_wkt<B>("BOX(20 20,50 50)"),
+ from_wkt<G>("SEGMENT(10 10,40 20)"),
+ 10, 10, 50, 50);
+
+ // segment ending at the north pole
+ tester::apply("s04",
+ from_wkt<B>("BOX(5 15,50 50)"),
+ from_wkt<G>("SEGMENT(40 45,80 0)"),
+ 5, 0, 50, 50);
+}
+
+BOOST_AUTO_TEST_CASE( expand_segment_spheroid )
+{
+ typedef bg::cs::geographic<bg::degree> coordinate_system_type;
+ typedef bg::model::point<double, 2, coordinate_system_type> point_type;
+ typedef bg::model::box<point_type> B;
+ typedef bg::model::segment<point_type> G;
+ typedef test_expand_on_spheroid tester;
+
+ tester::apply("s01",
+ from_wkt<B>("BOX(20 20,50 50)"),
+ from_wkt<G>("SEGMENT(10 10,40 40)"),
+ 10, 10, 50, 50);
+
+ tester::apply("s02",
+ from_wkt<B>("BOX(20 20,50 50)"),
+ from_wkt<G>("SEGMENT(10 10,40 10)"),
+ 10, 10, 50, 50);
+
+ tester::apply("s03",
+ from_wkt<B>("BOX(5 5,50 10)"),
+ from_wkt<G>("SEGMENT(40 10,10 10)"),
+ 5, 5, 50, 10.347587099602029,
+ 4.0 * std::numeric_limits<double>::epsilon());
+
+ // segment ending at the north pole
+ tester::apply("s04",
+ from_wkt<B>("BOX(5 15,50 50)"),
+ from_wkt<G>("SEGMENT(40 45,80 90)"),
+ 5, 15, 50, 90);
+
+ // segment ending at the north pole
+ tester::apply("s04a",
+ from_wkt<B>("BOX(5 15,30 30)"),
+ from_wkt<G>("SEGMENT(40 45,80 90)"),
+ 5, 15, 40, 90);
+
+ // segment starting at the north pole
+ tester::apply("s05",
+ from_wkt<B>("BOX(5 15,50 50)"),
+ from_wkt<G>("SEGMENT(80 90,40 45)"),
+ 5, 15, 50, 90);
+
+ // segment starting at the north pole
+ tester::apply("s05a",
+ from_wkt<B>("BOX(5 15,30 30)"),
+ from_wkt<G>("SEGMENT(80 90,40 45)"),
+ 5, 15, 40, 90);
+
+ // segment passing through the south pole
+ tester::apply("s06",
+ from_wkt<B>("BOX(5 15,30 40)"),
+ from_wkt<G>("SEGMENT(-170 -45,10 -30)"),
+ -170, -90, 30, 40);
+
+ // segment degenerating to the north pole
+ tester::apply("s07",
+ from_wkt<B>("BOX(5 15,30 40)"),
+ from_wkt<G>("SEGMENT(10 90,20 90)"),
+ 5, 15, 30, 90);
+
+ // segment degenerating to the south pole
+ tester::apply("s08",
+ from_wkt<B>("BOX(5 15,30 40)"),
+ from_wkt<G>("SEGMENT(10 -90,20 -90)"),
+ 5, -90, 30, 40);
+
+ // box degenerating to the south pole
+ tester::apply("s09",
+ from_wkt<B>("BOX(10 -90,30 -90)"),
+ from_wkt<G>("SEGMENT(10 -30,100 45)"),
+ 10, -90, 100, 45);
+
+ // box degenerating to the south pole
+ tester::apply("s09a",
+ from_wkt<B>("BOX(10 -90,130 -90)"),
+ from_wkt<G>("SEGMENT(10 -30,100 45)"),
+ 10, -90, 100, 45);
+}
+
+BOOST_AUTO_TEST_CASE( expand_segment_sphere_with_height )