Skip to content

Commit f615372

Browse files
authored
Catch up examples with addition of robustness policy and others (#787)
The example/c03_custom_linestring_example.cpp requires change from PR #786 These changes make all examples compile again. Fixes #784
1 parent 74b98a9 commit f615372

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

example/05_b_overlay_linestring_polygon_example.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ int main(void)
6767
#endif
6868

6969
// Calculate intersection points (turn points)
70-
typedef bg::segment_ratio_type<point_2d, bg::detail::no_rescale_policy>::type segment_ratio;
70+
typedef bg::detail::segment_ratio_type<point_2d, bg::detail::no_rescale_policy>::type segment_ratio;
7171
typedef bg::detail::overlay::turn_info<point_2d, segment_ratio> turn_info;
7272
std::vector<turn_info> turns;
7373
bg::detail::get_turns::no_interrupt_policy policy;
7474
bg::detail::no_rescale_policy rescale_policy;
75-
bg::get_turns<false, false, bg::detail::overlay::assign_null_policy>(ls, p, rescale_policy, turns, policy);
75+
bg::strategy::intersection::services::default_strategy<typename bg::cs_tag<point_2d>::type>::type intersection_strategy;
76+
bg::get_turns<false, false, bg::detail::overlay::assign_null_policy>(ls, p, intersection_strategy, rescale_policy, turns, policy);
7677

7778
std::cout << "Intersection of linestring/polygon" << std::endl;
7879
BOOST_FOREACH(turn_info const& turn, turns)

example/c05_custom_point_pointer_example.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ int main()
102102

103103
// This works because outputs to a normal struct point, no point*
104104
typedef boost::geometry::model::linestring<point_2d> linestring_2d;
105+
boost::geometry::detail::no_rescale_policy rescale_policy;
105106
std::vector<linestring_2d> clipped;
106107
boost::geometry::strategy::intersection::liang_barsky<box_2d, point_2d> strategy;
107108
boost::geometry::detail::intersection::clip_range_with_box<linestring_2d>(cb,
108-
myline, std::back_inserter(clipped), strategy);
109+
myline, rescale_policy, std::back_inserter(clipped), strategy);
109110

110111

111112
std::cout << boost::geometry::length(clipped.front()) << std::endl;

example/c08_custom_non_std_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int main()
281281

282282
// Create (as an example) a regular polygon
283283
const int n = 5;
284-
const double d = (360 / n) * boost::geometry::math::d2r;
284+
const double d = (360 / n) * boost::geometry::math::d2r<double>();
285285
double a = 0;
286286
for (int i = 0; i < n + 1; i++, a += d)
287287
{

0 commit comments

Comments
 (0)