1616#include < boost/geometry.hpp>
1717#include < boost/geometry/extensions/random/uniform_point_distribution.hpp>
1818
19- namespace bg = boost::geometry;
20-
21- using point2d_cart = bg::model::point<double , 2 , bg::cs::cartesian>;
22- using point3d_cart = bg::model::point<double , 3 , bg::cs::cartesian>;
23- using point2d_geog =
24- bg::model::point<double , 2 , bg::cs::geographic<bg::degree>>;
19+ typedef bg::model::point<double , 2 , bg::cs::cartesian> point2d_cart;
20+ typedef bg::model::point<double , 3 , bg::cs::cartesian> point3d_cart;
21+ typedef bg::model::point<double , 2 , bg::cs::geographic<bg::degree>> point2d_geog;
2522
2623void test_geographic ()
2724{
2825 // We check whether the generated points lie roughly along
2926 // the great circle segment (<2 km distance on a sphere with
3027 // the radius of earth) and are distributed uniformly with respect
3128 // to great circle arc length.
32- using linestring = bg::model::linestring<point2d_geog>;
29+ typedef bg::model::linestring<point2d_geog> linestring ;
3330 linestring ls {{ 0.0 , 0.0 }, { 45.0 , 45.0 }, { 60.0 , 60.0 }};
3431 auto l_dist = bg::random::uniform_point_distribution (ls);
3532 std::mt19937 generator (0 );
@@ -52,7 +49,7 @@ void test_geographic()
5249 // (which is actually a triangle in this case) and whether the latitude
5350 // is distributed as expected for uniform spherical distribution, using
5451 // known area ratios of spherical caps.
55- using box = bg::model::box<point2d_geog>;
52+ typedef bg::model::box<point2d_geog> box ;
5653 box b {{ 0.0 , 0.0 }, { 90.0 , 90.0 }};
5754 auto b_dist = bg::random::uniform_point_distribution (b);
5855 int under_60 = 0 ;
@@ -73,7 +70,7 @@ void test_polygon()
7370 // (copied using operator<< and operator>>) generate the same sequence
7471 // of points and whether those points are uniformly distributed with
7572 // respect to cartesian area.
76- using polygon = bg::model::polygon<point2d_cart>;
73+ typedef bg::model::polygon<point2d_cart> polygon ;
7774 polygon poly;
7875 bg::read_wkt (
7976 " POLYGON((16 21,17.1226 17.5451,20.7553 17.5451, 17.8164 15.4098,18.9389 11.9549,16 14.0902,13.0611 11.9549, 14.1836 15.4098,11.2447 17.5451,14.8774 17.5451,16 21))" ,
@@ -98,7 +95,7 @@ void test_polygon()
9895 {
9996 randoms.push_back (poly_dist (generator));
10097 }
101- using box = bg::model::box<point2d_cart>;
98+ typedef bg::model::box<point2d_cart> box ;
10299 box env, lhalf;
103100 bg::envelope (poly, env);
104101 bg::set<bg::min_corner, 0 >(lhalf, bg::get<bg::min_corner, 0 >(env));
@@ -122,7 +119,7 @@ void test_polygon()
122119
123120void test_multipoint ()
124121{
125- using multipoint = bg::model::multi_point<point3d_cart>;
122+ typedef bg::model::multi_point<point3d_cart> multipoint ;
126123 multipoint mp {{0.0 , 0.0 , 0.0 }, {1.0 , 0.0 , 0.0 }, {0.0 , 1.0 , 0.0 }};
127124 int first = 0 ;
128125 auto mp_dist = bg::random::uniform_point_distribution (mp);
0 commit comments