mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-24 04:02:10 +00:00
Merge branch 'develop' into feature/buffer_point_geographic
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2017.
|
||||
// Modifications copyright (c) 2017 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017, 2018.
|
||||
// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@@ -65,7 +65,12 @@ struct ovelaps_box
|
||||
template <typename Box, typename InputItem>
|
||||
static inline bool apply(Box const& box, InputItem const& item)
|
||||
{
|
||||
return ! bg::detail::disjoint::disjoint_box_box(box, item.box);
|
||||
typename bg::strategy::disjoint::services::default_strategy
|
||||
<
|
||||
Box, Box
|
||||
>::type strategy;
|
||||
|
||||
return ! bg::detail::disjoint::disjoint_box_box(box, item.box, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2015-2017, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2015-2018, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
@@ -65,14 +65,29 @@ struct test_envelope<FormulaPolicy, bg::geographic_tag>
|
||||
static inline void apply(Geometry& geometry,
|
||||
Box& detected)
|
||||
{
|
||||
bg::strategy::envelope::geographic_segment
|
||||
<
|
||||
FormulaPolicy,
|
||||
bg::srs::spheroid<double>,
|
||||
double
|
||||
> envelope_geographic_segment_strategy;
|
||||
typedef bg::strategy::envelope::spherical_point point_strategy_t;
|
||||
typedef bg::strategy::envelope::spherical_multipoint multi_point_strategy_t;
|
||||
typedef bg::strategy::envelope::spherical_box box_strategy_t;
|
||||
typedef bg::strategy::envelope::geographic<FormulaPolicy, bg::srs::spheroid<double>, double> strategy_t;
|
||||
|
||||
bg::envelope(geometry, detected, envelope_geographic_segment_strategy);
|
||||
typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_same<typename bg::tag<Geometry>::type, bg::point_tag>::value,
|
||||
point_strategy_t,
|
||||
typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_same<typename bg::tag<Geometry>::type, bg::multi_point_tag>::value,
|
||||
multi_point_strategy_t,
|
||||
typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_same<typename bg::tag<Geometry>::type, bg::box_tag>::value,
|
||||
box_strategy_t,
|
||||
strategy_t
|
||||
>::type
|
||||
>::type
|
||||
>::type strategy;
|
||||
|
||||
bg::envelope(geometry, detected, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2018, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
@@ -874,6 +874,9 @@ inline void test_open_multipolygons()
|
||||
test::apply("mpg09",
|
||||
"MULTIPOLYGON(((0 0,10 0,10 10,0 10)),((0 0,9 1,9 2)))",
|
||||
false);
|
||||
test::apply("mpg09_2",
|
||||
"MULTIPOLYGON(((0 0,5 1,10 0,10 10,0 10)),((1 1,9 1,9 2)))",
|
||||
false);
|
||||
|
||||
// one polygon inside another and boundaries not touching
|
||||
test::apply("mpg10",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2015, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2015-2018, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -851,6 +852,9 @@ void test_open_multipolygons()
|
||||
test::apply("mpg09",
|
||||
"MULTIPOLYGON(((0 0,10 0,10 10,0 10)),((0 0,9 1,9 2)))",
|
||||
bg::failure_intersecting_interiors);
|
||||
test::apply("mpg09_2",
|
||||
"MULTIPOLYGON(((0 0,5 1,10 0,10 10,0 10)),((1 1,9 1,9 2)))",
|
||||
bg::failure_intersecting_interiors);
|
||||
|
||||
// one polygon inside another and boundaries not touching
|
||||
test::apply("mpg10",
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014, 2015, 2016.
|
||||
// Modifications copyright (c) 2014-2016 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015, 2016, 2018.
|
||||
// Modifications copyright (c) 2014-2018 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@@ -109,7 +109,7 @@ void test_strategy()
|
||||
box_type b0(point_type(0, 0), point_type(5, 0));
|
||||
|
||||
bool r = bg::within(p, b,
|
||||
bg::strategy::within::point_in_box<point_type, box_type>());
|
||||
bg::strategy::within::cartesian_point_box());
|
||||
BOOST_CHECK_EQUAL(r, true);
|
||||
|
||||
r = bg::within(b, b,
|
||||
@@ -121,7 +121,7 @@ void test_strategy()
|
||||
BOOST_CHECK_EQUAL(r, false);
|
||||
|
||||
r = bg::within(p, b,
|
||||
bg::strategy::within::point_in_box_by_side<point_type, box_type>());
|
||||
bg::strategy::within::point_in_box_by_side<>());
|
||||
BOOST_CHECK_EQUAL(r, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2016 Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-2018 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@@ -19,7 +19,7 @@ void test_point_box_by_side()
|
||||
// Test spherical boxes
|
||||
// See also http://www.gcmap.com/mapui?P=1E45N-19E45N-19E55N-1E55N-1E45N,10E55.1N,10E45.1N
|
||||
typedef bg::model::box<Point> box_t;
|
||||
bg::strategy::within::point_in_box_by_side<Point, box_t> by_side;
|
||||
bg::strategy::within::point_in_box_by_side<> by_side;
|
||||
box_t box;
|
||||
bg::read_wkt("POLYGON((1 45,19 55))", box);
|
||||
BOOST_CHECK_EQUAL(bg::within(Point(10, 55.1), box, by_side), true);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
# Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
# Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
#
|
||||
# This file was modified by Oracle on 2014, 2015, 2016, 2017.
|
||||
# Modifications copyright (c) 2014-2017, Oracle and/or its affiliates.
|
||||
# This file was modified by Oracle on 2014, 2015, 2016, 2017, 2018.
|
||||
# Modifications copyright (c) 2014-2018, Oracle and/or its affiliates.
|
||||
#
|
||||
# Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
@@ -21,6 +21,7 @@ test-suite boost-geometry-strategies
|
||||
[ run crossings_multiply.cpp : : : : strategies_crossings_multiply ]
|
||||
[ run distance_default_result.cpp : : : : strategies_distance_default_result ]
|
||||
[ run douglas_peucker.cpp : : : : strategies_douglas_peucker ]
|
||||
[ run envelope_segment.cpp : : : : strategies_envelope_segment ]
|
||||
[ run franklin.cpp : : : : strategies_franklin ]
|
||||
[ run haversine.cpp : : : : strategies_haversine ]
|
||||
[ run point_in_box.cpp : : : : strategies_point_in_box ]
|
||||
@@ -28,7 +29,6 @@ test-suite boost-geometry-strategies
|
||||
[ run projected_point_ax.cpp : : : : strategies_projected_point_ax ]
|
||||
[ run pythagoras.cpp : : : : strategies_pythagoras ]
|
||||
[ run pythagoras_point_box.cpp : : : : strategies_pythagoras_point_box ]
|
||||
[ run segment_envelope.cpp : : : : strategies_segment_envelope ]
|
||||
[ run segment_intersection.cpp : : : : strategies_segment_intersection ]
|
||||
[ run segment_intersection_collinear.cpp : : : : strategies_segment_intersection_collinear ]
|
||||
[ run segment_intersection_geo.cpp : : : : strategies_segment_intersection_geo ]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2016-2017 Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-2018 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
@@ -41,9 +41,9 @@ void test_strategies_lat(P p1, P p2, CT expected_max, CT expected_min,
|
||||
BOOST_CHECK_CLOSE(p_max_degree_geo, expected_max, error);
|
||||
BOOST_CHECK_CLOSE(p_min_degree_geo, expected_min, error);
|
||||
|
||||
bg::strategy::envelope::spherical_segment<CT> strategy_sph;
|
||||
typedef bg::strategy::envelope::spherical_segment<CT> strategy_sph_t;
|
||||
|
||||
strategy_sph.apply(p1, p2, box);
|
||||
strategy_sph_t::apply(p1, p2, box);
|
||||
|
||||
CT p_min_degree_sph = bg::get<0, 1>(box);
|
||||
CT p_max_degree_sph = bg::get<1, 1>(box);
|
||||
@@ -34,8 +34,8 @@ void test_box_of(std::string const& wkt_point, std::string const& wkt_box,
|
||||
|
||||
// Also test with the non-default agnostic side version
|
||||
namespace wi = bg::strategy::within;
|
||||
wi::point_in_box_by_side<Point, box_type> within_strategy;
|
||||
wi::point_in_box_by_side<Point, box_type, wi::decide_covered_by> covered_by_strategy;
|
||||
wi::point_in_box_by_side<> within_strategy;
|
||||
wi::point_in_box_by_side<wi::decide_covered_by> covered_by_strategy;
|
||||
|
||||
detected_within = bg::within(point, box, within_strategy);
|
||||
detected_covered_by = bg::covered_by(point, box, covered_by_strategy);
|
||||
|
||||
Reference in New Issue
Block a user