Merge branch 'develop' into bg-prepare

Conflicts:
	include/boost/geometry/extensions/gis/geographic/strategies/distance_cross_track.hpp
This commit is contained in:
Barend Gehrels
2016-03-24 21:37:57 +01:00
44 changed files with 226 additions and 98 deletions

View File

@@ -23,23 +23,32 @@
[heading Boost 1.61]
[/=================]
[*Additional functionality]
* Support within and covered_by for Box/Box in spherical and geographic coordinate systems.
[*Improvements]
* Overlay: handle_tangencies replaced by clusters, fixing many cases with colocated turns
[*Solved tickets]
* [@https://svn.boost.org/trac/boost/ticket/10866 10866] union_ doesn't work in 1.56 and 1.57.
* [@https://svn.boost.org/trac/boost/ticket/11576 11576] Intersection gives wrong results.
* [@https://svn.boost.org/trac/boost/ticket/11637 11637] Unused parameter warning.
* [@https://svn.boost.org/trac/boost/ticket/11917 11917] Andoyer distance strategy returns 0 for antipodal points (default geographic distance).
* [@https://svn.boost.org/trac/boost/ticket/11928 11928] Improvement of the accuracy of surveyor area strategy.
* [@https://svn.boost.org/trac/boost/ticket/11966 11966] Compilation error in svg() for box and non-int coordinate type.
* [@https://svn.boost.org/trac/boost/ticket/11789 11789] Assertion failure or invalid result of set operations for spherical_equatorial coordinate system.
* [@https://svn.boost.org/trac/boost/ticket/11987 11987] rtree::remove() not compiling for geographic CS.
* [@https://svn.boost.org/trac/boost/ticket/12000 12000] Uninitialized reference in (unused) constructor of relate's mask_handler.
[*Bugfixes]
* Fix wrong result of intersects/disjoints for Segment and Box when Segment is parallel to Box's face.
* Fix relation operations of Point/Areal in edge cases for non-cartesian coordinate systems.
* Fix intersects and disjoints for Segment/Box in cartesian coordinate system when Segment is parallel to Box's face.
* Fix relation operations for Point/Areal in spherical and geographic coordinate systems for edge cases.
* Fix intersect and disjoint for Point/Box and Box/Box in spherical and geographic coordinate systems for some cases.
* Fix within and covered_by for Point/Box in spherical and geographic coordinate systems for some cases.
[/=================]
[heading Boost 1.60]

View File

@@ -24,7 +24,6 @@
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>

View File

@@ -15,8 +15,6 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_AS_RANGE_HPP
#include <boost/type_traits.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>

View File

@@ -23,7 +23,6 @@
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/algorithms/append.hpp>

View File

@@ -263,6 +263,7 @@ struct traversal
bool const is_intersection = OperationType == operation_intersection;
std::size_t selected_rank = 0;
std::size_t min_rank = 0;
bool result = false;
for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++)
{
@@ -282,8 +283,15 @@ struct traversal
return false;
}
if (! allow_pass_rank && ranked_op.visited.finalized())
{
// Skip this one, go to next
min_rank = ranked_point.main_rank;
continue;
}
if (ranked_point.index == sort_by_side::index_to
&& (ranked_point.main_rank > 0
&& (ranked_point.main_rank > min_rank
|| ranked_turn.both(operation_continue)))
{
if ((is_union
@@ -325,7 +333,6 @@ struct traversal
inline bool select_turn_from_cluster(signed_size_type& turn_index,
int& op_index, signed_size_type start_turn_index,
int start_op_index, bool is_start,
point_type const& point)
{
bool const is_union = OperationType == operation_union;
@@ -333,14 +340,6 @@ struct traversal
turn_type const& turn = m_turns[turn_index];
BOOST_ASSERT(turn.cluster_id >= 0);
#ifdef BOOST_GEOMETRY_DEBUG_TRAVERSE_BUFFER
std::cout << "Select Cluster "
<< turn.cluster_id
<< " from " << turn_index
<< "[" << op_index << "]"
<< std::boolalpha << std::endl;
#endif
typename Clusters::const_iterator mit = m_clusters.find(turn.cluster_id);
BOOST_ASSERT(mit != m_clusters.end());
@@ -349,9 +348,6 @@ struct traversal
sbs_type sbs;
sbs.set_origin(point);
bool at_start = false;
bool has_finished = false;
for (typename std::set<signed_size_type>::const_iterator sit = ids.begin();
sit != ids.end(); ++sit)
{
@@ -363,30 +359,13 @@ struct traversal
continue;
}
if (! is_start && ! is_union && cluster_turn_index == start_turn_index)
{
at_start = true;
}
for (int i = 0; i < 2; i++)
{
sbs.add(cluster_turn.operations[i], cluster_turn_index, i,
m_geometry1, m_geometry2, false);
if (cluster_turn.operations[i].visited.finished())
{
has_finished = true;
}
}
}
if (at_start && has_finished)
{
turn_index = start_turn_index;
op_index = start_op_index;
return true;
}
sbs.apply(turn.point);
int open_count = 0;
@@ -415,13 +394,14 @@ struct traversal
}
}
bool allow = false;
if (open_count > 1)
{
sbs.reverse();
return select_from_cluster(turn_index, op_index, start_turn_index, sbs, true);
allow = true;
}
return select_from_cluster(turn_index, op_index, start_turn_index, sbs, false);
return select_from_cluster(turn_index, op_index, start_turn_index, sbs, allow);
}
inline void change_index_for_self_turn(signed_size_type& to_vertex_index,
@@ -537,7 +517,7 @@ struct traversal
{
if (! select_turn_from_cluster(turn_index, op_index,
start_turn_index, start_op_index, is_start, current_ring.back()))
start_turn_index, current_ring.back()))
{
return is_start
? traverse_error_no_next_ip_at_start

View File

@@ -21,8 +21,10 @@
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/range.hpp>
#include <boost/type_traits.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/size.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/algorithms/append.hpp>

View File

@@ -24,8 +24,6 @@
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/range.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/mpl/if.hpp>
@@ -34,8 +32,10 @@
#include <boost/mpl/set.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/type_traits.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/value_type.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/variant/variant_fwd.hpp>

View File

@@ -17,9 +17,10 @@
#include <cstddef>
#include <boost/core/ignore_unused.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/concept_check.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/point_type.hpp>
@@ -271,7 +272,7 @@ inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
#endif
)
{
boost::ignore_unused_variable_warning(dummy);
boost::ignore_unused(dummy);
typedef core_dispatch::access
<
@@ -306,7 +307,7 @@ inline void set(Geometry& geometry
#endif
)
{
boost::ignore_unused_variable_warning(dummy);
boost::ignore_unused(dummy);
typedef core_dispatch::access
<
@@ -341,7 +342,7 @@ inline typename coordinate_type<Geometry>::type get(Geometry const& geometry
#endif
)
{
boost::ignore_unused_variable_warning(dummy);
boost::ignore_unused(dummy);
typedef core_dispatch::indexed_access
<
@@ -378,7 +379,7 @@ inline void set(Geometry& geometry
#endif
)
{
boost::ignore_unused_variable_warning(dummy);
boost::ignore_unused(dummy);
typedef core_dispatch::indexed_access
<

View File

@@ -22,11 +22,11 @@
#include <boost/mpl/assert.hpp>
#include <boost/mpl/size_t.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
{

View File

@@ -18,7 +18,6 @@
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/static_assert.hpp>
#include <boost/geometry/core/point_type.hpp>
@@ -94,13 +93,7 @@ struct dimension
template <typename Geometry, int Dimensions>
inline void assert_dimension()
{
BOOST_STATIC_ASSERT((
boost::mpl::equal_to
<
boost::mpl::int_<geometry::dimension<Geometry>::value>,
boost::mpl::int_<Dimensions>
>::type::value
));
BOOST_STATIC_ASSERT(( static_cast<int>(dimension<Geometry>::value) == Dimensions ));
}
/*!

View File

@@ -17,8 +17,8 @@
#include <boost/mpl/assert.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/util/bare_type.hpp>
#include <boost/geometry/util/promote_floating_point.hpp>

View File

@@ -17,6 +17,7 @@
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>

View File

@@ -17,7 +17,10 @@
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>

View File

@@ -17,8 +17,8 @@
#include <cstddef>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/range.hpp>
namespace boost { namespace geometry

View File

@@ -22,11 +22,11 @@
#include <boost/mpl/assert.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/bare_type.hpp>
namespace boost { namespace geometry
{

View File

@@ -24,6 +24,7 @@
#include <cstddef>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>

View File

@@ -18,9 +18,8 @@
#include <cstddef>
#include <boost/type_traits.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/geometry/core/geometry_id.hpp>

View File

@@ -14,7 +14,6 @@
#ifndef BOOST_GEOMETRY_CORE_TAG_HPP
#define BOOST_GEOMETRY_CORE_TAG_HPP
#include <boost/mpl/assert.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/util/bare_type.hpp>

View File

@@ -16,7 +16,7 @@
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_base_of.hpp>
namespace boost { namespace geometry
{

View File

@@ -27,9 +27,12 @@
#include <boost/algorithm/string.hpp>
#include <boost/mpl/if.hpp>
#include <boost/range.hpp>
#include <boost/type_traits.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/algorithms/append.hpp>

View File

@@ -20,8 +20,9 @@
#include <cstddef>
#include <boost/type_traits.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/tag_cast.hpp>

View File

@@ -18,8 +18,6 @@
#include <cstddef>
#include <boost/type_traits.hpp>
#include <boost/geometry/policies/robustness/segment_ratio.hpp>
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
#include <boost/geometry/policies/robustness/robust_point_type.hpp>

View File

@@ -13,8 +13,8 @@
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP
#include <boost/type_traits.hpp>
#include <boost/config.hpp>
#include <boost/type_traits/is_floating_point.hpp>
namespace boost { namespace geometry

View File

@@ -25,7 +25,7 @@
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/mpl/if.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/geometry/arithmetic/determinant.hpp>
#include <boost/geometry/core/coordinate_type.hpp>

View File

@@ -22,7 +22,7 @@
#include <boost/concept_check.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/point_type.hpp>

View File

@@ -24,8 +24,6 @@
#include <algorithm>
#include <boost/concept_check.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/point_type.hpp>

View File

@@ -15,9 +15,6 @@
#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PYTHAGORAS_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/strategies/distance.hpp>
@@ -26,8 +23,6 @@
#include <boost/geometry/util/calculation_type.hpp>
namespace boost { namespace geometry
{

View File

@@ -20,7 +20,8 @@
#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_SIDE_BY_TRIANGLE_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/geometry/arithmetic/determinant.hpp>
#include <boost/geometry/core/access.hpp>

View File

@@ -13,8 +13,6 @@
#ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_SSF_HPP
#define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_SSF_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/access.hpp>

View File

@@ -13,7 +13,9 @@
#include <boost/config.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/geometry/util/select_coordinate_type.hpp>
#include <boost/geometry/util/select_most_precise.hpp>

View File

@@ -24,8 +24,6 @@
#include <boost/mpl/insert.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/type_traits.hpp>
namespace boost { namespace geometry
{

View File

@@ -21,7 +21,7 @@
#include <boost/mpl/at.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace geometry

View File

@@ -16,7 +16,7 @@
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_integral.hpp>
namespace boost { namespace geometry

View File

@@ -19,11 +19,17 @@
#include <boost/concept_check.hpp>
#include <boost/config.hpp>
#include <boost/core/addressof.hpp>
#include <boost/range/concepts.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/empty.hpp>
#include <boost/range/difference_type.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/rbegin.hpp>
#include <boost/range/reference.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/geometry/core/assert.hpp>

View File

@@ -21,7 +21,7 @@
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/geometry/util/select_coordinate_type.hpp>

View File

@@ -20,7 +20,8 @@
#define BOOST_GEOMETRY_UTIL_SELECT_MOST_PRECISE_HPP
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_fundamental.hpp>
namespace boost { namespace geometry

View File

@@ -1,6 +1,6 @@
# Boost.Geometry Index
#
# Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
# Copyright (c) 2011-2016 Adam Wulkiewicz, Lodz, Poland.
#
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -15,6 +15,7 @@ test-suite boost-geometry-index-rtree
[ run rtree_epsilon.cpp ]
[ run rtree_insert_remove.cpp ]
[ run rtree_move_pack.cpp ]
[ run rtree_non_cartesian.cpp ]
[ run rtree_values.cpp ]
[ compile-fail rtree_values_invalid.cpp ]
;

View File

@@ -0,0 +1,99 @@
// Boost.Geometry Index
// Unit Test
// Copyright (c) 2016 Adam Wulkiewicz, Lodz, Poland.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <rtree/test_rtree.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/io/wkt/read.hpp>
template <typename Point>
inline void fill(Point & pt, double x, double y)
{
bg::set<0>(pt, x);
bg::set<1>(pt, y);
}
template <typename Point>
inline void fill(bg::model::box<Point> & box, double x, double y)
{
bg::set<0, 0>(box, x);
bg::set<0, 1>(box, y);
bg::set<1, 0>(box, x + 20);
bg::set<1, 1>(box, y + 20);
}
template <typename Rtree>
void test_rtree()
{
typedef typename Rtree::value_type value_t;
Rtree rtree;
value_t v;
// This is not fully valid because both point's longitude and box's min
// longitude should be in range [-180, 180]. So if this stopped passing
// in the future it wouldn't be that bad. Still it works as it is now.
size_t n = 0;
for (double x = -170; x < 400; x += 30, ++n)
{
//double lon = x <= 180 ? x : x - 360;
double lon = x;
double lat = x <= 180 ? 0 : 30;
fill(v, lon, lat);
rtree.insert(v);
BOOST_CHECK_EQUAL(rtree.size(), n + 1);
size_t vcount = 1; // x < 180 ? 1 : 2;
BOOST_CHECK_EQUAL(rtree.count(v), vcount);
std::vector<value_t> res;
rtree.query(bgi::intersects(v), std::back_inserter(res));
BOOST_CHECK_EQUAL(res.size(), vcount);
}
for (double x = -170; x < 400; x += 30, --n)
{
//double lon = x <= 180 ? x : x - 360;
double lon = x;
double lat = x <= 180 ? 0 : 30;
fill(v, lon, lat);
rtree.remove(v);
BOOST_CHECK_EQUAL(rtree.size(), n - 1);
size_t vcount = 0; // x < 180 ? 1 : 0;
BOOST_CHECK_EQUAL(rtree.count(v), vcount);
std::vector<value_t> res;
rtree.query(bgi::intersects(v), std::back_inserter(res));
BOOST_CHECK_EQUAL(res.size(), vcount);
}
}
template <typename Value>
void test_value()
{
test_rtree<bgi::rtree<Value, bgi::linear<4> > >();
test_rtree<bgi::rtree<Value, bgi::quadratic<4> > >();
test_rtree<bgi::rtree<Value, bgi::rstar<4> > >();
}
template <typename Point>
void test_cs()
{
test_value<Point>();
test_value<bg::model::box<Point> >();
}
int test_main(int, char* [])
{
//test_cs<bg::model::point<double, 2, bg::cs::cartesian> >();
test_cs<bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> > >();
test_cs<bg::model::point<double, 2, bg::cs::geographic<bg::degree> > >();
return 0;
}

View File

@@ -636,11 +636,32 @@ static std::string case_recursive_boxes_33[2] =
static std::string case_recursive_boxes_34[2] =
{
// Requires detecting start turn at cluster and use that to finish it
// Requires detecting finished arcs during cluster traversal
"MULTIPOLYGON(((2 0,0 0,0 5,2 5,2 4,3 5,5 5,5 0,2 0)))",
"MULTIPOLYGON(((3 3,2 3,2 2,3 2,3 1,2 0,1 0,2 1,1 1,1 0,0 0,0 5,1 4,1 5,4 5,3 4,3.5 3.5,4 4,4 5,5 4,5 1,4 1,4 3,3 3)),((3 1,4 1,3 0,3 1)))"
};
static std::string case_recursive_boxes_35[2] =
{
// Requires detecting finished arcs during cluster traversal
"MULTIPOLYGON(((3 1,2 1,3 0,0 0,0 2,1 2,1 3,0 2,0 5,4 5,4 4,5 4,5 1,4 1,5 0,3 0,3 1),(2.5 1.5,3 2,2 2,2.5 1.5),(2 4,1 4,2 3,2 4)))",
"MULTIPOLYGON(((2 2,1.5 1.5,2 1,1 1,1 0,0 0,0 5,3 5,2.5 4.5,3 4,3 5,5 5,5 0,1 0,2 1,2 2),(3 2,3 3,2.5 2.5,3 2),(2 3,2 4,1 4,1 3,2 3)))"
};
static std::string case_recursive_boxes_36[2] =
{
// Requires increasing target rank while skipping finished arcs to avoid duplicate output
"MULTIPOLYGON(((5 3,4 3,4 4,5 3)),((5 2,4 2,5 3,5 2)),((5 2,5 1,4 1,5 2)))",
"MULTIPOLYGON(((4 2,4 3,5 3,5 2,4 2)),((4 2,4 1,3 1,3 2,4 2)))"
};
static std::string case_recursive_boxes_37[2] =
{
// Requires skipping arc for union too, to avoid duplicate hole
"MULTIPOLYGON(((4 0,5 1,5 0,4 0)),((2 0,3 1,3 0,2 0)),((2 3,2 2,1 2,1 3,2 3)),((2 1,2 2,4 2,3 1,2 1)))",
"MULTIPOLYGON(((2 3,1 2,1 3,2 3)),((3 1,3.5 0.5,4 1,3 1,4 2,4 3,5 3,5 0,3 0,3 1)),((3 1,2 0,2 1,3 1)))"
};
static std::string pie_21_7_21_0_3[2] =
{
"MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,2500 2500)))",

View File

@@ -398,10 +398,7 @@ void test_all()
{
typedef bg::model::point<T, 2, bg::cs::cartesian> point_type;
typedef bg::model::polygon<point_type> polygon;
typedef bg::model::multi_polygon
<
bg::model::polygon<point_type>
> multi_polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;
test_overlay<multi_polygon, bg::overlay_union>
(

View File

@@ -228,6 +228,15 @@ void test_areal()
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_34",
case_recursive_boxes_34[0], case_recursive_boxes_34[1],
2, 0, 17.25);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_35",
case_recursive_boxes_35[0], case_recursive_boxes_35[1],
2, 0, 20.0);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_36",
case_recursive_boxes_36[0], case_recursive_boxes_36[1],
1, 0, 0.5);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_37",
case_recursive_boxes_37[0], case_recursive_boxes_37[1],
2, 0, 1.0);
test_one<Polygon, MultiPolygon, MultiPolygon>("ggl_list_20120915_h2_a",
ggl_list_20120915_h2[0], ggl_list_20120915_h2[1],

View File

@@ -218,6 +218,18 @@ void test_areal()
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_33",
case_recursive_boxes_33[0], case_recursive_boxes_33[1],
1, 0, -1, 11.0);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_34",
case_recursive_boxes_34[0], case_recursive_boxes_34[1],
1, 0, -1, 25.0);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_35",
case_recursive_boxes_35[0], case_recursive_boxes_35[1],
1, 1, -1, 24.5);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_36",
case_recursive_boxes_36[0], case_recursive_boxes_36[1],
3, 0, -1, 3.0);
test_one<Polygon, MultiPolygon, MultiPolygon>("case_recursive_boxes_37",
case_recursive_boxes_37[0], case_recursive_boxes_37[1],
2, 1, -1, 7.75);
test_one<Polygon, MultiPolygon, MultiPolygon>("ggl_list_20120915_h2_a",
ggl_list_20120915_h2[0], ggl_list_20120915_h2[1],

View File

@@ -10,6 +10,7 @@
#define BOOST_GEOMETRY_TEST_OVERLAY_P_Q_HPP
#include <fstream>
#include <sstream>
#include <iomanip>
//#define BOOST_GEOMETRY_ROBUSTNESS_USE_DIFFERENCE

View File

@@ -14,6 +14,9 @@
#include <iterator>
#include <vector>
#include <boost/range/iterator_range.hpp>
#include <boost/geometry/util/range.hpp>
namespace bgt {