Remove typedefs, add closest point utilities

This commit is contained in:
Vissarion Fisikopoulos 2021-10-11 14:56:05 +03:00
parent bd711c4f5d
commit cdfef3c92c
8 changed files with 124 additions and 234 deletions

View File

@ -13,7 +13,10 @@
#include <boost/concept_check.hpp>
#include <boost/geometry/algorithms/detail/throw_on_empty_input.hpp>
#include <boost/geometry/algorithms/detail/closest_points/utilities.hpp>
#include <boost/geometry/algorithms/dispatch/closest_points.hpp>
#include <boost/geometry/algorithms/distance.hpp>
#include <boost/geometry/core/point_type.hpp>
@ -65,12 +68,7 @@ struct closest_points
false
>::apply(g2, g1, shortest_seg, strategy);
Segment temp;
set<0,0>(temp, get<1,0>(shortest_seg));
set<0,1>(temp, get<1,1>(shortest_seg));
set<1,0>(temp, get<0,0>(shortest_seg));
set<1,1>(temp, get<0,1>(shortest_seg));
shortest_seg = temp;
detail::closest_points::swap_segment_points::apply(shortest_seg);
}
};
@ -105,7 +103,7 @@ struct closest_points
template <typename Strategy>
struct is_strategy_converter_specialized_cp
{
typedef strategies::closest_points::services::strategy_converter<Strategy> converter;
using converter = strategies::closest_points::services::strategy_converter<Strategy>;
static const bool value = ! std::is_same
<
decltype(converter::get(std::declval<Strategy>())),
@ -127,8 +125,8 @@ struct closest_points<Strategy, false>
Segment& shortest_seg,
S const& strategy)
{
typedef strategies::closest_points::services::strategy_converter<Strategy> converter;
typedef decltype(converter::get(strategy)) strategy_type;
using converter = strategies::closest_points::services::strategy_converter<Strategy>;
using strategy_type = decltype(converter::get(strategy));
dispatch::closest_points
<
@ -147,11 +145,11 @@ struct closest_points<Strategy, false>
Segment& shortest_seg,
S const& strategy)
{
typedef strategies::closest_points::services::custom_strategy_converter
using converter = strategies::closest_points::services::custom_strategy_converter
<
Geometry1, Geometry2, Strategy
> converter;
typedef decltype(converter::get(strategy)) strategy_type;
>;
using strategy_type = decltype(converter::get(strategy));
dispatch::closest_points
<
@ -170,10 +168,10 @@ struct closest_points<default_strategy, false>
Segment& shortest_seg,
default_strategy)
{
typedef typename strategies::closest_points::services::default_strategy
using strategy_type = typename strategies::closest_points::services::default_strategy
<
Geometry1, Geometry2
>::type strategy_type;
>::type;
dispatch::closest_points
<

View File

@ -50,7 +50,6 @@ namespace boost { namespace geometry
namespace detail { namespace closest_points
{
template
<
typename P1, typename P2, typename Strategies,
@ -62,10 +61,7 @@ struct point_to_point
static inline void apply(P1 const& p1, P2 const& p2,
Segment& shortest_seg, Strategies const& strategies)
{
set<0,0>(shortest_seg, get<0>(p1));
set<0,1>(shortest_seg, get<1>(p1));
set<1,0>(shortest_seg, get<0>(p2));
set<1,1>(shortest_seg, get<1>(p2));
set_segment_from_points::apply(p1, p2, shortest_seg);
}
};
/*
@ -100,13 +96,10 @@ struct point_to_segment
boost::ignore_unused(strategies);
auto closest_point =
strategies.closest_points(point, segment).apply(point, p[0], p[1]);
auto closest_point = strategies.closest_points(point, segment)
.apply(point, p[0], p[1]);
set<0,0>(shortest_seg, get<0>(point));
set<0,1>(shortest_seg, get<1>(point));
set<1,0>(shortest_seg, get<0>(closest_point));
set<1,1>(shortest_seg, get<1>(closest_point));
set_segment_from_points::apply(point, closest_point, shortest_seg);
}
};
/*
@ -168,47 +161,37 @@ template
class point_to_range
{
private:
//typedef distance::strategy_t<Point, Range, Strategies> strategy_type;
typedef detail::closest_feature::point_to_point_range
using point_to_point_range = detail::closest_feature::point_to_point_range
<
Point, Range, Closure
> point_to_point_range;
>;
public:
//typedef distance::return_t<Point, Range, Strategies> return_type;
template <typename Segment>
static inline void apply(Point const& point, Range const& range,
Segment& shortest_seg,
Strategies const& strategies)
{
//if (boost::size(range) == 0)
//{
// return return_type(0);
//}
if (boost::size(range) == 0)
{
set_segment_from_points::apply(point, point, shortest_seg);
return;
}
distance::creturn_t<Point, Range, Strategies> cd_min;
std::pair
<
typename boost::range_iterator<Range const>::type,
typename boost::range_iterator<Range const>::type
> it_pair
= point_to_point_range::apply(point,
boost::begin(range),
boost::end(range),
strategies.comparable_distance(point, range),
cd_min);
auto it_pair = point_to_point_range::apply(point,
boost::begin(range),
boost::end(range),
strategies.comparable_distance(point, range),
cd_min);
auto closest_point =
strategies.closest_points(point, range).apply(point, *it_pair.first, *it_pair.second);
auto closest_point = strategies.closest_points(point, range)
.apply(point, *it_pair.first, *it_pair.second);
set<0,0>(shortest_seg, get<0>(point));
set<0,1>(shortest_seg, get<1>(point));
set<1,0>(shortest_seg, get<0>(closest_point));
set<1,1>(shortest_seg, get<1>(closest_point));
set_segment_from_points::apply(point, closest_point, shortest_seg);
}
};
@ -222,8 +205,6 @@ template
>
struct point_to_ring
{
typedef distance::return_t<Point, Ring, Strategies> return_type;
template <typename Segment>
static inline auto apply(Point const& point,
Ring const& ring,
@ -232,10 +213,7 @@ struct point_to_ring
{
if (within::within_point_geometry(point, ring, strategies))
{
set<0,0>(shortest_seg, get<0>(point));
set<0,1>(shortest_seg, get<1>(point));
set<1,0>(shortest_seg, get<0>(point));
set<1,1>(shortest_seg, get<1>(point));
set_segment_from_points::apply(point, point, shortest_seg);
}
else
{
@ -258,14 +236,10 @@ template
>
class point_to_polygon
{
public:
typedef distance::return_t<Point, Polygon, Strategies> return_type;
private:
typedef point_to_range
using per_ring = point_to_range
<
Point, typename ring_type<Polygon>::type, Closure, Strategies
> per_ring;
>;
struct distance_to_interior_rings
{
@ -287,10 +261,7 @@ private:
return;
}
}
set<0,0>(shortest_seg, get<0>(point));
set<0,1>(shortest_seg, get<1>(point));
set<1,0>(shortest_seg, get<0>(point));
set<1,1>(shortest_seg, get<1>(point));
set_segment_from_points::apply(point, point, shortest_seg);
}
template <typename InteriorRings, typename Segment>
@ -344,7 +315,7 @@ template
class point_to_multigeometry
{
private:
typedef detail::closest_feature::geometry_to_range geometry_to_range;
using geometry_to_range = detail::closest_feature::geometry_to_range;
public:
@ -354,7 +325,7 @@ public:
Segment& shortest_seg,
Strategies const& strategies)
{
typedef distance::iterator_selector<MultiGeometry const> selector_type;
using selector_type = distance::iterator_selector<MultiGeometry const>;
distance::creturn_t<Point, MultiGeometry, Strategies> cd;
@ -383,8 +354,6 @@ public:
template <typename Point, typename MultiPolygon, typename Strategies>
struct point_to_multigeometry<Point, MultiPolygon, Strategies, true>
{
typedef distance::return_t<Point, MultiPolygon, Strategies> return_type;
template <typename Segment>
static inline void apply(Point const& point,
MultiPolygon const& multipolygon,
@ -393,10 +362,7 @@ struct point_to_multigeometry<Point, MultiPolygon, Strategies, true>
{
if (within::covered_by_point_geometry(point, multipolygon, strategies))
{
set<0,0>(shortest_seg, get<0>(point));
set<0,1>(shortest_seg, get<1>(point));
set<1,0>(shortest_seg, get<0>(point));
set<1,1>(shortest_seg, get<1>(point));
set_segment_from_points::apply(point, point, shortest_seg);
return;
}

View File

@ -29,7 +29,7 @@ namespace services
template <>
struct tag<dummy_pt_pt>
{
typedef strategy_tag_distance_point_point type;
using type = strategy_tag_distance_point_point;
};
@ -39,7 +39,7 @@ struct default_strategy
point_tag, point_tag, Point1, Point2, cartesian_tag, cartesian_tag
>
{
typedef dummy_pt_pt type;
using type = dummy_pt_pt;
};

View File

@ -54,19 +54,19 @@ public:
{
assert_dimension_equal<Point, PointOfSegment>();
typedef typename calculation_type<Point, PointOfSegment>::type calculation_type;
using calculation_type = typename calculation_type<Point, PointOfSegment>::type;
// A projected point of points in Integer coordinates must be able to be
// represented in FP.
typedef model::point
using fp_point_type = model::point
<
calculation_type,
dimension<PointOfSegment>::value,
typename coordinate_system<PointOfSegment>::type
> fp_point_type;
>;
// For convenience
typedef fp_point_type fp_vector_type;
using fp_vector_type = fp_point_type;
/*
Algorithm [p: (px,py), p1: (x1,y1), p2: (x2,y2)]
@ -124,7 +124,7 @@ namespace services
template <typename CalculationType, typename Strategy>
struct tag<projected_point<CalculationType, Strategy> >
{
typedef strategy_tag_distance_point_segment type;
using type = strategy_tag_distance_point_segment;
};
@ -135,11 +135,11 @@ struct default_strategy
cartesian_tag, cartesian_tag, Strategy
>
{
typedef typename default_strategy
using type = typename default_strategy
<
point_tag, segment_tag, Point, PointOfSegment,
cartesian_tag, cartesian_tag, Strategy
>::type type;
>::type;
};

View File

@ -30,107 +30,33 @@ namespace bg = boost::geometry;
//===========================================================================
// point types
typedef bg::model::point<double, 2, bg::cs::cartesian> car_point;
using car_point = bg::model::point<double, 2, bg::cs::cartesian>;
typedef bg::model::point
using sph_point = bg::model::point
<
double, 2,
bg::cs::spherical_equatorial<bg::degree>
> sph_point;
>;
typedef bg::model::point
using geo_point = bg::model::point
<
double, 2,
bg::cs::geographic<bg::degree>
> geo_point;
>;
//===========================================================================
// cartesian strategies
using cartesian = bg::strategies::closest_points::cartesian<double>;
// pt-pt
typedef bg::strategies::closest_points::cartesian<double> cartesian;
//using spherical = bg::strategy::closest_points::spherical<double>;
// pt-seg
//typedef bg::strategies::closest_points::cartesian<double> cartesian_ps;
/*
// pt-box
typedef bg::strategy::closest_points::cartesian_point_box<double> cartesian_pb;
//using = bg::strategy::closest_points::geographic
// <bg::strategy::andoyer> andoyer;
//using = bg::strategy::closest_points::geographic
// <bg::strategy::thomas> thomas;
//using = bg::strategy::closest_points::geographic
// <bg::strategy::vincenty> vincenty;
// box-box
typedef bg::strategy::closest_points::cartesian_box_box<double> cartesian_bb;
// seg-box
typedef bg::strategy::closest_points::cartesian_segment_box<double> cartesian_sb;
//===========================================================================
// spherical strategies
// pt-pt
typedef bg::strategy::closest_points::spherical
<double> spherical_pp;
// pt-seg
typedef bg::strategy::closest_points::cross_track
<double> spherical_ps;
// pt-box
typedef bg::strategy::closest_points::cross_track_point_box
<double> spherical_pb;
// box-box
typedef bg::strategy::closest_points::cross_track_box_box
<double> spherical_bb;
// box-box
typedef bg::strategy::closest_points::spherical_segment_box
<double> spherical_sb;
//===========================================================================
// geographic strategies
// pt-pt
typedef bg::strategy::closest_points::geographic
<bg::strategy::andoyer> andoyer_pp;
typedef bg::strategy::closest_points::geographic
<bg::strategy::thomas> thomas_pp;
typedef bg::strategy::closest_points::geographic
<bg::strategy::vincenty> vincenty_pp;
// pt-seg
typedef bg::strategy::closest_points::geographic_cross_track
<bg::strategy::andoyer> andoyer_ps;
typedef bg::strategy::closest_points::geographic_cross_track
<bg::strategy::thomas> thomas_ps;
typedef bg::strategy::closest_points::geographic_cross_track
<bg::strategy::vincenty> vincenty_ps;
//pt-box
typedef bg::strategy::closest_points::geographic_cross_track_point_box
<bg::strategy::andoyer> andoyer_pb;
typedef bg::strategy::closest_points::geographic_cross_track_point_box
<bg::strategy::thomas> thomas_pb;
typedef bg::strategy::closest_points::geographic_cross_track_point_box
<bg::strategy::vincenty> vincenty_pb;
//box-box
typedef bg::strategy::closest_points::geographic_cross_track_box_box
<bg::strategy::andoyer> andoyer_bb;
typedef bg::strategy::closest_points::geographic_cross_track_box_box
<bg::strategy::thomas> thomas_bb;
typedef bg::strategy::closest_points::geographic_cross_track_box_box
<bg::strategy::vincenty> vincenty_bb;
//segment-box
typedef bg::strategy::closest_points::geographic_segment_box
<bg::strategy::andoyer> andoyer_sb;
typedef bg::strategy::closest_points::geographic_segment_box
<bg::strategy::thomas> thomas_sb;
typedef bg::strategy::closest_points::geographic_segment_box
<bg::strategy::vincenty> vincenty_sb;
*/
//===========================================================================
template <typename Segment>
@ -353,7 +279,7 @@ struct test_geometry
bool swap_geometries = true,
bool default_strategy = false)
{
typedef typename bg::cs_tag<Geometry1>::type CS_tag;
using CS_tag = typename bg::cs_tag<Geometry1>::type;
Geometry1 geometry1;
bg::read_wkt(wkt1, geometry1);

View File

@ -28,11 +28,11 @@ void test_closest_points_point_polygon_or_ring(Strategies const& strategies)
std::cout << "point/polygon or ring closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::ring<Point> Ring;
typedef bg::model::polygon<Point> Polygon;
using Segment = bg::model::segment<Point>;
using Ring = bg::model::ring<Point>;
using Polygon = bg::model::polygon<Point>;
typedef test_geometry<Point, Ring, Segment> tester;
using tester = test_geometry<Point, Ring, Segment>;
tester::apply("POINT(1 1)",
"POLYGON((0 0,1 0,0 1,0 0))",
@ -46,7 +46,7 @@ void test_closest_points_point_polygon_or_ring(Strategies const& strategies)
"SEGMENT(0.4 0.4,0.4 0.4)",
strategies);
typedef test_geometry<Point, Polygon, Segment> tester2;
using tester2 = test_geometry<Point, Polygon, Segment>;
tester2::apply("POINT(1 1)",
"POLYGON((0 0,1 0,0 1,0 0))",
@ -94,9 +94,9 @@ void test_closest_points_point_box(Strategies const& strategies)
std::cout << "point/box closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::box<Point> Box;
typedef test_geometry<Point, Box, Segment> tester;
using Segment = bg::model::segment<Point>;
using Box = bg::model::box<Point>;
using tester = test_geometry<Point, Box, Segment>;
//all 8 possible placements of point around box
tester::apply("POINT(5 25)",
@ -165,10 +165,10 @@ void test_closest_points_point_multi_polygon(Strategies const& strategies)
std::cout << "point/multi-polygon closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::polygon<Point> Polygon;
typedef bg::model::multi_polygon<Polygon> MultiPolygon;
typedef test_geometry<Point, MultiPolygon, Segment> tester;
using Segment = bg::model::segment<Point>;
using Polygon = bg::model::polygon<Point>;
using MultiPolygon = bg::model::multi_polygon<Polygon>;
using tester = test_geometry<Point, MultiPolygon, Segment>;
tester::apply("POINT(1 1)",
"MULTIPOLYGON(((0 0,1 0,0 1,0 0)),\
@ -204,11 +204,11 @@ void test_closest_points_multi_point_polygon_or_ring(Strategies const& strategie
std::cout << "multi-point/polygon or ring closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::multi_point<Point> MultiPoint;
typedef bg::model::ring<Point> Ring;
typedef bg::model::polygon<Point> Polygon;
typedef test_geometry<MultiPoint, Ring, Segment> tester;
using Segment = bg::model::segment<Point>;
using MultiPoint = bg::model::multi_point<Point>;
using Ring = bg::model::ring<Point>;
using Polygon = bg::model::polygon<Point>;
using tester = test_geometry<MultiPoint, Ring, Segment>;
tester::apply("MULTIPOINT((2 1),(1 1))",
"POLYGON((0 0,1 0,0 1,0 0))",
@ -229,7 +229,7 @@ void test_closest_points_multi_point_polygon_or_ring(Strategies const& strategie
"SEGMENT(0.01 0.01,0.01 0.01)",
strategies);
typedef test_geometry<MultiPoint, Polygon, Segment> tester2;
using tester2 = test_geometry<MultiPoint, Polygon, Segment>;
tester2::apply("MULTIPOINT((2 1),(1 1))",
"POLYGON((0 0,1 0,0 1,0 0))",
@ -257,11 +257,11 @@ void test_closest_points_multi_point_multi_polygon(Strategies const& strategies)
std::cout << "multi-point/multi-polygon closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::multi_point<Point> MultiPoint;
typedef bg::model::polygon<Point> Polygon;
typedef bg::model::multi_polygon<Polygon> MultiPolygon;
typedef test_geometry<MultiPoint, MultiPolygon, Segment> tester;
using Segment = bg::model::segment<Point>;
using MultiPoint = bg::model::multi_point<Point>;
using Polygon = bg::model::polygon<Point>;
using MultiPolygon = bg::model::multi_polygon<Polygon>;
using tester = test_geometry<MultiPoint, MultiPolygon, Segment>;
tester::apply("MULTIPOINT((2 1),(1 1))",
"MULTIPOLYGON(((0 0,1 0,0 1,0 0)),\
@ -295,10 +295,10 @@ void test_closest_points_multi_point_box(Strategies const& strategies)
std::cout << "multi-point/box closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::box<Point> Box;
typedef bg::model::multi_point<Point> MultiPoint;
typedef test_geometry<MultiPoint, Box, Segment> tester;
using Segment = bg::model::segment<Point>;
using Box = bg::model::box<Point>;
using MultiPoint = bg::model::multi_point<Point>;
using tester = test_geometry<MultiPoint, Box, Segment>;
tester::apply("MULTIPOINT(5 25,0 0,0 20)",
"BOX(10 10,20 20)",

View File

@ -29,8 +29,8 @@ void test_closest_points_point_segment(Strategies const& strategies)
std::cout << "point/segment closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef test_geometry<Point, Segment, Segment> tester;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<Point, Segment, Segment>;
tester::apply("POINT(1 1)",
"SEGMENT(0 1,1 0)",
@ -65,8 +65,8 @@ void test_closest_points_point_segment_diff_spheroid(Strategies const& strategie
<< std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef test_geometry<Point, Segment, Segment> tester;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<Point, Segment, Segment>;
tester::apply("POINT(1 1)",
"SEGMENT(0 1,1 0)",
@ -90,9 +90,9 @@ void test_closest_points_point_linestring(Strategies const& strategies)
std::cout << "point/linestring closest_points tests" << std::endl;
#endif
typedef bg::model::linestring<Point> Linestring;
typedef bg::model::segment<Point> Segment;
typedef test_geometry<Point, Linestring, Segment> tester;
using Linestring = bg::model::linestring<Point>;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<Point, Linestring, Segment>;
tester::apply("POINT(1 1)",
"LINESTRING(3 2, 1 3, 0 3, 0 1, 1 0, 0 0)",
@ -124,10 +124,10 @@ void test_closest_points_point_multi_linestring(Strategies const& strategies)
std::cout << "point/multi_linestring closest_points tests" << std::endl;
#endif
typedef bg::model::linestring<Point> Linestring;
typedef bg::model::multi_linestring<Linestring> MultiLinestring;
typedef bg::model::segment<Point> Segment;
typedef test_geometry<Point, MultiLinestring, Segment> tester;
using Linestring = bg::model::linestring<Point>;
using MultiLinestring = bg::model::multi_linestring<Linestring>;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<Point, MultiLinestring, Segment>;
tester::apply("POINT(1 1)",
"MULTILINESTRING((3 2, 1 3, 0 3, 0 1, 1 0, 0 0),(2 0,3 1,4 0))",
@ -159,9 +159,9 @@ void test_closest_points_multi_point_segment(Strategies const& strategies)
std::cout << "multi point/segment closest_points tests" << std::endl;
#endif
typedef bg::model::multi_point<Point> MultiPoint;
typedef bg::model::segment<Point> Segment;
typedef test_geometry<MultiPoint, Segment, Segment> tester;
using MultiPoint = bg::model::multi_point<Point>;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<MultiPoint, Segment, Segment>;
tester::apply("MULTIPOINT((2 0),(1 1),(1 2))",
"SEGMENT(0 1,1 0)",
@ -193,10 +193,10 @@ void test_closest_points_multi_point_linestring(Strategies const& strategies)
std::cout << "multi point/linestring closest_points tests" << std::endl;
#endif
typedef bg::model::multi_point<Point> MultiPoint;
typedef bg::model::linestring<Point> Linestring;
typedef bg::model::segment<Point> Segment;
typedef test_geometry<MultiPoint, Linestring, Segment> tester;
using MultiPoint = bg::model::multi_point<Point>;
using Linestring = bg::model::linestring<Point>;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<MultiPoint, Linestring, Segment>;
tester::apply("MULTIPOINT((2 0),(1 1),(3 0))",
"LINESTRING(4 2,3 2, 1 3, 0 3, 0 1, 1 0, 0 0)",
@ -228,11 +228,11 @@ void test_closest_points_multi_point_multi_linestring(Strategies const& strategi
std::cout << "multi point/multi linestring closest_points tests" << std::endl;
#endif
typedef bg::model::multi_point<Point> MultiPoint;
typedef bg::model::linestring<Point> Linestring;
typedef bg::model::multi_linestring<Linestring> MultiLinestring;
typedef bg::model::segment<Point> Segment;
typedef test_geometry<MultiPoint, MultiLinestring, Segment> tester;
using MultiPoint = bg::model::multi_point<Point>;
using Linestring = bg::model::linestring<Point>;
using MultiLinestring = bg::model::multi_linestring<Linestring>;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<MultiPoint, MultiLinestring, Segment>;
tester::apply("MULTIPOINT((5 0),(1 1),(6 0))",
"MULTILINESTRING((3 2, 1 3, 0 3, 0 1, 1 0, 0 0),(2 0,3 1,4 0))",
@ -284,7 +284,7 @@ BOOST_AUTO_TEST_CASE( test_all_pointlike_linear )
//test_all_pl_l<geo_point>(thomas_ps());
//test_all_pl_l<geo_point>(vincenty_ps());
//typedef bg::srs::spheroid<double> stype;
//using = bg::srs::spheroid<double> stype;
//test_closest_points_point_segment_diff_spheroid<geo_point>
// (andoyer_ps(stype(5000000,6000000)));

View File

@ -28,8 +28,8 @@ void test_closest_points_point_point(Strategies const& strategies)
std::cout << "point/point closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef test_geometry<Point, Point, Segment> tester;
using Segment = bg::model::segment<Point>;
using tester = test_geometry<Point, Point, Segment>;
tester::apply("POINT(1 1)",
"POINT(0 0)",
@ -53,9 +53,9 @@ void test_closest_points_point_multi_point(Strategies const& strategies)
std::cout << "point/multi-point closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::multi_point<Point> MultiPoint;
typedef test_geometry<Point, MultiPoint, Segment> tester;
using Segment = bg::model::segment<Point>;
using MultiPoint = bg::model::multi_point<Point>;
using tester = test_geometry<Point, MultiPoint, Segment>;
tester::apply("POINT(0 0)",
"MULTIPOINT((1 1),(2 0),(0 1),(2 1))",
@ -79,9 +79,9 @@ void test_closest_points_multi_point_multi_point(Strategies const& strategies)
std::cout << "multi-point/multi-point closest_points tests" << std::endl;
#endif
typedef bg::model::segment<Point> Segment;
typedef bg::model::multi_point<Point> MultiPoint;
typedef test_geometry<MultiPoint, MultiPoint, Segment> tester;
using Segment = bg::model::segment<Point>;
using MultiPoint = bg::model::multi_point<Point>;
using tester = test_geometry<MultiPoint, MultiPoint, Segment>;
tester::apply("MULTIPOINT((-1 -1),(0 0))",
"MULTIPOINT((1 1),(2 0),(0 1),(2 1))",
@ -97,10 +97,10 @@ void test_closest_points_multi_point_multi_point(Strategies const& strategies)
template <typename Point, typename Strategies>
void test_variant(Strategies const& strategies)
{
typedef Point point_type;
typedef bg::model::segment<point_type> segment_type;
typedef bg::model::multi_point<point_type> mp_type;
typedef boost::variant<point_type, mp_type> variant_type;
using point_type = Point;
using segment_type = bg::model::segment<point_type>;
using mp_type = bg::model::multi_point<point_type>;
using variant_type = boost::variant<point_type, mp_type>;
point_type point1;
bg::read_wkt("POINT(1 3)", point1);