1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland.
6 // This file was modified by Oracle on 2014, 2016, 2017, 2018, 2019.
7 // Modifications copyright (c) 2014-2019, Oracle and/or its affiliates.
9 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Use, modification and distribution is subject to the Boost Software License,
13 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
14 // http://www.boost.org/LICENSE_1_0.txt)
16 #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_INTERSECTION_HPP
17 #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_INTERSECTION_HPP
21 #include <boost/geometry/core/exception.hpp>
23 #include <boost/geometry/geometries/concepts/point_concept.hpp>
24 #include <boost/geometry/geometries/concepts/segment_concept.hpp>
26 #include <boost/geometry/arithmetic/determinant.hpp>
27 #include <boost/geometry/algorithms/detail/assign_values.hpp>
28 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
29 #include <boost/geometry/algorithms/detail/equals/point_point.hpp>
30 #include <boost/geometry/algorithms/detail/recalculate.hpp>
32 #include <boost/geometry/util/math.hpp>
33 #include <boost/geometry/util/promote_integral.hpp>
34 #include <boost/geometry/util/select_calculation_type.hpp>
36 #include <boost/geometry/strategies/cartesian/area.hpp>
37 #include <boost/geometry/strategies/cartesian/disjoint_box_box.hpp>
38 #include <boost/geometry/strategies/cartesian/disjoint_segment_box.hpp>
39 #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
40 #include <boost/geometry/strategies/cartesian/envelope.hpp>
41 #include <boost/geometry/strategies/cartesian/expand_box.hpp>
42 #include <boost/geometry/strategies/cartesian/expand_segment.hpp>
43 #include <boost/geometry/strategies/cartesian/point_in_point.hpp>
44 #include <boost/geometry/strategies/cartesian/point_in_poly_winding.hpp>
45 #include <boost/geometry/strategies/cartesian/side_by_triangle.hpp>
46 #include <boost/geometry/strategies/covered_by.hpp>
47 #include <boost/geometry/strategies/intersection.hpp>
48 #include <boost/geometry/strategies/intersection_result.hpp>
49 #include <boost/geometry/strategies/side.hpp>
50 #include <boost/geometry/strategies/side_info.hpp>
51 #include <boost/geometry/strategies/within.hpp>
53 #include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
54 #include <boost/geometry/policies/robustness/robust_point_type.hpp>
56 #if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
57 # include <boost/geometry/io/wkt/write.hpp>
61 namespace boost { namespace geometry
65 namespace strategy { namespace intersection
70 \see http://mathworld.wolfram.com/Line-LineIntersection.html
74 typename CalculationType = void
76 struct cartesian_segments
78 typedef cartesian_tag cs_tag;
80 typedef side::side_by_triangle<CalculationType> side_strategy_type;
82 static inline side_strategy_type get_side_strategy()
84 return side_strategy_type();
87 template <typename Geometry1, typename Geometry2>
88 struct point_in_geometry_strategy
90 typedef strategy::within::cartesian_winding
92 typename point_type<Geometry1>::type,
93 typename point_type<Geometry2>::type,
98 template <typename Geometry1, typename Geometry2>
99 static inline typename point_in_geometry_strategy<Geometry1, Geometry2>::type
100 get_point_in_geometry_strategy()
102 typedef typename point_in_geometry_strategy
105 >::type strategy_type;
106 return strategy_type();
109 template <typename Geometry>
112 typedef area::cartesian
118 template <typename Geometry>
119 static inline typename area_strategy<Geometry>::type get_area_strategy()
121 typedef typename area_strategy<Geometry>::type strategy_type;
122 return strategy_type();
125 template <typename Geometry>
126 struct distance_strategy
128 typedef distance::pythagoras
134 template <typename Geometry>
135 static inline typename distance_strategy<Geometry>::type get_distance_strategy()
137 typedef typename distance_strategy<Geometry>::type strategy_type;
138 return strategy_type();
141 typedef envelope::cartesian<CalculationType> envelope_strategy_type;
143 static inline envelope_strategy_type get_envelope_strategy()
145 return envelope_strategy_type();
148 typedef expand::cartesian_segment expand_strategy_type;
150 static inline expand_strategy_type get_expand_strategy()
152 return expand_strategy_type();
155 typedef within::cartesian_point_point point_in_point_strategy_type;
157 static inline point_in_point_strategy_type get_point_in_point_strategy()
159 return point_in_point_strategy_type();
162 typedef within::cartesian_point_point equals_point_point_strategy_type;
164 static inline equals_point_point_strategy_type get_equals_point_point_strategy()
166 return equals_point_point_strategy_type();
169 typedef disjoint::cartesian_box_box disjoint_box_box_strategy_type;
171 static inline disjoint_box_box_strategy_type get_disjoint_box_box_strategy()
173 return disjoint_box_box_strategy_type();
176 typedef disjoint::segment_box disjoint_segment_box_strategy_type;
178 static inline disjoint_segment_box_strategy_type get_disjoint_segment_box_strategy()
180 return disjoint_segment_box_strategy_type();
183 typedef covered_by::cartesian_point_box disjoint_point_box_strategy_type;
184 typedef covered_by::cartesian_point_box covered_by_point_box_strategy_type;
185 typedef within::cartesian_point_box within_point_box_strategy_type;
186 typedef envelope::cartesian_box envelope_box_strategy_type;
187 typedef expand::cartesian_box expand_box_strategy_type;
189 template <typename CoordinateType, typename SegmentRatio>
190 struct segment_intersection_info
193 typedef typename select_most_precise
195 CoordinateType, double
196 >::type promoted_type;
198 promoted_type comparable_length_a() const
200 return dx_a * dx_a + dy_a * dy_a;
203 promoted_type comparable_length_b() const
205 return dx_b * dx_b + dy_b * dy_b;
208 template <typename Point, typename Segment1, typename Segment2>
209 void assign_a(Point& point, Segment1 const& a, Segment2 const& ) const
211 assign(point, a, dx_a, dy_a, robust_ra);
213 template <typename Point, typename Segment1, typename Segment2>
214 void assign_b(Point& point, Segment1 const& , Segment2 const& b) const
216 assign(point, b, dx_b, dy_b, robust_rb);
219 template <typename Point, typename Segment>
220 void assign(Point& point, Segment const& segment, CoordinateType const& dx, CoordinateType const& dy, SegmentRatio const& ratio) const
222 // Calculate the intersection point based on segment_ratio
223 // Up to now, division was postponed. Here we divide using numerator/
224 // denominator. In case of integer this results in an integer
226 BOOST_GEOMETRY_ASSERT(ratio.denominator() != 0);
228 typedef typename promote_integral<CoordinateType>::type calc_type;
230 calc_type const numerator
231 = boost::numeric_cast<calc_type>(ratio.numerator());
232 calc_type const denominator
233 = boost::numeric_cast<calc_type>(ratio.denominator());
234 calc_type const dx_calc = boost::numeric_cast<calc_type>(dx);
235 calc_type const dy_calc = boost::numeric_cast<calc_type>(dy);
237 set<0>(point, get<0, 0>(segment)
238 + boost::numeric_cast<CoordinateType>(numerator * dx_calc
240 set<1>(point, get<0, 1>(segment)
241 + boost::numeric_cast<CoordinateType>(numerator * dy_calc
246 template <typename Point, typename Segment1, typename Segment2>
247 void calculate(Point& point, Segment1 const& a, Segment2 const& b) const
251 // Prefer one segment if one is on or near an endpoint
252 bool const a_near_end = robust_ra.near_end();
253 bool const b_near_end = robust_rb.near_end();
254 if (a_near_end && ! b_near_end)
258 else if (b_near_end && ! a_near_end)
264 // Prefer shorter segment
265 promoted_type const len_a = comparable_length_a();
266 promoted_type const len_b = comparable_length_b();
271 // else use_a is true but was already assigned like that
276 assign_a(point, a, b);
280 assign_b(point, a, b);
284 CoordinateType dx_a, dy_a;
285 CoordinateType dx_b, dy_b;
286 SegmentRatio robust_ra;
287 SegmentRatio robust_rb;
290 template <typename D, typename W, typename ResultType>
291 static inline void cramers_rule(D const& dx_a, D const& dy_a,
292 D const& dx_b, D const& dy_b, W const& wx, W const& wy,
294 ResultType& d, ResultType& da)
297 d = geometry::detail::determinant<ResultType>(dx_a, dy_a, dx_b, dy_b);
298 da = geometry::detail::determinant<ResultType>(dx_b, dy_b, wx, wy);
299 // Ratio is da/d , collinear if d == 0, intersecting if 0 <= r <= 1
300 // IntersectionPoint = (x1 + r * dx_a, y1 + r * dy_a)
303 // Version for non-rescaled policies
306 typename UniqueSubRange1,
307 typename UniqueSubRange2,
310 static inline typename Policy::return_type
311 apply(UniqueSubRange1 const& range_p,
312 UniqueSubRange2 const& range_q,
313 Policy const& policy)
315 // Pass the same ranges both as normal ranges and as robust ranges
316 return apply(range_p, range_q, policy, range_p, range_q);
319 // Main entry-routine, calculating intersections of segments p / q
322 typename UniqueSubRange1,
323 typename UniqueSubRange2,
325 typename RobustUniqueSubRange1,
326 typename RobustUniqueSubRange2
328 static inline typename Policy::return_type
329 apply(UniqueSubRange1 const& range_p,
330 UniqueSubRange2 const& range_q,
332 RobustUniqueSubRange1 const& robust_range_p,
333 RobustUniqueSubRange2 const& robust_range_q)
335 typedef typename UniqueSubRange1::point_type point1_type;
336 typedef typename UniqueSubRange2::point_type point2_type;
338 BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point1_type>) );
339 BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point2_type>) );
341 // Get robust points (to be omitted later)
342 typedef typename RobustUniqueSubRange1::point_type robust_point1_type;
343 typedef typename RobustUniqueSubRange2::point_type robust_point2_type;
345 point1_type const& p1 = range_p.at(0);
346 point1_type const& p2 = range_p.at(1);
347 point2_type const& q1 = range_q.at(0);
348 point2_type const& q2 = range_q.at(1);
350 robust_point1_type const& robust_a1 = robust_range_p.at(0);
351 robust_point1_type const& robust_a2 = robust_range_p.at(1);
352 robust_point2_type const& robust_b1 = robust_range_q.at(0);
353 robust_point2_type const& robust_b2 = robust_range_q.at(1);
355 using geometry::detail::equals::equals_point_point;
356 bool const a_is_point = equals_point_point(robust_a1, robust_a2, point_in_point_strategy_type());
357 bool const b_is_point = equals_point_point(robust_b1, robust_b2, point_in_point_strategy_type());
359 if(a_is_point && b_is_point)
361 // Take either a or b
362 model::referring_segment<point1_type const> const d(p1, p2);
364 return equals_point_point(robust_a1, robust_b2, point_in_point_strategy_type())
365 ? Policy::degenerate(d, true)
371 sides.set<0>(side_strategy_type::apply(robust_b1, robust_b2, robust_a1),
372 side_strategy_type::apply(robust_b1, robust_b2, robust_a2));
376 // Both points are at same side of other segment, we can leave
377 return Policy::disjoint();
380 sides.set<1>(side_strategy_type::apply(robust_a1, robust_a2, robust_b1),
381 side_strategy_type::apply(robust_a1, robust_a2, robust_b2));
385 // Both points are at same side of other segment, we can leave
386 return Policy::disjoint();
389 bool collinear = sides.collinear();
391 typedef typename select_most_precise
393 typename geometry::coordinate_type<robust_point1_type>::type,
394 typename geometry::coordinate_type<robust_point2_type>::type
395 >::type robust_coordinate_type;
397 typedef segment_ratio<robust_coordinate_type> ratio_type;
399 segment_intersection_info
401 typename select_calculation_type<point1_type, point2_type, CalculationType>::type,
405 sinfo.dx_a = get<0>(p2) - get<0>(p1); // distance in x-dir
406 sinfo.dx_b = get<0>(q2) - get<0>(q1);
407 sinfo.dy_a = get<1>(p2) - get<1>(p1); // distance in y-dir
408 sinfo.dy_b = get<1>(q2) - get<1>(q1);
410 robust_coordinate_type const robust_dx_a = get<0>(robust_a2) - get<0>(robust_a1);
411 robust_coordinate_type const robust_dx_b = get<0>(robust_b2) - get<0>(robust_b1);
412 robust_coordinate_type const robust_dy_a = get<1>(robust_a2) - get<1>(robust_a1);
413 robust_coordinate_type const robust_dy_b = get<1>(robust_b2) - get<1>(robust_b1);
415 // r: ratio 0-1 where intersection divides A/B
416 // (only calculated for non-collinear segments)
419 robust_coordinate_type robust_da0, robust_da;
420 robust_coordinate_type robust_db0, robust_db;
422 cramers_rule(robust_dx_a, robust_dy_a, robust_dx_b, robust_dy_b,
423 get<0>(robust_a1) - get<0>(robust_b1),
424 get<1>(robust_a1) - get<1>(robust_b1),
425 robust_da0, robust_da);
427 cramers_rule(robust_dx_b, robust_dy_b, robust_dx_a, robust_dy_a,
428 get<0>(robust_b1) - get<0>(robust_a1),
429 get<1>(robust_b1) - get<1>(robust_a1),
430 robust_db0, robust_db);
432 math::detail::equals_factor_policy<robust_coordinate_type>
433 policy(robust_dx_a, robust_dy_a, robust_dx_b, robust_dy_b);
434 robust_coordinate_type const zero = 0;
435 if (math::detail::equals_by_policy(robust_da0, zero, policy)
436 || math::detail::equals_by_policy(robust_db0, zero, policy))
438 // If this is the case, no rescaling is done for FP precision.
439 // We set it to collinear, but it indicates a robustness issue.
446 sinfo.robust_ra.assign(robust_da, robust_da0);
447 sinfo.robust_rb.assign(robust_db, robust_db0);
451 // Declare segments, currently necessary for the policies
452 // (segment_crosses, segment_colinear, degenerate, one_degenerate, etc)
453 model::referring_segment<point1_type const> const p(p1, p2);
454 model::referring_segment<point2_type const> const q(q1, q2);
458 std::pair<bool, bool> const collinear_use_first
459 = is_x_more_significant(geometry::math::abs(robust_dx_a),
460 geometry::math::abs(robust_dy_a),
461 geometry::math::abs(robust_dx_b),
462 geometry::math::abs(robust_dy_b),
463 a_is_point, b_is_point);
465 if (collinear_use_first.second)
467 // Degenerate cases: segments of single point, lying on other segment, are not disjoint
468 // This situation is collinear too
470 if (collinear_use_first.first)
472 return relate_collinear<0, Policy, ratio_type>(p, q,
473 robust_a1, robust_a2, robust_b1, robust_b2,
474 a_is_point, b_is_point);
478 // Y direction contains larger segments (maybe dx is zero)
479 return relate_collinear<1, Policy, ratio_type>(p, q,
480 robust_a1, robust_a2, robust_b1, robust_b2,
481 a_is_point, b_is_point);
486 return Policy::segments_crosses(sides, sinfo, p, q);
490 // first is true if x is more significant
491 // second is true if the more significant difference is not 0
492 template <typename RobustCoordinateType>
493 static inline std::pair<bool, bool>
494 is_x_more_significant(RobustCoordinateType const& abs_robust_dx_a,
495 RobustCoordinateType const& abs_robust_dy_a,
496 RobustCoordinateType const& abs_robust_dx_b,
497 RobustCoordinateType const& abs_robust_dy_b,
498 bool const a_is_point,
499 bool const b_is_point)
501 //BOOST_GEOMETRY_ASSERT_MSG(!(a_is_point && b_is_point), "both segments shouldn't be degenerated");
503 // for degenerated segments the second is always true because this function
504 // shouldn't be called if both segments were degenerated
508 return std::make_pair(abs_robust_dx_b >= abs_robust_dy_b, true);
512 return std::make_pair(abs_robust_dx_a >= abs_robust_dy_a, true);
516 RobustCoordinateType const min_dx = (std::min)(abs_robust_dx_a, abs_robust_dx_b);
517 RobustCoordinateType const min_dy = (std::min)(abs_robust_dy_a, abs_robust_dy_b);
518 return min_dx == min_dy ?
519 std::make_pair(true, min_dx > RobustCoordinateType(0)) :
520 std::make_pair(min_dx > min_dy, true);
526 std::size_t Dimension,
531 typename RobustPoint1,
532 typename RobustPoint2
534 static inline typename Policy::return_type
535 relate_collinear(Segment1 const& a,
537 RobustPoint1 const& robust_a1, RobustPoint1 const& robust_a2,
538 RobustPoint2 const& robust_b1, RobustPoint2 const& robust_b2,
539 bool a_is_point, bool b_is_point)
543 return relate_one_degenerate<Policy, RatioType>(a,
544 get<Dimension>(robust_a1),
545 get<Dimension>(robust_b1), get<Dimension>(robust_b2),
550 return relate_one_degenerate<Policy, RatioType>(b,
551 get<Dimension>(robust_b1),
552 get<Dimension>(robust_a1), get<Dimension>(robust_a2),
555 return relate_collinear<Policy, RatioType>(a, b,
556 get<Dimension>(robust_a1),
557 get<Dimension>(robust_a2),
558 get<Dimension>(robust_b1),
559 get<Dimension>(robust_b2));
562 /// Relate segments known collinear
569 typename RobustType1,
572 static inline typename Policy::return_type
573 relate_collinear(Segment1 const& a, Segment2 const& b,
574 RobustType1 oa_1, RobustType1 oa_2,
575 RobustType2 ob_1, RobustType2 ob_2)
577 // Calculate the ratios where a starts in b, b starts in a
578 // a1--------->a2 (2..7)
582 // b1 is located w.r.t. a at ratio: (5-2)/5=3/5 (on a)
583 // b2 is located w.r.t. a at ratio: (8-2)/5=6/5 (right of a)
584 // a1 is located w.r.t. b at ratio: (2-5)/3=-3/3 (left of b)
585 // a2 is located w.r.t. b at ratio: (7-5)/3=2/3 (on b)
586 // A arrives (a2 on b), B departs (b1 on a)
588 // If both are reversed:
589 // a2<---------a1 (7..2)
593 // b1 is located w.r.t. a at ratio: (8-7)/-5=-1/5 (before a starts)
594 // b2 is located w.r.t. a at ratio: (5-7)/-5=2/5 (on a)
595 // a1 is located w.r.t. b at ratio: (7-8)/-3=1/3 (on b)
596 // a2 is located w.r.t. b at ratio: (2-8)/-3=6/3 (after b ends)
598 // If both one is reversed:
599 // a1--------->a2 (2..7)
603 // b1 is located w.r.t. a at ratio: (8-2)/5=6/5 (after a ends)
604 // b2 is located w.r.t. a at ratio: (5-2)/5=3/5 (on a)
605 // a1 is located w.r.t. b at ratio: (2-8)/-3=6/3 (after b ends)
606 // a2 is located w.r.t. b at ratio: (7-8)/-3=1/3 (on b)
607 RobustType1 const length_a = oa_2 - oa_1; // no abs, see above
608 RobustType2 const length_b = ob_2 - ob_1;
610 RatioType ra_from(oa_1 - ob_1, length_b);
611 RatioType ra_to(oa_2 - ob_1, length_b);
612 RatioType rb_from(ob_1 - oa_1, length_a);
613 RatioType rb_to(ob_2 - oa_1, length_a);
615 // use absolute measure to detect endpoints intersection
616 // NOTE: it'd be possible to calculate bx_wrt_a using ax_wrt_b values
617 int const a1_wrt_b = position_value(oa_1, ob_1, ob_2);
618 int const a2_wrt_b = position_value(oa_2, ob_1, ob_2);
619 int const b1_wrt_a = position_value(ob_1, oa_1, oa_2);
620 int const b2_wrt_a = position_value(ob_2, oa_1, oa_2);
622 // fix the ratios if necessary
623 // CONSIDER: fixing ratios also in other cases, if they're inconsistent
624 // e.g. if ratio == 1 or 0 (so IP at the endpoint)
625 // but position value indicates that the IP is in the middle of the segment
626 // because one of the segments is very long
627 // In such case the ratios could be moved into the middle direction
628 // by some small value (e.g. EPS+1ULP)
631 ra_from.assign(0, 1);
632 rb_from.assign(0, 1);
634 else if (a1_wrt_b == 3)
636 ra_from.assign(1, 1);
643 rb_from.assign(1, 1);
645 else if (a2_wrt_b == 3)
651 if ((a1_wrt_b < 1 && a2_wrt_b < 1) || (a1_wrt_b > 3 && a2_wrt_b > 3))
652 //if ((ra_from.left() && ra_to.left()) || (ra_from.right() && ra_to.right()))
654 return Policy::disjoint();
657 bool const opposite = math::sign(length_a) != math::sign(length_b);
659 return Policy::segments_collinear(a, b, opposite,
660 a1_wrt_b, a2_wrt_b, b1_wrt_a, b2_wrt_a,
661 ra_from, ra_to, rb_from, rb_to);
664 /// Relate segments where one is degenerate
669 typename DegenerateSegment,
670 typename RobustType1,
673 static inline typename Policy::return_type
674 relate_one_degenerate(DegenerateSegment const& degenerate_segment,
675 RobustType1 d, RobustType2 s1, RobustType2 s2,
678 // Calculate the ratios where ds starts in s
679 // a1--------->a2 (2..6)
681 // Ratio: (4-2)/(6-2)
682 RatioType const ratio(d - s1, s2 - s1);
684 if (!ratio.on_segment())
686 return Policy::disjoint();
689 return Policy::one_degenerate(degenerate_segment, ratio, a_degenerate);
692 template <typename ProjCoord1, typename ProjCoord2>
693 static inline int position_value(ProjCoord1 const& ca1,
694 ProjCoord2 const& cb1,
695 ProjCoord2 const& cb2)
699 return math::equals(ca1, cb1) ? 1
700 : math::equals(ca1, cb2) ? 3
712 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
716 template <typename CalculationType>
717 struct default_strategy<cartesian_tag, CalculationType>
719 typedef cartesian_segments<CalculationType> type;
722 } // namespace services
723 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
726 }} // namespace strategy::intersection
731 namespace within { namespace services
734 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
735 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, linear_tag, linear_tag, cartesian_tag, cartesian_tag>
737 typedef strategy::intersection::cartesian_segments<> type;
740 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
741 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, linear_tag, polygonal_tag, cartesian_tag, cartesian_tag>
743 typedef strategy::intersection::cartesian_segments<> type;
746 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
747 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, polygonal_tag, linear_tag, cartesian_tag, cartesian_tag>
749 typedef strategy::intersection::cartesian_segments<> type;
752 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
753 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, polygonal_tag, polygonal_tag, cartesian_tag, cartesian_tag>
755 typedef strategy::intersection::cartesian_segments<> type;
758 }} // within::services
760 namespace covered_by { namespace services
763 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
764 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, linear_tag, linear_tag, cartesian_tag, cartesian_tag>
766 typedef strategy::intersection::cartesian_segments<> type;
769 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
770 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, linear_tag, polygonal_tag, cartesian_tag, cartesian_tag>
772 typedef strategy::intersection::cartesian_segments<> type;
775 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
776 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, polygonal_tag, linear_tag, cartesian_tag, cartesian_tag>
778 typedef strategy::intersection::cartesian_segments<> type;
781 template <typename Geometry1, typename Geometry2, typename AnyTag1, typename AnyTag2>
782 struct default_strategy<Geometry1, Geometry2, AnyTag1, AnyTag2, polygonal_tag, polygonal_tag, cartesian_tag, cartesian_tag>
784 typedef strategy::intersection::cartesian_segments<> type;
787 }} // within::services
791 }} // namespace boost::geometry
794 #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_INTERSECTION_HPP