From 6f4094ec2afcff2e7a7b40568cff5b49f2131ec7 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 25 Feb 2014 17:59:02 +0100 Subject: [PATCH] relate(L,L) some comments added --- .../algorithms/detail/relate/linear_linear.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp index a3373337c..bf87ca2d6 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp @@ -530,7 +530,6 @@ struct linear_linear update(res); } // fake exit point, reset state - // in reality this will be op == overlay::operation_intersection else if ( op == overlay::operation_intersection ) { m_exit_watcher.reset_detected_exit(); @@ -546,6 +545,10 @@ struct linear_linear m_exit_watcher.reset_detected_exit(); } + // if the new linestring started just now, + // but the previous one went out on the previous point, + // we must check if the boundary of the previous segment is outside + // NOTE: couldn't it be integrated with the handling of the union above? if ( first_in_range && ! fake_enter_detected && m_previous_operation == overlay::operation_union ) @@ -761,25 +764,30 @@ struct linear_linear bool res = false; + // IP on the last point of the linestring if ( (BoundaryQuery == boundary_back || BoundaryQuery == boundary_any) && operation_info.operation == overlay::operation_blocked ) { BOOST_ASSERT(operation_info.position == overlay::position_back); + // check if this point is a boundary res = boundary_checker.template is_endpoint_boundary(ip); #ifdef BOOST_GEOMETRY_DEBUG_RELATE_LINEAR_LINEAR BOOST_ASSERT(res == boundary_checker.template is_boundary(ip, seg_id)); #endif } + // IP on the last point of the linestring else if ( (BoundaryQuery == boundary_front || BoundaryQuery == boundary_any) && operation_info.position == overlay::position_front ) { + // check if this point is a boundary res = boundary_checker.template is_endpoint_boundary(ip); #ifdef BOOST_GEOMETRY_DEBUG_RELATE_LINEAR_LINEAR BOOST_ASSERT(res == boundary_checker.template is_boundary(ip, seg_id)); #endif } + // IP somewhere in the interior else { #ifdef BOOST_GEOMETRY_DEBUG_RELATE_LINEAR_LINEAR