mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-02 08:52:10 +00:00
Merge branch 'develop' of github.com:boostorg/geometry into develop
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -410,13 +410,13 @@ struct intersection_insert
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Linestring const& linestring,
|
||||
Box const& box,
|
||||
RobustPolicy const& ,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out, Strategy const& )
|
||||
{
|
||||
typedef typename point_type<GeometryOut>::type point_type;
|
||||
strategy::intersection::liang_barsky<Box, point_type> lb_strategy;
|
||||
return detail::intersection::clip_range_with_box
|
||||
<GeometryOut>(box, linestring, out, lb_strategy);
|
||||
<GeometryOut>(box, linestring, robust_policy, out, lb_strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -488,7 +488,7 @@ struct intersection_insert
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
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<Segment> range(segment);
|
||||
@@ -496,7 +496,7 @@ struct intersection_insert
|
||||
typedef typename point_type<GeometryOut>::type point_type;
|
||||
strategy::intersection::liang_barsky<Box, point_type> lb_strategy;
|
||||
return detail::intersection::clip_range_with_box
|
||||
<GeometryOut>(box, range, out, lb_strategy);
|
||||
<GeometryOut>(box, range, robust_policy, out, lb_strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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<Cartesian, LatLong, 2,
|
||||
geometry::dimension<Cartesian>::value> ::copy(p1, p2);
|
||||
geometry::detail::conversion::point_to_point<Cartesian, LatLong, 2,
|
||||
geometry::dimension<Cartesian>::value> ::apply(p1, p2);
|
||||
return m_prj->inverse(p1, p2);
|
||||
}
|
||||
|
||||
|
||||
@@ -434,6 +434,38 @@ void test_areal_linear()
|
||||
|
||||
}
|
||||
|
||||
|
||||
template <typename Linestring, typename Box>
|
||||
void test_linear_box()
|
||||
{
|
||||
typedef bg::model::multi_linestring<Linestring> multi_linestring_type;
|
||||
|
||||
test_one_lp<Linestring, Box, Linestring>
|
||||
("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<Linestring, Box, Linestring>
|
||||
("case-l-b-02",
|
||||
"BOX(-10 -10,10 10)",
|
||||
"LINESTRING(-20 -20, 20 20)",
|
||||
1, 2, 20.0 * sqrt(2.0));
|
||||
|
||||
test_one_lp<Linestring, Box, Linestring>
|
||||
("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<Linestring, Box, multi_linestring_type>
|
||||
("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 <typename P>
|
||||
void test_all()
|
||||
{
|
||||
@@ -456,6 +488,8 @@ void test_all()
|
||||
test_areal_linear<polygon_ccw_open, linestring>();
|
||||
#endif
|
||||
|
||||
test_linear_box<linestring, box>();
|
||||
|
||||
// Test polygons clockwise and counter clockwise
|
||||
test_areal<polygon>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user