diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk index 66fef803e..5dd271517 100644 --- a/doc/release_notes.qbk +++ b/doc/release_notes.qbk @@ -27,6 +27,8 @@ * Added rtree const_iterator, begin(), end() and the support for Boost.Range. * The support for C++11 `std::initializer_list` in geometries models. * Disjoint and intersects support the following geometry combinations: multipoint/linestring, multipoint/multilinestring +* Intersection has been implemented for combinations of pointlike and linear geometries +* Added implementation for difference(pointlike, linear) [*Improvements] diff --git a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp index fc4f65732..b1a25c9f5 100644 --- a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp @@ -1,6 +1,11 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015 Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -160,10 +165,12 @@ template typename OutputLinestring, typename OutputIterator, typename Range, + typename RobustPolicy, typename Box, typename Strategy > OutputIterator clip_range_with_box(Box const& b, Range const& range, + RobustPolicy const&, OutputIterator out, Strategy const& strategy) { if (boost::begin(range) == boost::end(range)) diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 491a540c1..5b9562674 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -410,13 +410,13 @@ struct intersection_insert template static inline OutputIterator apply(Linestring const& linestring, Box const& box, - RobustPolicy const& , + RobustPolicy const& robust_policy, OutputIterator out, Strategy const& ) { typedef typename point_type::type point_type; strategy::intersection::liang_barsky lb_strategy; return detail::intersection::clip_range_with_box - (box, linestring, out, lb_strategy); + (box, linestring, robust_policy, out, lb_strategy); } }; @@ -488,7 +488,7 @@ struct intersection_insert template static inline OutputIterator apply(Segment const& segment, Box const& box, - RobustPolicy const& ,// TODO: propagate to clip_range_with_box + RobustPolicy const& robust_policy, OutputIterator out, Strategy const& ) { geometry::segment_view range(segment); @@ -496,7 +496,7 @@ struct intersection_insert typedef typename point_type::type point_type; strategy::intersection::liang_barsky lb_strategy; return detail::intersection::clip_range_with_box - (box, range, out, lb_strategy); + (box, range, robust_policy, out, lb_strategy); } }; diff --git a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp index 4386c8eea..136d51133 100644 --- a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp +++ b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp @@ -60,8 +60,8 @@ struct project_inverse_transformer { // Latlong (LL -> XY) will be projected, rest will be copied. // So first copy third or higher dimensions - geometry::detail::convert::point_to_point::value> ::copy(p1, p2); + geometry::detail::conversion::point_to_point::value> ::apply(p1, p2); return m_prj->inverse(p1, p2); } diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index f89e70fab..2380fe582 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -434,6 +434,38 @@ void test_areal_linear() } + +template +void test_linear_box() +{ + typedef bg::model::multi_linestring multi_linestring_type; + + test_one_lp + ("case-l-b-01", + "BOX(-10 -10,10 10)", + "LINESTRING(-20 -20, 0 0,20 20)", + 1, 3, 20 * sqrt(2.0)); + + test_one_lp + ("case-l-b-02", + "BOX(-10 -10,10 10)", + "LINESTRING(-20 -20, 20 20)", + 1, 2, 20.0 * sqrt(2.0)); + + test_one_lp + ("case-l-b-02", + "BOX(-10 -10,10 10)", + "LINESTRING(-20 -20, 20 20,15 0,0 -15)", + 2, 4, 25.0 * sqrt(2.0)); + + test_one_lp + ("case-ml-b-01", + "BOX(-10 -10,10 10)", + "MULTILINESTRING((-20 -20, 20 20),(0 -15,15 0))", + 2, 4, 25.0 * sqrt(2.0)); +} + + template void test_all() { @@ -456,6 +488,8 @@ void test_all() test_areal_linear(); #endif + test_linear_box(); + // Test polygons clockwise and counter clockwise test_areal();