Skip to content

Commit 4a6d807

Browse files
committed
Merge branch 'develop' into feature/point_order
2 parents 6de86f8 + 869b20c commit 4a6d807

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

include/boost/geometry/algorithms/line_interpolate.hpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Copyright (c) 2018, 2019 Oracle and/or its affiliates.
44

55
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
6+
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
67

78
// Use, modification and distribution is subject to the Boost Software License,
89
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -34,7 +35,7 @@ namespace boost { namespace geometry
3435

3536

3637
#ifndef DOXYGEN_NO_DETAIL
37-
namespace detail { namespace interpolate_point
38+
namespace detail { namespace line_interpolate
3839
{
3940

4041
struct convert_and_push_back
@@ -64,7 +65,7 @@ struct convert_and_assign
6465
specified strategy
6566
*/
6667
template <typename Policy>
67-
struct range
68+
struct interpolate_range
6869
{
6970
template
7071
<
@@ -141,20 +142,20 @@ struct range
141142
};
142143

143144
template <typename Policy>
144-
struct segment
145+
struct interpolate_segment
145146
{
146147
template <typename Segment, typename Distance, typename Pointlike, typename Strategy>
147148
static inline void apply(Segment const& segment,
148149
Distance const& max_distance,
149150
Pointlike & point,
150151
Strategy const& strategy)
151152
{
152-
range<Policy>().apply(segment_view<Segment>(segment),
153-
max_distance, point, strategy);
153+
interpolate_range<Policy>().apply(segment_view<Segment>(segment),
154+
max_distance, point, strategy);
154155
}
155156
};
156157

157-
}} // namespace detail::length
158+
}} // namespace detail::line_interpolate
158159
#endif // DOXYGEN_NO_DETAIL
159160

160161

@@ -182,33 +183,33 @@ struct line_interpolate
182183

183184
template <typename Geometry, typename Pointlike>
184185
struct line_interpolate<Geometry, Pointlike, linestring_tag, point_tag>
185-
: detail::interpolate_point::range
186+
: detail::line_interpolate::interpolate_range
186187
<
187-
detail::interpolate_point::convert_and_assign
188+
detail::line_interpolate::convert_and_assign
188189
>
189190
{};
190191

191192
template <typename Geometry, typename Pointlike>
192193
struct line_interpolate<Geometry, Pointlike, linestring_tag, multi_point_tag>
193-
: detail::interpolate_point::range
194+
: detail::line_interpolate::interpolate_range
194195
<
195-
detail::interpolate_point::convert_and_push_back
196+
detail::line_interpolate::convert_and_push_back
196197
>
197198
{};
198199

199200
template <typename Geometry, typename Pointlike>
200201
struct line_interpolate<Geometry, Pointlike, segment_tag, point_tag>
201-
: detail::interpolate_point::segment
202+
: detail::line_interpolate::interpolate_segment
202203
<
203-
detail::interpolate_point::convert_and_assign
204+
detail::line_interpolate::convert_and_assign
204205
>
205206
{};
206207

207208
template <typename Geometry, typename Pointlike>
208209
struct line_interpolate<Geometry, Pointlike, segment_tag, multi_point_tag>
209-
: detail::interpolate_point::segment
210+
: detail::line_interpolate::interpolate_segment
210211
<
211-
detail::interpolate_point::convert_and_push_back
212+
detail::line_interpolate::convert_and_push_back
212213
>
213214
{};
214215

test/algorithms/line_interpolate.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ struct check_points<P, bg::multi_point_tag>
5454
typedef typename boost::range_iterator<Range const>::type iterator_t;
5555
typedef typename boost::range_value<Range const>::type point_t;
5656

57-
BOOST_CHECK_EQUAL(boost::size(r0), boost::size(r1));
57+
std::size_t count0 = boost::size(r0);
58+
std::size_t count1 = boost::size(r1);
5859

59-
for (iterator_t it0 = boost::begin(r0), it1 = boost::begin(r1);
60-
it0 < boost::end(r0); it0++, it1++)
60+
BOOST_CHECK_MESSAGE(count0 == count1, bg::wkt(r0) << " != " << bg::wkt(r1));
61+
62+
if (count0 == count1)
6163
{
62-
check_points<point_t>::apply(*it0, *it1);
64+
for (iterator_t it0 = boost::begin(r0), it1 = boost::begin(r1);
65+
it0 < boost::end(r0); it0++, it1++)
66+
{
67+
check_points<point_t>::apply(*it0, *it1);
68+
}
6369
}
64-
6570
}
6671
};
6772

@@ -351,7 +356,7 @@ int test_main(int, char* [])
351356
test_sph();
352357
test_sph(bg::strategy::line_interpolate::spherical<>(100));
353358

354-
typedef typename bg::srs::spheroid<double> stype;
359+
typedef bg::srs::spheroid<double> stype;
355360

356361
test_geo(bg::strategy::line_interpolate::geographic<bg::strategy::andoyer>());
357362
test_geo(bg::strategy::line_interpolate::geographic<bg::strategy::thomas>());

0 commit comments

Comments
 (0)