mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-13 00:22:10 +00:00
Merge branch 'develop' of https://github.com/boostorg/geometry into feature/set_ops_pointlike_linear
This commit is contained in:
@@ -16,21 +16,21 @@
|
||||
|
||||
test-suite boost-geometry-algorithms
|
||||
:
|
||||
[ run append.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run area.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run append.cpp ]
|
||||
[ run area.cpp ]
|
||||
[ run assign.cpp ]
|
||||
[ run buffer.cpp ]
|
||||
[ run centroid.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run comparable_distance.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run convex_hull.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run correct.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run convert.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run envelope.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run centroid.cpp ]
|
||||
[ run comparable_distance.cpp ]
|
||||
[ run convex_hull.cpp ]
|
||||
[ run correct.cpp ]
|
||||
[ run convert.cpp ]
|
||||
[ run envelope.cpp ]
|
||||
[ run expand.cpp ]
|
||||
[ run for_each.cpp ]
|
||||
[ run is_simple.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run is_valid.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run is_valid_failure.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run is_simple.cpp ]
|
||||
[ run is_valid.cpp ]
|
||||
[ run is_valid_failure.cpp ]
|
||||
[ run length.cpp ]
|
||||
[ run make.cpp ]
|
||||
[ run multi_area.cpp ]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -24,25 +24,20 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/algorithms/make.hpp>
|
||||
#include <boost/geometry/algorithms/clear.hpp>
|
||||
#include <boost/geometry/algorithms/append.hpp>
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
#include <boost/geometry/geometries/register/linestring.hpp>
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
#include <test_common/test_point.hpp>
|
||||
#include <test_geometries/wrapped_boost_array.hpp>
|
||||
|
||||
// includes for multi-geometries
|
||||
#include <boost/geometry/multi/core/point_type.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
#include <boost/geometry/multi/geometries/concepts/check.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
#include <boost/geometry/multi/algorithms/append.hpp>
|
||||
#include <boost/geometry/multi/algorithms/clear.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
|
||||
BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector)
|
||||
BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque)
|
||||
|
||||
@@ -14,13 +14,13 @@ project boost-geometry-algorithms-buffer
|
||||
|
||||
test-suite boost-geometry-algorithms-buffer
|
||||
:
|
||||
[ run point_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run linestring_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run polygon_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_point_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_linestring_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_polygon_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run aimes_linestring_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
# [ run country_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ] # Uncomment if you want to test this manually; requires access to data/ folder
|
||||
[ run point_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run linestring_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run polygon_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run multi_point_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run multi_linestring_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run multi_polygon_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run aimes_linestring_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
# [ run country_buffer.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ] # Uncomment if you want to test this manually; requires access to data/ folder
|
||||
;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2014-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
#include <test_buffer.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
std::string read_from_file(std::string const& filename)
|
||||
@@ -148,80 +146,80 @@ void test_all()
|
||||
std::string no = read_from_file<mpt>("data/no.wkt");
|
||||
std::string uk = read_from_file<mpt>("data/uk.wkt");
|
||||
|
||||
test_one<mpt, pt>("gr10", gr, 336274443102, 10);
|
||||
test_one<mpt, pt>("gr20", gr, 442303404970, 20);
|
||||
test_one<mpt, pt>("gr50", gr, 680414236746, 50);
|
||||
test_one<mpt, pt>("gr100", gr, 910435136622, 100);
|
||||
test_one<mpt, pt>("gr10", gr, 336279815057, 10);
|
||||
test_one<mpt, pt>("gr20", gr, 442317493728, 20);
|
||||
test_one<mpt, pt>("gr50", gr, 680442278144, 50);
|
||||
test_one<mpt, pt>("gr100", gr, 910474619262, 100);
|
||||
|
||||
test_one<mpt, pt>("gr10", gr, 139315436711, -10);
|
||||
test_one<mpt, pt>("gr20", gr, 96996694672, -20);
|
||||
test_one<mpt, pt>("gr50", gr, 31400319981, -50);
|
||||
test_one<mpt, pt>("gr100", gr, 2038866888, -100);
|
||||
test_one<mpt, pt>("gr10", gr, 139313148239, -10);
|
||||
test_one<mpt, pt>("gr20", gr, 96991352461, -20);
|
||||
test_one<mpt, pt>("gr50", gr, 31391928703, -50);
|
||||
test_one<mpt, pt>("gr100", gr, 2035400463, -100);
|
||||
|
||||
test_one<mpt, pt>("it1", it, 569862957683, 1);
|
||||
test_one<mpt, pt>("it2", it, 579239031444, 2);
|
||||
test_one<mpt, pt>("it5", it, 607624450258, 5);
|
||||
test_one<mpt, pt>("it10", it, 655015072045, 10);
|
||||
test_one<mpt, pt>("it20", it, 749341988637, 20);
|
||||
test_one<mpt, pt>("it50", it, 1018283833002, 50);
|
||||
test_one<mpt, pt>("it100", it, 1436371098919, 100);
|
||||
test_one<mpt, pt>("it1", it, 569863002352, 1);
|
||||
test_one<mpt, pt>("it2", it, 579239205460, 2);
|
||||
test_one<mpt, pt>("it5", it, 607625467971, 5);
|
||||
test_one<mpt, pt>("it10", it, 655018590164, 10);
|
||||
test_one<mpt, pt>("it20", it, 749353300126, 20);
|
||||
test_one<mpt, pt>("it50", it, 1018323108593, 50);
|
||||
test_one<mpt, pt>("it100", it, 1436451405440, 100);
|
||||
|
||||
test_one<mpt, pt>("it1", it, 551474452673, -1);
|
||||
test_one<mpt, pt>("it2", it, 542617896207, -2);
|
||||
test_one<mpt, pt>("it5", it, 517403395015, -5);
|
||||
test_one<mpt, pt>("it10", it, 477948804826, -10);
|
||||
test_one<mpt, pt>("it20", it, 404704185411, -20);
|
||||
test_one<mpt, pt>("it50", it, 238775955402, -50);
|
||||
test_one<mpt, pt>("it100", it, 69800921399, -100);
|
||||
test_one<mpt, pt>("it1", it, 551474409670, -1);
|
||||
test_one<mpt, pt>("it2", it, 542617726944, -2);
|
||||
test_one<mpt, pt>("it5", it, 517402446347, -5);
|
||||
test_one<mpt, pt>("it10", it, 477945526913, -10);
|
||||
test_one<mpt, pt>("it20", it, 404693994961, -20);
|
||||
test_one<mpt, pt>("it50", it, 238748456044, -50);
|
||||
test_one<mpt, pt>("it100", it, 69768639974, -100);
|
||||
test_one<mpt, pt>("it200", it, 0, -200);
|
||||
|
||||
test_one<mpt, pt>("nl1", nl, 97391149343, 1);
|
||||
test_one<mpt, pt>("nl2", nl, 100816629886, 2);
|
||||
test_one<mpt, pt>("nl5", nl, 110239413808, 5);
|
||||
test_one<mpt, pt>("nl10", nl, 123407160072, 10);
|
||||
test_one<mpt, pt>("nl20", nl, 145044379084, 20);
|
||||
test_one<mpt, pt>("nl50", nl, 201197559681, 50);
|
||||
test_one<mpt, pt>("nl100", nl, 303275571989, 100);
|
||||
test_one<mpt, pt>("nl1", nl, 97391171492, 1);
|
||||
test_one<mpt, pt>("nl2", nl, 100816708947, 2);
|
||||
test_one<mpt, pt>("nl5", nl, 110239800198, 5);
|
||||
test_one<mpt, pt>("nl10", nl, 123408276767, 10);
|
||||
test_one<mpt, pt>("nl20", nl, 145046916470, 20);
|
||||
test_one<mpt, pt>("nl50", nl, 201207309280, 50);
|
||||
test_one<mpt, pt>("nl100", nl, 303300936130, 100);
|
||||
|
||||
test_one<mpt, pt>("nl1", nl, 90095062551, -1);
|
||||
test_one<mpt, pt>("nl2", nl, 86601922962, -2);
|
||||
test_one<mpt, pt>("nl5", nl, 77308154694, -5);
|
||||
test_one<mpt, pt>("nl10", nl, 64669734511, -10);
|
||||
test_one<mpt, pt>("nl20", nl, 46685545338, -20);
|
||||
test_one<mpt, pt>("nl50", nl, 10248593002, -50);
|
||||
test_one<mpt, pt>("nl1", nl, 90095047258, -1);
|
||||
test_one<mpt, pt>("nl2", nl, 86601864925, -2);
|
||||
test_one<mpt, pt>("nl5", nl, 77307843491, -5);
|
||||
test_one<mpt, pt>("nl10", nl, 64668873412, -10);
|
||||
test_one<mpt, pt>("nl20", nl, 46683532991, -20);
|
||||
test_one<mpt, pt>("nl50", nl, 10244522894, -50);
|
||||
test_one<mpt, pt>("nl100", nl, 0, -100);
|
||||
|
||||
test_one<mpt, pt>("no1", no, 1819566431968, 1);
|
||||
test_one<mpt, pt>("no2", no, 1865040587680, 2);
|
||||
test_one<mpt, pt>("no5", no, 1973612505198, 5);
|
||||
test_one<mpt, pt>("no10", no, 2102026964987, 10);
|
||||
test_one<mpt, pt>("no20", no, 2292154347925, 20);
|
||||
test_one<mpt, pt>("no50", no, 2725424299143, 50);
|
||||
test_one<mpt, pt>("no100", no, 3374865875758, 100);
|
||||
test_one<mpt, pt>("no1", no, 1819566643132, 1);
|
||||
test_one<mpt, pt>("no2", no, 1865041330273, 2);
|
||||
test_one<mpt, pt>("no5", no, 1973615513085, 5);
|
||||
test_one<mpt, pt>("no10", no, 2102034197635, 10);
|
||||
test_one<mpt, pt>("no20", no, 2292171193871, 20);
|
||||
test_one<mpt, pt>("no50", no, 2725475412131, 50);
|
||||
test_one<mpt, pt>("no100", no, 3374987097497, 100);
|
||||
|
||||
test_one<mpt, pt>("no1", no, 1725145481020, -1);
|
||||
test_one<mpt, pt>("no2", no, 1678942941890, -2);
|
||||
test_one<mpt, pt>("no5", no, 1547331904374, -5);
|
||||
test_one<mpt, pt>("no10", no, 1361206959153, -10);
|
||||
test_one<mpt, pt>("no20", no, 1089865725529, -20);
|
||||
test_one<mpt, pt>("no50", no, 649657900609, -50);
|
||||
test_one<mpt, pt>("no100", no, 306772606713, -100);
|
||||
test_one<mpt, pt>("no1", no, 1725145365167, -1);
|
||||
test_one<mpt, pt>("no2", no, 1678942477834, -2);
|
||||
test_one<mpt, pt>("no5", no, 1547329288139, -5);
|
||||
test_one<mpt, pt>("no10", no, 1361198992659, -10);
|
||||
test_one<mpt, pt>("no20", no, 1089847769281, -20);
|
||||
test_one<mpt, pt>("no50", no, 649622185906, -50);
|
||||
test_one<mpt, pt>("no100", no, 306739135037, -100);
|
||||
|
||||
test_one<mpt, pt>("uk1", uk, 733080699236, 1);
|
||||
test_one<mpt, pt>("uk2", uk, 749555588975, 2);
|
||||
test_one<mpt, pt>("uk5", uk, 793750965288, 5);
|
||||
test_one<mpt, pt>("uk10", uk, 857677152435, 10);
|
||||
test_one<mpt, pt>("uk20", uk, 970474644257, 20);
|
||||
test_one<mpt, pt>("uk50", uk, 1247789678698, 50);
|
||||
test_one<mpt, pt>("uk100", uk, 1659782604299, 100);
|
||||
test_one<mpt, pt>("uk1", uk, 733080792661, 1);
|
||||
test_one<mpt, pt>("uk2", uk, 749555934157, 2);
|
||||
test_one<mpt, pt>("uk5", uk, 793752670139, 5);
|
||||
test_one<mpt, pt>("uk10", uk, 857682293758, 10);
|
||||
test_one<mpt, pt>("uk20", uk, 970488073372, 20);
|
||||
test_one<mpt, pt>("uk50", uk, 1247830326998, 50);
|
||||
test_one<mpt, pt>("uk100", uk, 1659861947865, 100);
|
||||
|
||||
test_one<mpt, pt>("uk1", uk, 699378162790, -1);
|
||||
test_one<mpt, pt>("uk2", uk, 683086653377, -2);
|
||||
test_one<mpt, pt>("uk5", uk, 637326518646, -5);
|
||||
test_one<mpt, pt>("uk10", uk, 572560284244, -10);
|
||||
test_one<mpt, pt>("uk20", uk, 479267296848, -20);
|
||||
test_one<mpt, pt>("uk50", uk, 274851268903, -50);
|
||||
test_one<mpt, pt>("uk100", uk, 78225232337, -100);
|
||||
test_one<mpt, pt>("uk1", uk, 699378105887, -1);
|
||||
test_one<mpt, pt>("uk2", uk, 683086430553, -2);
|
||||
test_one<mpt, pt>("uk5", uk, 637325270073, -5);
|
||||
test_one<mpt, pt>("uk10", uk, 572556645697, -10);
|
||||
test_one<mpt, pt>("uk20", uk, 479258135850, -20);
|
||||
test_one<mpt, pt>("uk50", uk, 274828075226, -50);
|
||||
test_one<mpt, pt>("uk100", uk, 78205462121, -100);
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
|
||||
@@ -63,6 +63,8 @@ static std::string const mysql_report_2015_03_02a = "LINESTRING(0 0,0 5,5 5,5 0,
|
||||
static std::string const mysql_report_2015_03_02b = "LINESTRING(0 1,0 5,5 5,5 0,1 0)"; // not closed, 1 difference
|
||||
static std::string const mysql_report_2015_03_02c = "LINESTRING(0 2,0 5,5 5,5 0,2 0)"; // not closed, 2 difference
|
||||
|
||||
static std::string const mysql_report_2015_04_01 = "LINESTRING(103 5,107 2,111 4,116 -1,115 0,112 4)";
|
||||
|
||||
|
||||
template <bool Clockwise, typename P>
|
||||
void test_all()
|
||||
@@ -201,6 +203,10 @@ void test_all()
|
||||
double const d15 = 1.5;
|
||||
test_one<linestring, polygon>("mysql_report_2015_03_02c_asym1", mysql_report_2015_03_02c, join_round(7), end_round(7), 39.714, d10, d15);
|
||||
test_one<linestring, polygon>("mysql_report_2015_03_02c_asym2", mysql_report_2015_03_02c, join_round(7), end_round(7), 46.116, d15, d10);
|
||||
#if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_FAILING_TESTS)
|
||||
double const d100 = 10;
|
||||
test_one<linestring, polygon>("mysql_report_2015_04_01", mysql_report_2015_04_01, join_round(32), end_round(32), 1.0/*NON ZERO*/, d100);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
#include <test_buffer.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
|
||||
static std::string const simplex = "MULTILINESTRING((0 0,4 5),(5 4,10 0))";
|
||||
static std::string const two_bends = "MULTILINESTRING((0 0,4 5,7 4,10 6),(1 5,5 9,8 6))";
|
||||
static std::string const turn_inside = "MULTILINESTRING((0 0,4 5,7 4,10 6),(1 5,5 9,8 6),(0 4,-2 6))";
|
||||
@@ -31,6 +29,7 @@ static std::string const mikado2 = "MULTILINESTRING((-6.117647058823528993798390
|
||||
static std::string const mikado3 = "MULTILINESTRING((1 18,4.0559006211180124168436122999992 7.8136645962732922399140989000443),(6.7243816254416959310447055031545 -1.0812720848056533995418249105569,7 -2,7 -8,14 3.6666666666666669627261399000417),(15.297872340425531234586742357351 5.8297872340425538340014099958353,16 7,15.214285714285713524418497399893 5.8445378151260509724806979647838),(13.685863874345550073030608473346 3.5968586387434555717845796607435,-1 -18,-3.7900797165633304253162805252941 -11.117803365810452476125647081062),(-11.540540540540540348501963308081 8,-16 19,8 14),(1 -10,6.5999999999999996447286321199499 -1.200000000000000177635683940025),(11.5 6.5,15 12),(19 10,11.564231738035264385189293534495 6.4886649874055422060337150469422),(-13.438785504407443127661281323526 -5.3183153770812925387190261972137,-17 -7,-12.970074812967581578959652688354 -7.7556109725685784539450651209336),(-2.3532338308457703135445626685396 -9.7462686567164187323442092747428,-1 -10,12.285714285714286475581502600107 3.2857142857142864755815026001073),(14.90000000000000035527136788005 5.9000000000000003552713678800501,15 6,14.893004115226338157640384451952 5.9012345679012341292946075554937),(11.987804878048780921062643756159 3.2195121951219514144781896902714,-11 -18),(-12.210826210826210669324609625619 -11.703703703703702387883822666481,-15 -15,-11.463576158940396609864365018439 -15.589403973509934786534358863719),(-8.9189189189189193029960733838379 -16.013513513513512265262761502527,-3 -17,-7.0297239915074314353660156484693 -14.210191082802548834251865628175),(-12.450511945392491952588898129761 -10.457337883959045399251408525743,-16 -8,-12.923076923076923350208744523115 -8),(-0.52380952380952372493538859998807 -8,18 -8),(2 -19,-2.2961165048543685784920853620861 -9.6917475728155331182733789319173),(6.0463576158940393057150686217938 -1.7284768211920527036795647291001,7 -3,6.4482758620689653028534848999698 -1.3448275862068967967388744000345),(-1.3333333333333339254522798000835 8,4 16,2.9090909090909091716525836091023 8),(0.64705882352941168633719826175366 -6.8823529411764710062016092706472,-3 -16))";
|
||||
static std::string const mikado4 = "MULTILINESTRING((-15 2,-15 -17,-6 11,-1.9358288770053475591481628725887 10.572192513368984023713892383967),(2.1545064377682408007785852532834 10.14163090128755406738036981551,6.87603305785123986026974307606 9.6446280991735537924114396446384),(8.4810810810810810522752944962122 9.475675675675674369813350494951,13 9),(-15 0,-8 9,-2.9850746268656713766631582984701 4.4865671641791049495395782287233),(-1.8235294117647056211239942058455 3.4411764705882355031008046353236,-1.1428571428571423496123315999284 2.8285714285714291804652020800859),(1.2307692307692308375521861307789 0.69230769230769229061195346730528,1.2857142857142858094476878250134 0.64285714285714290472384391250671,2 0,1.9459459459459460539676456392044 0.51351351351351348650808859019889),(1.908127208480565384363103476062 0.87279151943462895957281943992712,1.9078014184397162900097555393586 0.87588652482269502286271745106205),(1.4685990338164249813246442499803 5.0483091787439615671928550000302,0.63551401869158885560295857430901 12.962616822429906093816498469096,0 19,2.9565217391304345895264304999728 8.6521739130434784925682834000327),(0 19,3.4942528735632185643567027000245 6.770114942528735468840750399977),(4.75 2.375,5.2427184466019420838733822165523 0.65048543689320226235395239200443),(5.5384615384615383248956277384423 -0.38461538461538458122390693461057,5.7358490566037731994697423942853 -1.0754716981132084185901476303115),(5.9777777777777778567269706400111 -1.9222222222222207221875578397885,6.867052023121386739035187929403 -5.0346820809248553629799971531611,10 -16,-14 -19,-12 -12),(0 10,1.9476439790575916788384347455576 5.4554973821989527493769855936989),(-4 1,-4.2790697674418600726653494348284 0.16279069767441856075862460784265))";
|
||||
|
||||
static std::string const mysql_15_04_10 = "MULTILINESTRING((-58 19, 61 88),(1.922421e+307 1.520384e+308, 15 42, 89 -93,-89 -22),(-63 -5, -262141 -536870908, -3 87, 77 -69))";
|
||||
|
||||
template <bool Clockwise, typename P>
|
||||
void test_all()
|
||||
@@ -99,6 +98,10 @@ void test_all()
|
||||
test_one<multi_linestring_type, polygon>("mikado4_large", mikado4, join_round32, end_round32, 11212832197.267, 59772.0);
|
||||
test_one<multi_linestring_type, polygon>("mikado4_small", mikado4, join_round32, end_round32, 2103.686, 10.0);
|
||||
test_one<multi_linestring_type, polygon>("mikado4_small", mikado4, join_round32, end_flat, 1930.785, 10.0);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_BUFFER_INCLUDE_FAILING_TESTS
|
||||
test_one<multi_linestring_type, polygon>("mysql_15_04_10", mysql_15_04_10, join_round32, end_round32, 29151950703.779/*something big*/, 0x98);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
#include <test_buffer.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
|
||||
static std::string const simplex = "MULTIPOINT((5 5),(7 7))";
|
||||
static std::string const three = "MULTIPOINT((5 8),(9 8),(7 11))";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
#include <test_buffer.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
|
||||
|
||||
static std::string const simplex
|
||||
= "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))";
|
||||
|
||||
@@ -542,13 +542,17 @@ void test_buffer(std::string const& caseid, Geometry const& geometry,
|
||||
|
||||
if (expected_area > -0.1)
|
||||
{
|
||||
double const difference = area - expected_area;
|
||||
BOOST_CHECK_MESSAGE
|
||||
(
|
||||
bg::math::abs(area - expected_area) < tolerance,
|
||||
bg::math::abs(difference) < tolerance,
|
||||
complete.str() << " not as expected. "
|
||||
<< std::setprecision(18)
|
||||
<< " Expected: " << expected_area
|
||||
<< " Detected: " << area
|
||||
<< " Expected: " << expected_area
|
||||
<< " Detected: " << area
|
||||
<< " Diff: " << difference
|
||||
<< std::setprecision(3)
|
||||
<< " , " << 100.0 * (difference / expected_area) << "%"
|
||||
);
|
||||
|
||||
if (check_self_intersections)
|
||||
|
||||
@@ -145,6 +145,7 @@ void test_large_integers()
|
||||
bg::centroid(double_poly, double_centroid);
|
||||
|
||||
int_point_type double_centroid_as_int;
|
||||
bg::assign_zero(double_centroid_as_int);
|
||||
bg::assign(int_centroid, double_centroid_as_int);
|
||||
|
||||
BOOST_CHECK_EQUAL(bg::get<0>(int_centroid), bg::get<0>(double_centroid_as_int));
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-detail
|
||||
:
|
||||
[ run as_range.cpp ]
|
||||
[ run partition.cpp ]
|
||||
;
|
||||
|
||||
|
||||
79
test/algorithms/detail/as_range.cpp
Normal file
79
test/algorithms/detail/as_range.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// 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 <geometry_test_common.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/views/detail/range_type.hpp>
|
||||
#include <boost/geometry/algorithms/detail/as_range.hpp>
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
template <int D, typename Range>
|
||||
double sum(Range const& range)
|
||||
{
|
||||
double s = 0.0;
|
||||
for (typename boost::range_const_iterator<Range>::type it = boost::begin(range);
|
||||
it != boost::end(range); ++it)
|
||||
{
|
||||
s += bg::get<D>(*it);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename G>
|
||||
void test_geometry(std::string const& wkt, double expected_x, double expected_y)
|
||||
{
|
||||
G geometry;
|
||||
|
||||
// Declare a range-type, compatible with boost::range,
|
||||
// such that range_iterator etc could be called
|
||||
typedef typename bg::detail::range_type<G>::type range_type;
|
||||
|
||||
bg::read_wkt(wkt, geometry);
|
||||
|
||||
double s = sum<0>(bg::detail::as_range<range_type>(geometry));
|
||||
BOOST_CHECK_CLOSE(s, expected_x, 0.001);
|
||||
|
||||
s = sum<1>(bg::detail::as_range<range_type>(geometry));
|
||||
BOOST_CHECK_CLOSE(s, expected_y, 0.001);
|
||||
}
|
||||
|
||||
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
// As-range utility should consider a geometry as a range, so
|
||||
// linestring stays linestring
|
||||
test_geometry<bg::model::linestring<P> >("LINESTRING(1 2,3 4)", 4, 6);
|
||||
|
||||
// polygon will only be outer-ring
|
||||
test_geometry<bg::model::polygon<P> >("POLYGON((1 2,3 4))", 4, 6);
|
||||
test_geometry<bg::model::polygon<P> >("POLYGON((1 2,3 4),(5 6,7 8,9 10))", 4, 6);
|
||||
|
||||
// the utility is useful for:
|
||||
// - convex hull (holes do not count)
|
||||
// - envelope (idem)
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -11,14 +11,13 @@
|
||||
|
||||
|
||||
#include <boost/geometry/geometry.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/register/point.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/partition.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#if defined(TEST_WITH_SVG)
|
||||
# include <boost/geometry/io/svg/svg_mapper.hpp>
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-distance
|
||||
:
|
||||
[ run distance.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run distance_areal_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run distance_linear_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run distance.cpp ]
|
||||
[ run distance_areal_areal.cpp ]
|
||||
[ run distance_linear_areal.cpp ]
|
||||
[ run distance_linear_linear.cpp ]
|
||||
[ run distance_pointlike_areal.cpp ]
|
||||
[ run distance_pointlike_linear.cpp ]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@@ -30,12 +30,6 @@
|
||||
#include <test_geometries/custom_segment.hpp>
|
||||
#include <test_geometries/wrapped_boost_array.hpp>
|
||||
|
||||
// includes for multi-geometries
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -79,12 +79,12 @@ void test_distance_polygon_multipolygon(Strategy const& strategy)
|
||||
tester::apply("polygon((12 0,14 0,19 0,19.9 -1,12 0))",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
0.1, 0.01, strategy, true);
|
||||
0.1, 0.01, strategy);
|
||||
|
||||
tester::apply("polygon((19 0,19.9 -1,12 0,20.5 0.5,19 0))",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -155,12 +155,12 @@ void test_distance_multipolygon_ring(Strategy const& strategy)
|
||||
tester::apply("multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
"polygon((12 0,14 0,19 0,19.9 -1,12 0))",
|
||||
0.1, 0.01, strategy, true);
|
||||
0.1, 0.01, strategy);
|
||||
|
||||
tester::apply("multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
"polygon((19 0,19.9 -1,12 0,20.5 0.5,19 0))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -84,27 +84,27 @@ void test_distance_linestring_polygon(Strategy const& strategy)
|
||||
|
||||
tester::apply("linestring(-1 20,1 20,1 30)",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
10, 100, strategy, true);
|
||||
10, 100, strategy);
|
||||
|
||||
tester::apply("linestring(-5 1,-2 1)",
|
||||
"polygon((0 0,10 0,10 10,0 10,0 0))",
|
||||
2, 4, strategy, true);
|
||||
2, 4, strategy);
|
||||
|
||||
tester::apply("linestring(-1 20,1 20,1 5)",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("linestring(-1 20,1 20,1 -20)",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("linestring(-2 1)",
|
||||
"polygon((0 0,10 0,10 10,0 10,0 0))",
|
||||
2, 4, strategy, true);
|
||||
2, 4, strategy);
|
||||
|
||||
tester::apply("linestring(-5 1,-2 1)",
|
||||
"polygon((0 0))",
|
||||
sqrt(5.0), 5, strategy, true);
|
||||
sqrt(5.0), 5, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -123,7 +123,7 @@ void test_distance_linestring_open_polygon(Strategy const& strategy)
|
||||
|
||||
tester::apply("linestring(-5 1,-2 1)",
|
||||
"polygon((0 0,10 0,10 10,0 10))",
|
||||
2, 4, strategy, true);
|
||||
2, 4, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -142,23 +142,23 @@ void test_distance_multilinestring_polygon(Strategy const& strategy)
|
||||
|
||||
tester::apply("multilinestring((-100 -100,-90 -90),(-1 20,1 20,1 30))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
10, 100, strategy, true);
|
||||
10, 100, strategy);
|
||||
|
||||
tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 5))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 -20))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("multilinestring((-100 -100,-90 -90),(1 20))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
10, 100, strategy, true);
|
||||
10, 100, strategy);
|
||||
|
||||
tester::apply("multilinestring((-100 -100,-90 -90),(-1 20,1 20,1 30))",
|
||||
"polygon((-110 -110))",
|
||||
sqrt(200.0), 200, strategy, true);
|
||||
sqrt(200.0), 200, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -213,22 +213,22 @@ void test_distance_linestring_multipolygon(Strategy const& strategy)
|
||||
tester::apply("linestring(-1 20,1 20)",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((0 22,-1 30, 2 40,0 22)))",
|
||||
2, 4, strategy, true);
|
||||
2, 4, strategy);
|
||||
|
||||
tester::apply("linestring(12 0,14 0)",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
2, 4, strategy, true);
|
||||
2, 4, strategy);
|
||||
|
||||
tester::apply("linestring(12 0,20.5 0.5)",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("linestring(12 0,50 0)",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -247,11 +247,11 @@ void test_distance_linestring_open_multipolygon(Strategy const& strategy)
|
||||
|
||||
tester::apply("linestring(-5 1,-2 1)",
|
||||
"multipolygon(((0 0,10 0,10 10,0 10)))",
|
||||
2, 4, strategy, true);
|
||||
2, 4, strategy);
|
||||
|
||||
tester::apply("linestring(-5 1,-3 1)",
|
||||
"multipolygon(((20 20,21 20,21 21,20 21)),((0 0,10 0,10 10,0 10)))",
|
||||
3, 9, strategy, true);
|
||||
3, 9, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -271,12 +271,12 @@ void test_distance_multilinestring_multipolygon(Strategy const& strategy)
|
||||
tester::apply("multilinestring((12 0,14 0),(19 0,19.9 -1))",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10)))",
|
||||
0.1, 0.01, strategy, true);
|
||||
0.1, 0.01, strategy);
|
||||
|
||||
tester::apply("multilinestring((19 0,19.9 -1),(12 0,20.5 0.5))",
|
||||
"multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\
|
||||
((20 -1,21 2,30 -10,20 -1)))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -320,15 +320,15 @@ void test_distance_linestring_ring(Strategy const& strategy)
|
||||
|
||||
tester::apply("linestring(-1 20,1 20,1 30)",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
10, 100, strategy, true);
|
||||
10, 100, strategy);
|
||||
|
||||
tester::apply("linestring(-1 20,1 20,1 5)",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("linestring(-1 20,1 20,1 -20)",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -347,15 +347,15 @@ void test_distance_multilinestring_ring(Strategy const& strategy)
|
||||
|
||||
tester::apply("multilinestring((-100 -100,-90 -90),(-1 20,1 20,1 30))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
10, 100, strategy, true);
|
||||
10, 100, strategy);
|
||||
|
||||
tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 5))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 -20))",
|
||||
"polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -194,11 +194,11 @@ void test_distance_linestring_multilinestring(Strategy const& strategy)
|
||||
|
||||
tester::apply("linestring(1 1,2 2,3 3)",
|
||||
"multilinestring((2 1,1 2,4 0),(1 -10,2 1.9,2.1 -10,4 0))",
|
||||
0, 0, strategy, true);
|
||||
0, 0, strategy);
|
||||
|
||||
tester::apply("linestring(1 1,2 2,3 3)",
|
||||
"multilinestring((1 -10,2 0,2.1 -10,4 0),(1 -10,2 1.9,2.1 -10,4 0))",
|
||||
sqrt(0.005), 0.005, strategy, true);
|
||||
sqrt(0.005), 0.005, strategy);
|
||||
|
||||
tester::apply("linestring(1 1,2 2)",
|
||||
"multilinestring((2.5 0,4 0,5 0),(3 3,3 3))",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -49,6 +49,11 @@ void test_distance_point_segment(Strategy const& strategy)
|
||||
tester::apply("point(2 0)", "segment(2 0,3 0)", 0, 0, strategy);
|
||||
tester::apply("point(3 0)", "segment(2 0,3 0)", 0, 0, strategy);
|
||||
tester::apply("point(2.5 0)", "segment(2 0,3 0)", 0, 0, strategy);
|
||||
|
||||
// distance is a NaN
|
||||
tester::apply("POINT(4.297374e+307 8.433875e+307)",
|
||||
"SEGMENT(26 87,13 95)",
|
||||
0, 0, strategy, false);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@@ -70,6 +75,11 @@ void test_distance_point_linestring(Strategy const& strategy)
|
||||
|
||||
// linestring with a single point
|
||||
tester::apply("point(0 0)", "linestring(2 0)", 2, 4, strategy);
|
||||
|
||||
// distance is a NaN
|
||||
tester::apply("POINT(4.297374e+307 8.433875e+307)",
|
||||
"LINESTRING(26 87,13 95)",
|
||||
0, 0, strategy, false);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -44,6 +44,11 @@ void test_distance_point_point(Strategy const& strategy)
|
||||
tester::apply("point(1 1)",
|
||||
"point(1 1)",
|
||||
0, 0, strategy);
|
||||
|
||||
// distance overflows
|
||||
tester::apply("point(0 0)",
|
||||
"point(4.297374e+307 8.433875e+307)",
|
||||
0, 0, strategy, false);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
@@ -25,15 +26,12 @@
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/write.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/write.hpp>
|
||||
|
||||
#include <boost/geometry/io/dsv/write.hpp>
|
||||
#include <boost/geometry/multi/io/dsv/write.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_interior_rings.hpp>
|
||||
#include <boost/geometry/algorithms/distance.hpp>
|
||||
@@ -128,18 +126,34 @@ struct pretty_print_geometry
|
||||
template <typename T>
|
||||
struct check_equal
|
||||
{
|
||||
static inline void apply(T const& value1, T const& value2)
|
||||
static inline void apply(T const& detected, T const& expected,
|
||||
bool is_finite)
|
||||
{
|
||||
BOOST_CHECK( value1 == value2 );
|
||||
if (is_finite)
|
||||
{
|
||||
BOOST_CHECK(detected == expected);
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_CHECK(! boost::math::isfinite(detected));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct check_equal<double>
|
||||
{
|
||||
static inline void apply(double value1, double value2)
|
||||
static inline void apply(double detected, double expected,
|
||||
bool is_finite)
|
||||
{
|
||||
BOOST_CHECK_CLOSE( value1, value2, 0.0001 );
|
||||
if (is_finite)
|
||||
{
|
||||
BOOST_CHECK_CLOSE(detected, expected, 0.0001);
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_CHECK(! boost::math::isfinite(detected));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -158,8 +172,125 @@ struct test_distance_of_geometries
|
||||
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
class test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
{
|
||||
private:
|
||||
template
|
||||
<
|
||||
typename G1,
|
||||
typename G2,
|
||||
typename DistanceType,
|
||||
typename ComparableDistanceType,
|
||||
typename Strategy
|
||||
>
|
||||
static inline
|
||||
void base_test(std::string const& header,
|
||||
G1 const& g1, G2 const& g2,
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy,
|
||||
bool is_finite)
|
||||
{
|
||||
typedef typename bg::default_distance_result
|
||||
<
|
||||
G1, G2
|
||||
>::type default_distance_result;
|
||||
|
||||
typedef typename bg::strategy::distance::services::return_type
|
||||
<
|
||||
Strategy, G1, G2
|
||||
>::type distance_result_from_strategy;
|
||||
|
||||
static const bool same_regular = boost::is_same
|
||||
<
|
||||
default_distance_result,
|
||||
distance_result_from_strategy
|
||||
>::type::value;
|
||||
|
||||
BOOST_CHECK( same_regular );
|
||||
|
||||
|
||||
typedef typename bg::default_comparable_distance_result
|
||||
<
|
||||
G1, G2
|
||||
>::type default_comparable_distance_result;
|
||||
|
||||
typedef typename bg::strategy::distance::services::return_type
|
||||
<
|
||||
typename bg::strategy::distance::services::comparable_type
|
||||
<
|
||||
Strategy
|
||||
>::type,
|
||||
G1,
|
||||
G2
|
||||
>::type comparable_distance_result_from_strategy;
|
||||
|
||||
static const bool same_comparable = boost::is_same
|
||||
<
|
||||
default_comparable_distance_result,
|
||||
comparable_distance_result_from_strategy
|
||||
>::type::value;
|
||||
|
||||
BOOST_CHECK( same_comparable );
|
||||
|
||||
|
||||
// check distance with default strategy
|
||||
default_distance_result dist_def = bg::distance(g1, g2);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_distance_result
|
||||
>::apply(dist_def, expected_distance, is_finite);
|
||||
|
||||
|
||||
// check distance with passed strategy
|
||||
distance_result_from_strategy dist = bg::distance(g1, g2, strategy);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_distance_result
|
||||
>::apply(dist, expected_distance, is_finite);
|
||||
|
||||
|
||||
// check comparable distance with default strategy
|
||||
default_comparable_distance_result cdist_def =
|
||||
bg::comparable_distance(g1, g2);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_comparable_distance_result
|
||||
>::apply(cdist_def, expected_comparable_distance, is_finite);
|
||||
|
||||
|
||||
// check comparable distance with passed strategy
|
||||
comparable_distance_result_from_strategy cdist =
|
||||
bg::comparable_distance(g1, g2, strategy);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_comparable_distance_result
|
||||
>::apply(cdist, expected_comparable_distance, is_finite);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << string_from_type<typename bg::coordinate_type<Geometry1>::type>::name()
|
||||
<< string_from_type<typename bg::coordinate_type<Geometry2>::type>::name()
|
||||
<< " -> "
|
||||
<< string_from_type<default_distance_result>::name()
|
||||
<< string_from_type<default_comparable_distance_result>::name()
|
||||
<< std::endl;
|
||||
|
||||
std::cout << "distance" << header
|
||||
<< " (def. strategy) = " << dist_def << " ; "
|
||||
<< "distance" << header
|
||||
<<" (passed strategy) = " << dist << " ; "
|
||||
<< "comp. distance" << header <<" (def. strategy) = "
|
||||
<< cdist_def << " ; "
|
||||
<< "comp. distance" << header <<" (passed strategy) = "
|
||||
<< cdist << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
template
|
||||
<
|
||||
typename DistanceType,
|
||||
@@ -172,14 +303,14 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy,
|
||||
bool test_reversed = true)
|
||||
bool is_finite = true)
|
||||
{
|
||||
Geometry1 geometry1 = from_wkt<Geometry1>(wkt1);
|
||||
Geometry2 geometry2 = from_wkt<Geometry2>(wkt2);
|
||||
|
||||
apply(geometry1, geometry2,
|
||||
expected_distance, expected_comparable_distance,
|
||||
strategy, test_reversed);
|
||||
strategy, is_finite);
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +326,7 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy,
|
||||
bool test_reversed = true)
|
||||
bool is_finite = true)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
typedef pretty_print_geometry<Geometry1> PPG1;
|
||||
@@ -205,155 +336,18 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
PPG2::apply(geometry2, std::cout);
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
typedef typename bg::default_distance_result
|
||||
<
|
||||
Geometry1, Geometry2
|
||||
>::type default_distance_result;
|
||||
|
||||
typedef typename bg::strategy::distance::services::return_type
|
||||
<
|
||||
Strategy, Geometry1, Geometry2
|
||||
>::type distance_result_from_strategy;
|
||||
base_test("", geometry1, geometry2,
|
||||
expected_distance, expected_comparable_distance,
|
||||
strategy, is_finite);
|
||||
|
||||
static const bool same_regular = boost::is_same
|
||||
<
|
||||
default_distance_result,
|
||||
distance_result_from_strategy
|
||||
>::type::value;
|
||||
|
||||
BOOST_CHECK( same_regular );
|
||||
|
||||
|
||||
typedef typename bg::default_comparable_distance_result
|
||||
<
|
||||
Geometry1, Geometry2
|
||||
>::type default_comparable_distance_result;
|
||||
|
||||
typedef typename bg::strategy::distance::services::return_type
|
||||
<
|
||||
typename bg::strategy::distance::services::comparable_type
|
||||
<
|
||||
Strategy
|
||||
>::type,
|
||||
Geometry1,
|
||||
Geometry2
|
||||
>::type comparable_distance_result_from_strategy;
|
||||
|
||||
static const bool same_comparable = boost::is_same
|
||||
<
|
||||
default_comparable_distance_result,
|
||||
comparable_distance_result_from_strategy
|
||||
>::type::value;
|
||||
|
||||
BOOST_CHECK( same_comparable );
|
||||
|
||||
|
||||
// check distance with default strategy
|
||||
default_distance_result dist_def = bg::distance(geometry1, geometry2);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_distance_result
|
||||
>::apply(dist_def, expected_distance);
|
||||
|
||||
|
||||
// check distance with passed strategy
|
||||
distance_result_from_strategy dist =
|
||||
bg::distance(geometry1, geometry2, strategy);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_distance_result
|
||||
>::apply(dist, expected_distance);
|
||||
|
||||
|
||||
// check comparable distance with default strategy
|
||||
default_comparable_distance_result cdist_def =
|
||||
bg::comparable_distance(geometry1, geometry2);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_comparable_distance_result
|
||||
>::apply(cdist_def, expected_comparable_distance);
|
||||
|
||||
|
||||
// check comparable distance with passed strategy
|
||||
comparable_distance_result_from_strategy cdist =
|
||||
bg::comparable_distance(geometry1, geometry2, strategy);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_comparable_distance_result
|
||||
>::apply(cdist, expected_comparable_distance);
|
||||
base_test("[reversed args]", geometry2, geometry1,
|
||||
expected_distance, expected_comparable_distance,
|
||||
strategy, is_finite);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << string_from_type<typename bg::coordinate_type<Geometry1>::type>::name()
|
||||
<< string_from_type<typename bg::coordinate_type<Geometry2>::type>::name()
|
||||
<< " -> "
|
||||
<< string_from_type<default_distance_result>::name()
|
||||
<< string_from_type<default_comparable_distance_result>::name()
|
||||
<< std::endl;
|
||||
std::cout << "distance (default strategy) = " << dist_def << " ; "
|
||||
<< "distance (passed strategy) = " << dist << " ; "
|
||||
<< "comp. distance (default strategy) = "
|
||||
<< cdist_def << " ; "
|
||||
<< "comp. distance (passed strategy) = "
|
||||
<< cdist << std::endl;
|
||||
|
||||
if ( !test_reversed )
|
||||
{
|
||||
std::cout << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
if ( test_reversed )
|
||||
{
|
||||
// check distance with default strategy
|
||||
dist_def = bg::distance(geometry2, geometry1);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_distance_result
|
||||
>::apply(dist_def, expected_distance);
|
||||
|
||||
|
||||
// check distance with given strategy
|
||||
dist = bg::distance(geometry2, geometry1, strategy);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_distance_result
|
||||
>::apply(dist, expected_distance);
|
||||
|
||||
|
||||
// check comparable distance with default strategy
|
||||
cdist_def = bg::comparable_distance(geometry2, geometry1);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_comparable_distance_result
|
||||
>::apply(cdist_def, expected_comparable_distance);
|
||||
|
||||
// check comparable distance with given strategy
|
||||
cdist = bg::comparable_distance(geometry2, geometry1, strategy);
|
||||
|
||||
check_equal
|
||||
<
|
||||
default_comparable_distance_result
|
||||
>::apply(cdist, expected_comparable_distance);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "distance[reversed args] (def. startegy) = "
|
||||
<< dist_def << " ; "
|
||||
<< "distance[reversed args] (passed startegy) = "
|
||||
<< dist << " ; "
|
||||
<< "comp. distance[reversed args] (def. strategy) = "
|
||||
<< cdist_def << " ; "
|
||||
<< "comp. distance[reversed args] (passed strategy) = "
|
||||
<< cdist << std::endl;
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -383,7 +377,8 @@ struct test_distance_of_geometries
|
||||
std::string const& wkt_polygon,
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy)
|
||||
Strategy const& strategy,
|
||||
bool is_finite = true)
|
||||
{
|
||||
Segment segment = from_wkt<Segment>(wkt_segment);
|
||||
Polygon polygon = from_wkt<Polygon>(wkt_polygon);
|
||||
@@ -391,7 +386,8 @@ struct test_distance_of_geometries
|
||||
polygon,
|
||||
expected_distance,
|
||||
expected_comparable_distance,
|
||||
strategy);
|
||||
strategy,
|
||||
is_finite);
|
||||
}
|
||||
|
||||
|
||||
@@ -406,10 +402,12 @@ struct test_distance_of_geometries
|
||||
Polygon const& polygon,
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy)
|
||||
Strategy const& strategy,
|
||||
bool is_finite = true)
|
||||
{
|
||||
base::apply(segment, polygon, expected_distance,
|
||||
expected_comparable_distance, strategy);
|
||||
expected_comparable_distance, strategy, is_finite);
|
||||
|
||||
if ( bg::num_interior_rings(polygon) == 0 ) {
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "... testing also exterior ring ..." << std::endl;
|
||||
@@ -421,7 +419,8 @@ struct test_distance_of_geometries
|
||||
bg::exterior_ring(polygon),
|
||||
expected_distance,
|
||||
expected_comparable_distance,
|
||||
strategy);
|
||||
strategy,
|
||||
is_finite);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -446,7 +445,8 @@ struct test_distance_of_geometries
|
||||
std::string const& wkt_segment,
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy)
|
||||
Strategy const& strategy,
|
||||
bool is_finite = true)
|
||||
{
|
||||
test_distance_of_geometries
|
||||
<
|
||||
@@ -455,7 +455,8 @@ struct test_distance_of_geometries
|
||||
wkt_box,
|
||||
expected_distance,
|
||||
expected_comparable_distance,
|
||||
strategy);
|
||||
strategy,
|
||||
is_finite);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -481,7 +482,8 @@ struct test_distance_of_geometries
|
||||
std::string const& wkt_box,
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy)
|
||||
Strategy const& strategy,
|
||||
bool is_finite = true)
|
||||
{
|
||||
Segment segment = from_wkt<Segment>(wkt_segment);
|
||||
Box box = from_wkt<Box>(wkt_box);
|
||||
@@ -489,7 +491,8 @@ struct test_distance_of_geometries
|
||||
box,
|
||||
expected_distance,
|
||||
expected_comparable_distance,
|
||||
strategy);
|
||||
strategy,
|
||||
is_finite);
|
||||
}
|
||||
|
||||
|
||||
@@ -504,7 +507,8 @@ struct test_distance_of_geometries
|
||||
Box const& box,
|
||||
DistanceType const& expected_distance,
|
||||
ComparableDistanceType const& expected_comparable_distance,
|
||||
Strategy const& strategy)
|
||||
Strategy const& strategy,
|
||||
bool is_finite = true)
|
||||
{
|
||||
typedef typename bg::strategy::distance::services::return_type
|
||||
<
|
||||
@@ -523,7 +527,7 @@ struct test_distance_of_geometries
|
||||
|
||||
|
||||
base::apply(segment, box, expected_distance,
|
||||
expected_comparable_distance, strategy);
|
||||
expected_comparable_distance, strategy, is_finite);
|
||||
|
||||
comparable_strategy cstrategy =
|
||||
bg::strategy::distance::services::get_comparable
|
||||
@@ -547,12 +551,14 @@ struct test_distance_of_geometries
|
||||
check_equal
|
||||
<
|
||||
distance_result_type
|
||||
>::apply(distance_generic, expected_distance);
|
||||
>::apply(distance_generic, expected_distance, is_finite);
|
||||
|
||||
check_equal
|
||||
<
|
||||
comparable_distance_result_type
|
||||
>::apply(comparable_distance_generic, expected_comparable_distance);
|
||||
>::apply(comparable_distance_generic,
|
||||
expected_comparable_distance,
|
||||
is_finite);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "... testing with naive seg-box distance algorithm..."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
@@ -25,15 +25,12 @@
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/write.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/write.hpp>
|
||||
|
||||
#include <boost/geometry/io/dsv/write.hpp>
|
||||
#include <boost/geometry/multi/io/dsv/write.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_interior_rings.hpp>
|
||||
#include <boost/geometry/algorithms/distance.hpp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,14 +8,11 @@
|
||||
|
||||
#include <algorithms/test_area.hpp>
|
||||
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@@ -17,18 +17,12 @@
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/algorithms/centroid.hpp>
|
||||
#include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/strategies/cartesian/centroid_average.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
|
||||
// #define REPORT_RESULTS
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -9,17 +9,11 @@
|
||||
|
||||
#include <boost/geometry/algorithms/clear.hpp>
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/multi/algorithms/clear.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
// 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.
|
||||
// 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 <algorithms/test_convert.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/convert.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
|
||||
template <typename Point1, typename Point2>
|
||||
void test_mixed_point_types()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@@ -26,22 +26,16 @@
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/core/point_type.hpp>
|
||||
#include <boost/geometry/views/detail/range_type.hpp>
|
||||
|
||||
#include <boost/geometry/multi/views/detail/range_type.hpp>
|
||||
#include <boost/geometry/algorithms/detail/for_each_range.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/for_each_range.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -11,10 +11,7 @@
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
@@ -22,7 +19,7 @@
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@@ -15,14 +15,6 @@
|
||||
|
||||
#include <algorithms/test_envelope.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/multi/algorithms/envelope.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/adapted/c_array.hpp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,10 +8,8 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/for_each.hpp>
|
||||
#include <boost/geometry/multi/algorithms/for_each.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
@@ -20,9 +18,9 @@
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <algorithms/test_for_each.hpp>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,15 +8,8 @@
|
||||
|
||||
#include <algorithms/test_length.hpp>
|
||||
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
|
||||
|
||||
template <typename P>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -8,16 +8,11 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_geometries.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_geometries.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename Geometry>
|
||||
void test_geometry(std::string const& wkt, int expected)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -8,16 +8,11 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_interior_rings.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_interior_rings.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename Geometry>
|
||||
void test_geometry(std::string const& wkt, int expected)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -8,16 +8,14 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,14 +8,12 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/perimeter.hpp>
|
||||
#include <boost/geometry/multi/algorithms/perimeter.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <algorithms/test_perimeter.hpp>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,18 +8,12 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/reverse.hpp>
|
||||
#include <boost/geometry/multi/algorithms/reverse.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <algorithms/test_reverse.hpp>
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
// 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.
|
||||
// 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 <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/simplify.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
@@ -20,9 +15,9 @@
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <algorithms/test_simplify.hpp>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@@ -22,14 +22,7 @@
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/transform.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
|
||||
// This test is a little different from transform.cpp test.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,18 +8,10 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/unique.hpp>
|
||||
#include <boost/geometry/multi/algorithms/unique.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <algorithms/test_unique.hpp>
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2015 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,12 +15,9 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
template <std::size_t D, typename T = double>
|
||||
struct box_dD
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
test-suite boost-geometry-algorithms-overlay
|
||||
:
|
||||
[ run assemble.cpp ]
|
||||
[ run ccw_traverse.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run ccw_traverse.cpp ]
|
||||
[ run get_turn_info.cpp ]
|
||||
[ run get_turns.cpp ]
|
||||
[ run get_turns_areal_areal.cpp ]
|
||||
[ run get_turns_linear_linear.cpp ]
|
||||
[ run get_turns_linear_areal.cpp ]
|
||||
[ run multi_traverse.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <define>BOOST_GEOMETRY_RESCALE_TO_ROBUST ]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,9 +17,8 @@
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
|
||||
#include <test_common/test_point.hpp>
|
||||
|
||||
62
test/algorithms/overlay/get_turns_areal_areal.cpp
Normal file
62
test/algorithms/overlay/get_turns_areal_areal.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
// Boost.Geometry
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2015.
|
||||
// Modifications copyright (c) 2015 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,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "test_get_turns.hpp"
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
//TEST
|
||||
//#include <to_svg.hpp>
|
||||
|
||||
template <typename T>
|
||||
void test_all()
|
||||
{
|
||||
typedef bg::model::point<T, 2, bg::cs::cartesian> pt;
|
||||
//typedef bg::model::ring<pt> ring;
|
||||
typedef bg::model::polygon<pt> poly;
|
||||
//typedef bg::model::multi_polygon<polygon> mpoly;
|
||||
|
||||
// mailing list report 17.03.2015
|
||||
// operations ok but wrong IPs for int
|
||||
// (the coordinates are generates at endpoints only)
|
||||
{
|
||||
// cw(duplicated point)
|
||||
test_geometry<poly, poly>("POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))",
|
||||
"POLYGON((-7901 -1485,-7901 529,-7901 529, 15802 544, 15802 -1485, -7901 -1485))",
|
||||
expected_pusher<0>()("iiu")("iui")("mcc")("cui"));
|
||||
//to_svg<poly, poly>("POLYGON((-8042 -1485,-8042 250,15943 254,15943 -1485,-8042 -1485))",
|
||||
// "POLYGON((-7901 -1485,-7901 529,15802 544, 15802 -1485, -7901 -1485))",
|
||||
// "poly_poly_1.svg");
|
||||
test_geometry<poly, poly>("POLYGON((-7901 -1485,-7901 529,-7901 529, 15802 544, 15802 -1485, -7901 -1485))",
|
||||
"POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))",
|
||||
expected_pusher<0>()("iui")("iiu")("mcc")("ciu"));
|
||||
}
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<int>();
|
||||
test_all<float>();
|
||||
test_all<double>();
|
||||
|
||||
#if ! defined(_MSC_VER)
|
||||
test_all<long double>();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TTMATH)
|
||||
test_all<ttmath_big>();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
//TEST
|
||||
#include <to_svg.hpp>
|
||||
//#include <to_svg.hpp>
|
||||
|
||||
template <typename T>
|
||||
void test_all()
|
||||
@@ -224,7 +224,7 @@ void test_all()
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(3 -0.6,1 -0.8,0 -0.9)",
|
||||
"LINESTRING(4 2.232432,1 -0.8,9 0)",
|
||||
expected("tuu++"));
|
||||
expected("tui=+")("miu+="));
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(3 -0.6, 0 -0.9, -1 -1)",
|
||||
"LINESTRING(4 2.232432, 0 -0.9, 9 0)",
|
||||
@@ -267,18 +267,23 @@ void test_all()
|
||||
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) )
|
||||
{
|
||||
// BUG - the operations are correct but IP coordinates are wrong
|
||||
// ok now also the 3rd turn is wrong
|
||||
#ifdef BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
test_geometry<ls, ls>("LINESTRING(8 5,5 1,-2 3,1 10)",
|
||||
"LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -1.0071942446043165 5.316546762589928)",
|
||||
expected("mii++")("ccc==")("tuu++"));
|
||||
expected("mii++")("ccc==")("ccc==")("mux=="));
|
||||
// Now tii++ is generated instead of ccc==
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(8 5,5 1,-2 3,1 10)",
|
||||
"LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -0.5 6.5)",
|
||||
expected("mii++")("ccc==")("tii++")("mux=="));
|
||||
expected("mii++")("ccc==")("ccc==")("mux=="));
|
||||
// Now tii++ is generated instead of ccc==
|
||||
|
||||
#endif
|
||||
|
||||
// FAILING - wrong number of turns
|
||||
test_geometry<ls, ls>("LINESTRING(-0.5 7,8 1,0 -0.2)",
|
||||
"LINESTRING(2 8,4 0.4,8 1,0 5)",
|
||||
//expected("iuu++")("mui=+")("tiu+="));
|
||||
expected("")(""));
|
||||
expected("iuu++")("mui=+")("tiu+="));
|
||||
|
||||
// assertion failure in 1.57
|
||||
// FAILING - no assertion failure but the result is not very good
|
||||
@@ -290,6 +295,63 @@ void test_all()
|
||||
expected("")(""));
|
||||
}
|
||||
|
||||
// In 1.57 the results of those combinations was different for MinGW
|
||||
// (probably also QCC and GCC5.0) and MSVC/GCC. The results was depending
|
||||
// on the instructions generated by the compiler when calculating the
|
||||
// determinants.
|
||||
// See also: https://svn.boost.org/trac/boost/ticket/8379
|
||||
// https://github.com/boostorg/geometry/pull/259
|
||||
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) )
|
||||
{
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)",
|
||||
"LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)",
|
||||
expected("mii++")("ccc==")("mux=="));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 110 1)",
|
||||
"LINESTRING(12 10, 13 0.03, 14 0.04, 15 0.05)",
|
||||
expected("mii++")("ccc==")("mux=="));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 110 1)",
|
||||
"LINESTRING(102 10, 103 0.93, 104 0.94, 105 0.95)",
|
||||
expected("mii++")("ccc==")("mux=="));
|
||||
test_geometry<ls, ls>("LINESTRING(100 0, 110 0, 120 1)",
|
||||
"LINESTRING(112 10, 113 0.3, 114 0.4, 115 0.5)",
|
||||
expected("mii++")("ccc==")("mux=="));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)",
|
||||
"LINESTRING(15 0.5, 14 0.4, 13 0.3, 12 10)",
|
||||
expected("miu+=")("mui=+"));
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)",
|
||||
"LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)",
|
||||
expected("mui=+")("mix+="));
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)",
|
||||
"LINESTRING(15 0.5, 14 0.4, 13 0.3, 12 10)",
|
||||
expected("muu==")("ccc==")("mii++"));
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)",
|
||||
"LINESTRING(13 0.3, 14 0.4, 15 0.5)",
|
||||
expected("mii++")("ccc==")("mux=="));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)",
|
||||
"LINESTRING(15 0.5, 14 0.4, 13 0.3)",
|
||||
expected("mix+=")("mui=+"));
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)",
|
||||
"LINESTRING(13 0.3, 14 0.4, 15 0.5)",
|
||||
expected("mui=+")("mix+="));
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)",
|
||||
"LINESTRING(15 0.5, 14 0.4, 13 0.3)",
|
||||
expected("mux==")("ccc==")("mii++"));
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)",
|
||||
"LINESTRING(12 10, 13 0.3, 14 0.4)",
|
||||
expected("mii++")("mux=="));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)",
|
||||
"LINESTRING(14 0.4, 13 0.3, 12 10)",
|
||||
expected("miu+=")("mui=+"));
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)",
|
||||
"LINESTRING(12 10, 13 0.3, 14 0.4)",
|
||||
expected("mui=+")("mix+="));
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)",
|
||||
"LINESTRING(14 0.4, 13 0.3, 12 10)",
|
||||
expected("muu==")("mii++"));
|
||||
}
|
||||
|
||||
// TODO:
|
||||
//test_geometry<ls, ls>("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102");
|
||||
//test_geometry<ls, ls>("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// 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)
|
||||
@@ -12,11 +12,11 @@
|
||||
#define GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
//#include <boost/geometry/multi/io/svg/write_svg.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
//#include <boost/geometry/io/svg/write_svg.hpp>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// 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,27 +15,19 @@
|
||||
#define BOOST_GEOMETRY_TEST_MULTI
|
||||
#include <algorithms/overlay/traverse.cpp>
|
||||
|
||||
#include <boost/geometry/core/closure.hpp>
|
||||
#include <boost/geometry/core/geometry_id.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/envelope.hpp>
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/sections/range_by_section.hpp>
|
||||
#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/closure.hpp>
|
||||
#include <boost/geometry/multi/core/geometry_id.hpp>
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/core/ring_type.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
#include <boost/geometry/multi/algorithms/envelope.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/views/detail/range_type.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/views/detail/range_type.hpp>
|
||||
|
||||
|
||||
#include "multi_overlay_cases.hpp"
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
//
|
||||
// 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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -833,7 +839,29 @@ static std::string ticket_10747_e[2] =
|
||||
"POLYGON((0.00000025165824 0.00000025165824,0.00000041943040 0.00000025165824,0.00000041943040 0.00000041943040,0.00000025165824 0.00000041943040,0.00000025165824 0.00000025165824))"
|
||||
};
|
||||
|
||||
static std::string ticket_10658[2] =
|
||||
{
|
||||
"POLYGON((516 1608,1308 1932,2094 2466,2094 32767,516 32767,516 1608))",
|
||||
"POLYGON((516 2484,1308 3066,2094 3150,2094 32767,516 32767,516 2484))"
|
||||
};
|
||||
|
||||
static std::string ticket_10835[3] =
|
||||
{
|
||||
"MULTILINESTRING((5239 2113,1020 2986))",
|
||||
"POLYGON((5233 2113,5200 2205,1020 2205,1020 2022,5200 2022))",
|
||||
"POLYGON((5233 2986,5200 3078,1020 3078,1020 2895,5200 2895))"
|
||||
};
|
||||
|
||||
static std::string ticket_10868[2] =
|
||||
{
|
||||
"POLYGON((42817136 -3774506,43029074 -3929862,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575,35332375 2413654,35725796 2024148))",
|
||||
"POLYGON((-33386239 -33721784,33721785 -33386239,33386240 33721785,-33721784 33386240))"
|
||||
};
|
||||
|
||||
static std::string ticket_11121[2] =
|
||||
{
|
||||
"POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))",
|
||||
"POLYGON((-7901 -1485,-7901 529,-7901 529,15802 544,15802 -1485,-7901 -1485))"
|
||||
};
|
||||
|
||||
#endif // BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP
|
||||
|
||||
@@ -156,6 +156,10 @@ void check_geometry_range(
|
||||
|
||||
bool ok = boost::size(expected) == turns.size();
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::vector<turn_info> turns_dbg = turns;
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_MESSAGE(ok,
|
||||
"get_turns: " << wkt1 << " and " << wkt2
|
||||
<< " -> Expected turns #: " << boost::size(expected) << " detected turns #: " << turns.size());
|
||||
@@ -170,11 +174,43 @@ void check_geometry_range(
|
||||
turns.erase(it);
|
||||
else
|
||||
{
|
||||
ok = false;
|
||||
BOOST_CHECK_MESSAGE(false,
|
||||
"get_turns: " << wkt1 << " and " << wkt2
|
||||
<< " -> Expected turn: " << *sit << " not found");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
if ( !ok )
|
||||
{
|
||||
std::cout << "Coordinates: "
|
||||
<< typeid(typename bg::coordinate_type<Geometry1>::type).name()
|
||||
<< ", "
|
||||
<< typeid(typename bg::coordinate_type<Geometry2>::type).name()
|
||||
<< std::endl;
|
||||
std::cout << "Detected: ";
|
||||
if ( turns_dbg.empty() )
|
||||
{
|
||||
std::cout << "{empty}";
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( typename std::vector<turn_info>::const_iterator it = turns_dbg.begin() ;
|
||||
it != turns_dbg.end() ; ++it )
|
||||
{
|
||||
if ( it != turns_dbg.begin() )
|
||||
std::cout << ", ";
|
||||
std::cout << bg::method_char(it->method);
|
||||
std::cout << bg::operation_char(it->operations[0].operation);
|
||||
std::cout << bg::operation_char(it->operations[1].operation);
|
||||
std::cout << equal_turn<1>::is_colinear_char(it->operations[0].is_collinear);
|
||||
std::cout << equal_turn<1>::is_colinear_char(it->operations[1].is_collinear);
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2, typename Expected>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -57,8 +57,7 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/write.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
|
||||
|
||||
#if defined(TEST_WITH_SVG)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@@ -43,11 +43,7 @@
|
||||
#include <algorithms/overlay/overlay_cases.hpp>
|
||||
|
||||
#if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI)
|
||||
# include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
# include <boost/geometry/multi/algorithms/within.hpp>
|
||||
# include <boost/geometry/multi/algorithms/detail/extreme_points.hpp>
|
||||
# include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
# include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
# include <boost/geometry/algorithms/detail/extreme_points.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-relational
|
||||
:
|
||||
[ run covered_by.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run crosses.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run equals.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run intersects.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_covered_by.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_equals.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_intersects.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_touches.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run overlaps.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run touches.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run covered_by.cpp ]
|
||||
[ run crosses.cpp ]
|
||||
[ run equals.cpp ]
|
||||
[ run intersects.cpp ]
|
||||
[ run multi_covered_by.cpp ]
|
||||
[ run multi_equals.cpp ]
|
||||
[ run multi_intersects.cpp ]
|
||||
[ run multi_touches.cpp ]
|
||||
[ run overlaps.cpp ]
|
||||
[ run touches.cpp ]
|
||||
;
|
||||
|
||||
build-project disjoint ;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-disjoint
|
||||
:
|
||||
[ run disjoint.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run disjoint_coverage.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_disjoint.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run disjoint.cpp ]
|
||||
[ run disjoint_coverage.cpp ]
|
||||
[ run multi_disjoint.cpp ]
|
||||
;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -19,25 +19,13 @@
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/write.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/write.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/io/dsv/write.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/segment.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/disjoint.hpp>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -12,17 +12,6 @@
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/point_on_border.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/for_each_range.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp>
|
||||
#include <boost/geometry/multi/core/closure.hpp>
|
||||
#include <boost/geometry/multi/core/geometry_id.hpp>
|
||||
#include <boost/geometry/multi/core/ring_type.hpp>
|
||||
#include <boost/geometry/multi/views/detail/range_type.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@@ -22,8 +22,7 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/disjoint.hpp>
|
||||
#include <boost/geometry/multi/algorithms/disjoint.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
|
||||
template <typename G1, typename G2>
|
||||
|
||||
@@ -18,15 +18,6 @@
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/topological_dimension.hpp>
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/core/closure.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp>
|
||||
#include <boost/geometry/multi/algorithms/equals.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
namespace bgm = bg::model;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -11,16 +11,13 @@
|
||||
#include <boost/geometry/algorithms/covered_by.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include "test_covered_by.hpp"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -8,15 +8,10 @@
|
||||
|
||||
#include "test_equals.hpp"
|
||||
|
||||
#include <boost/geometry/multi/algorithms/area.hpp>
|
||||
#include <boost/geometry/multi/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/area.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
|
||||
|
||||
template <typename P>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename P>
|
||||
void test_all()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -8,24 +8,9 @@
|
||||
|
||||
#include "test_touches.hpp"
|
||||
|
||||
#include <boost/geometry/multi/algorithms/area.hpp>
|
||||
#include <boost/geometry/multi/algorithms/num_geometries.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/for_each_range.hpp>
|
||||
#include <boost/geometry/multi/core/closure.hpp>
|
||||
#include <boost/geometry/multi/core/geometry_id.hpp>
|
||||
#include <boost/geometry/multi/core/topological_dimension.hpp>
|
||||
#include <boost/geometry/multi/core/ring_type.hpp>
|
||||
#include <boost/geometry/multi/views/detail/range_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/area.hpp>
|
||||
#include <boost/geometry/algorithms/num_geometries.hpp>
|
||||
#include <boost/geometry/algorithms/within.hpp>
|
||||
|
||||
|
||||
template <typename P>
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-relate
|
||||
:
|
||||
[ run relate_areal_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run relate_linear_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run relate_linear_linear.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run relate_pointlike_xxx.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run relate_areal_areal.cpp ]
|
||||
[ run relate_linear_areal.cpp ]
|
||||
[ run relate_linear_linear.cpp ]
|
||||
[ run relate_pointlike_xxx.cpp ]
|
||||
;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2015 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
|
||||
@@ -22,13 +22,10 @@
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
void check_geometry(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2015 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
|
||||
@@ -14,27 +14,20 @@
|
||||
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/core/geometry_id.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/algorithms/intersects.hpp>
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/geometry_id.hpp>
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/core/ring_type.hpp>
|
||||
#include <boost/geometry/multi/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/point_on_border.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
|
||||
#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp>
|
||||
#include <boost/geometry/multi/views/detail/range_type.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
void test_geometry(std::string const& wkt1,
|
||||
std::string const& wkt2, bool expected)
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-within
|
||||
:
|
||||
[ run multi_within.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run within.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run within_areal_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run within_linear_areal.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run within_linear_linear.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run within_pointlike_xxx.cpp : : : <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_within.cpp ]
|
||||
[ run within.cpp ]
|
||||
[ run within_areal_areal.cpp ]
|
||||
[ run within_linear_areal.cpp ]
|
||||
[ run within_linear_linear.cpp ]
|
||||
[ run within_pointlike_xxx.cpp ]
|
||||
;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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.
|
||||
// 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)
|
||||
@@ -8,19 +8,14 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/within.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include "test_within.hpp"
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
@@ -38,10 +39,6 @@
|
||||
|
||||
#include <boost/geometry/algorithms/within.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
void check_geometry(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,10 +17,9 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename P>
|
||||
void test_all()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
@@ -18,8 +18,7 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename P>
|
||||
void test_a_a()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,9 +17,8 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename P>
|
||||
void test_l_a()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
|
||||
template <typename P>
|
||||
void test_l_l()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -17,10 +17,9 @@
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/multi.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
template <typename P>
|
||||
void test_p_p()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2015 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
|
||||
@@ -36,14 +36,7 @@
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI)
|
||||
|
||||
# include <boost/geometry/multi/algorithms/remove_spikes.hpp>
|
||||
|
||||
# include <boost/geometry/multi/algorithms/area.hpp>
|
||||
# include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
# include <boost/geometry/multi/algorithms/perimeter.hpp>
|
||||
# include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
# include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
# include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-difference
|
||||
:
|
||||
[ run difference.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run difference.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run difference_linear_linear.cpp ]
|
||||
[ run difference_pl_l.cpp ]
|
||||
[ run difference_pl_pl.cpp ]
|
||||
[ run multi_difference.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_difference_spike.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_difference.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run multi_difference_spike.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
;
|
||||
|
||||
@@ -1,27 +1,30 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
// If defined, tests are run without rescaling-to-integer or robustness policy
|
||||
// Test which would fail then are disabled automatically
|
||||
// #define BOOST_GEOMETRY_NO_ROBUSTNESS
|
||||
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/perimeter.hpp>
|
||||
#include <boost/geometry/algorithms/is_valid.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
#include <boost/geometry/multi/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
|
||||
@@ -29,7 +32,6 @@
|
||||
#include <algorithms/test_overlay.hpp>
|
||||
#include <algorithms/overlay/overlay_cases.hpp>
|
||||
#include <algorithms/overlay/multi_overlay_cases.hpp>
|
||||
#include <boost/geometry/multi/io/wkt/wkt.hpp>
|
||||
|
||||
|
||||
#ifdef HAVE_TTMATH
|
||||
@@ -86,6 +88,88 @@ void test_areal_linear()
|
||||
test_one_lp<LineString, LineString, Polygon>("case27", "LINESTRING(4 4,4 5,5 5)", poly_9, 1, 3, 2.0);
|
||||
}
|
||||
|
||||
template <typename CoordinateType>
|
||||
void test_ticket_10658(std::string const& wkt_out)
|
||||
{
|
||||
typedef bg::model::point<CoordinateType, 2, bg::cs::cartesian> point_type;
|
||||
typedef bg::model::polygon
|
||||
<
|
||||
point_type, /*ClockWise*/false, /*Closed*/false
|
||||
> polygon_type;
|
||||
typedef bg::model::multi_polygon<polygon_type> multipolygon_type;
|
||||
|
||||
polygon_type polygon1;
|
||||
bg::read_wkt(ticket_10658[0], polygon1);
|
||||
polygon_type polygon2;
|
||||
bg::read_wkt(ticket_10658[1], polygon2);
|
||||
|
||||
multipolygon_type multipolygon_out;
|
||||
bg::sym_difference(polygon1, polygon2, multipolygon_out);
|
||||
std::stringstream stream;
|
||||
stream << bg::wkt(multipolygon_out);
|
||||
|
||||
BOOST_CHECK_EQUAL(stream.str(), wkt_out);
|
||||
}
|
||||
|
||||
template <typename CoordinateType>
|
||||
void test_ticket_10835(std::string const& wkt_out1, std::string const& wkt_out2)
|
||||
{
|
||||
typedef bg::model::point<CoordinateType, 2, bg::cs::cartesian> point_type;
|
||||
typedef bg::model::linestring<point_type> linestring_type;
|
||||
typedef bg::model::multi_linestring<linestring_type> multilinestring_type;
|
||||
typedef bg::model::polygon
|
||||
<
|
||||
point_type, /*ClockWise*/false, /*Closed*/false
|
||||
> polygon_type;
|
||||
|
||||
multilinestring_type multilinestring;
|
||||
bg::read_wkt(ticket_10835[0], multilinestring);
|
||||
polygon_type polygon1;
|
||||
bg::read_wkt(ticket_10835[1], polygon1);
|
||||
polygon_type polygon2;
|
||||
bg::read_wkt(ticket_10835[2], polygon2);
|
||||
|
||||
multilinestring_type multilinestringOut1;
|
||||
bg::difference(multilinestring, polygon1, multilinestringOut1);
|
||||
std::stringstream stream;
|
||||
stream << bg::wkt(multilinestringOut1);
|
||||
|
||||
BOOST_CHECK_EQUAL(stream.str(), wkt_out1);
|
||||
|
||||
multilinestring_type multilinestringOut2;
|
||||
bg::difference(multilinestringOut1, polygon2, multilinestringOut2);
|
||||
stream.str("");
|
||||
stream.clear();
|
||||
stream << bg::wkt(multilinestringOut2);
|
||||
|
||||
BOOST_CHECK_EQUAL(stream.str(), wkt_out2);
|
||||
}
|
||||
|
||||
template <typename CoordinateType>
|
||||
void test_ticket_11121()
|
||||
{
|
||||
typedef bg::model::point<CoordinateType,2,bg::cs::cartesian> point_type;
|
||||
typedef bg::model::polygon
|
||||
<
|
||||
point_type, /*ClockWise*/false, /*Closed*/false
|
||||
> polygon_type;
|
||||
typedef bg::model::multi_polygon<polygon_type> multipolygon_type;
|
||||
|
||||
polygon_type polygon1;
|
||||
bg::read_wkt(ticket_11121[0], polygon1);
|
||||
polygon_type polygon2;
|
||||
bg::read_wkt(ticket_11121[1], polygon2);
|
||||
|
||||
multipolygon_type diff12, diff21, sym_diff;
|
||||
bg::difference(polygon1, polygon2, diff12);
|
||||
bg::difference(polygon2, polygon1, diff21);
|
||||
bg::sym_difference(polygon1, polygon2, sym_diff);
|
||||
|
||||
BOOST_CHECK(bg::is_valid(diff12));
|
||||
BOOST_CHECK(bg::is_valid(diff21));
|
||||
BOOST_CHECK(bg::is_valid(sym_diff));
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
@@ -553,7 +637,17 @@ void test_specific()
|
||||
test_one<polygon, polygon, polygon>("ggl_list_20120717_volker",
|
||||
ggl_list_20120717_volker[0], ggl_list_20120717_volker[1],
|
||||
1, 11, 3371540,
|
||||
0, 0, 0, 0.001); // output is discarded
|
||||
1, 4, 384, 0.001);
|
||||
|
||||
test_one<polygon, polygon, polygon>("ticket_10658",
|
||||
ticket_10658[0], ticket_10658[1],
|
||||
1, 6, 1510434,
|
||||
0, 0, 0);
|
||||
|
||||
test_one<polygon, polygon, polygon>("ticket_11121",
|
||||
ticket_11121[0], ticket_11121[1],
|
||||
2, 8, 489763.5,
|
||||
1, 4, 6743503.5);
|
||||
}
|
||||
|
||||
|
||||
@@ -566,6 +660,22 @@ int test_main(int, char* [])
|
||||
|
||||
test_specific<bg::model::d2::point_xy<int>, false, false>();
|
||||
|
||||
test_ticket_10658<int>
|
||||
("MULTIPOLYGON(((516 2484,516 1608,1308 1932,2094 2466,2094 3150,1308 3066,516 2484)))");
|
||||
|
||||
test_ticket_10658<double>
|
||||
("MULTIPOLYGON(((516 2484,516 1608,1308 1932,2094 2466,2094 3150,1308 3066,516 2484)))");
|
||||
|
||||
test_ticket_10835<int>
|
||||
("MULTILINESTRING((5239 2113,5233 2114),(4795 2205,1020 2986))",
|
||||
"MULTILINESTRING((5239 2113,5233 2114),(4795 2205,1460 2895))");
|
||||
|
||||
test_ticket_10835<double>
|
||||
("MULTILINESTRING((5239 2113,5232.52 2114.34),(4794.39 2205,1020 2986))",
|
||||
"MULTILINESTRING((5239 2113,5232.52 2114.34),(4794.39 2205,1459.78 2895))");
|
||||
|
||||
test_ticket_11121<int>();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<bg::model::d2::point_xy<float> >();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "test_difference_linear_linear.hpp"
|
||||
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/algorithms/difference.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
@@ -548,7 +548,6 @@ BOOST_AUTO_TEST_CASE( test_difference_linestring_linestring )
|
||||
"lldf31s"
|
||||
);
|
||||
|
||||
#ifdef GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
tester::apply
|
||||
(from_wkt<L>("LINESTRING(8 1, 4 .4,2 8)"),
|
||||
from_wkt<L>("LINESTRING(0 -.2, 8 1)"),
|
||||
@@ -586,9 +585,7 @@ BOOST_AUTO_TEST_CASE( test_difference_linestring_linestring )
|
||||
"lldf31y+",
|
||||
1e-10
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
tester::apply
|
||||
(from_wkt<L>("LINESTRING(10.0002 2,9 -1032.34324, .3 8, 0 5, 8 1, 4 .4, 2 8)"),
|
||||
from_wkt<L>("LINESTRING(0 -.2, 8 1, -.5 7, 6 +.2)"),
|
||||
@@ -611,7 +608,6 @@ BOOST_AUTO_TEST_CASE( test_difference_linestring_linestring )
|
||||
from_wkt<ML>("MULTILINESTRING((0 0,4 .5),(8 1,-.5 7))"),
|
||||
"lldf32"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1157,7 +1153,6 @@ BOOST_AUTO_TEST_CASE( test_difference_multilinestring_multilinestring )
|
||||
"mlmldf19"
|
||||
);
|
||||
|
||||
#ifdef GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
tester::apply
|
||||
(from_wkt<ML>("MULTILINESTRING((1 5, -4.3 -.1), (0 6, 8.6 6, 189.7654 5, 1 3, 6 3, 3 5, 6 2.232432, 0 4), (-6 5, 1 2.232432), (3 -1032.34324, 9 0, 189.7654 1, -1.4 3, 3 189.7654, +.3 10.0002, 1 5, 6 3, 5 1, 9 1, 10.0002 -1032.34324, -0.7654 0, 5 3, 3 4), (2.232432 2.232432, 8.6 +.4, 0.0 2.232432, 4 0, -8.8 10.0002), (1 0, 6 6, 7 2, -0 8.4), (-0.7654 3, +.6 8, 4 -1032.34324, 1 6, 0 4), (0 7, 2 1, 8 -7, 7 -.7, -1032.34324 9), (5 0, 10.0002 4, 8 7, 3 3, -8.1 5))"),
|
||||
from_wkt<ML>("MULTILINESTRING((5 10.0002, 2 7, -0.7654 0, 5 3), (0 -0.7654, 4 10.0002, 4 +.1, -.8 3, -.1 8, 10.0002 2, +.9 -1032.34324))"),
|
||||
@@ -1189,7 +1184,6 @@ BOOST_AUTO_TEST_CASE( test_difference_multilinestring_multilinestring )
|
||||
"mlmldf25-r",
|
||||
1e-10
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
#include "../test_set_ops_pl_pl.hpp"
|
||||
#include "../test_set_ops_pointlike.hpp"
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
typedef bg::model::multi_point<point_type> multi_point_type;
|
||||
@@ -51,17 +51,19 @@ BOOST_AUTO_TEST_CASE( test_difference_point_point )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("ppdf01",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 1)"),
|
||||
"ppdf01");
|
||||
from_wkt<MP>("MULTIPOINT(1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("ppdf02",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"ppdf02");
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,58 +84,66 @@ BOOST_AUTO_TEST_CASE( test_difference_multipoint_point )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
("mppdf01",
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 1)"),
|
||||
"mppdf01");
|
||||
from_wkt<MP>("MULTIPOINT(1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
("mppdf02",
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppdf02");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
("mppdf03",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 1)"),
|
||||
"mppdf03");
|
||||
from_wkt<MP>("MULTIPOINT(1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
("mppdf04",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppdf04");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppdf05",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 1)"),
|
||||
"mppdf05");
|
||||
from_wkt<MP>("MULTIPOINT(1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppdf06",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppdf06");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppdf07",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppdf07");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
("mppdf08",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppdf08");
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,25 +164,28 @@ BOOST_AUTO_TEST_CASE( test_difference_point_multipoint )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("pmpdf01",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1)"),
|
||||
"pmpdf01");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("pmpdf02",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1)"),
|
||||
"pmpdf02");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("pmpdf03",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"pmpdf03");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,35 +205,40 @@ BOOST_AUTO_TEST_CASE( test_difference_multipoint_multipoint )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
("mpmpdf01",
|
||||
from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,4 4)"),
|
||||
from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2)"),
|
||||
from_wkt<MP>("MULTIPOINT(4 4)"),
|
||||
"mpmpdf01");
|
||||
from_wkt<MP>("MULTIPOINT(4 4)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
("mpmpdf02",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpdf02");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
("mpmpdf03",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
"mpmpdf03");
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
("mpmpdf04",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpdf04");
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
("mpmpdf05",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpdf05");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -27,16 +27,16 @@
|
||||
#include <algorithms/test_overlay.hpp>
|
||||
#include <algorithms/overlay/multi_overlay_cases.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
#include <boost/geometry/multi/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp> // only for testing #77
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/algorithms/within.hpp> // only for testing #77
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
template <typename Ring, typename Polygon, typename MultiPolygon>
|
||||
void test_areal()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <boost/geometry.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
|
||||
|
||||
#include "test_difference.hpp"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
@@ -30,9 +30,9 @@
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-intersection
|
||||
:
|
||||
[ run intersection.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run intersection.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run intersection_linear_linear.cpp ]
|
||||
[ run intersection_pl_l.cpp ]
|
||||
[ run intersection_pl_pl.cpp ]
|
||||
[ run multi_intersection.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_intersection.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
;
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
|
||||
// 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
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@@ -12,6 +17,7 @@
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <climits>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
@@ -19,11 +25,13 @@
|
||||
// Test which would fail then are disabled automatically
|
||||
// #define BOOST_GEOMETRY_NO_ROBUSTNESS
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/register/linestring.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/rational.hpp>
|
||||
|
||||
#include "test_intersection.hpp"
|
||||
@@ -35,6 +43,7 @@
|
||||
#include <test_common/with_pointer.hpp>
|
||||
#include <test_geometries/custom_segment.hpp>
|
||||
|
||||
|
||||
BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector)
|
||||
|
||||
|
||||
@@ -349,6 +358,7 @@ void test_boxes(std::string const& wkt1, std::string const& wkt2, double expecte
|
||||
bg::read_wkt(wkt2, box2);
|
||||
|
||||
Box box_out;
|
||||
bg::assign_zero(box_out);
|
||||
bool detected = bg::intersection(box1, box2, box_out);
|
||||
typename bg::default_area_result<Box>::type area = bg::area(box_out);
|
||||
|
||||
@@ -613,6 +623,32 @@ void test_boxes_nd()
|
||||
test_boxes_per_d(p3(0,0,0), p3(5,5,5), p3(3,3,3), p3(6,6,6), true);
|
||||
}
|
||||
|
||||
template <typename CoordinateType>
|
||||
void test_ticket_10868(std::string const& wkt_out)
|
||||
{
|
||||
typedef bg::model::point<CoordinateType, 2, bg::cs::cartesian> point_type;
|
||||
typedef bg::model::polygon
|
||||
<
|
||||
point_type, /*ClockWise*/false, /*Closed*/false
|
||||
> polygon_type;
|
||||
typedef bg::model::multi_polygon<polygon_type> multipolygon_type;
|
||||
|
||||
polygon_type polygon1;
|
||||
bg::read_wkt(ticket_10868[0], polygon1);
|
||||
polygon_type polygon2;
|
||||
bg::read_wkt(ticket_10868[1], polygon2);
|
||||
|
||||
multipolygon_type multipolygon_out;
|
||||
bg::intersection(polygon1, polygon2, multipolygon_out);
|
||||
std::stringstream stream;
|
||||
stream << bg::wkt(multipolygon_out);
|
||||
|
||||
BOOST_CHECK_EQUAL(stream.str(), wkt_out);
|
||||
|
||||
test_one<polygon_type, polygon_type, polygon_type>("ticket_10868",
|
||||
ticket_10868[0], ticket_10868[1],
|
||||
1, 7, 20266195244586);
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
@@ -636,6 +672,23 @@ int test_main(int, char* [])
|
||||
|
||||
test_boxes_nd<double>();
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
// ticket #10868 still fails for 32-bit integers
|
||||
test_ticket_10868<int32_t>("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))");
|
||||
|
||||
#if !defined(BOOST_NO_INT64) || defined(BOOST_HAS_INT64_T) || defined(BOOST_HAS_MS_INT64)
|
||||
test_ticket_10868<int64_t>("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))");
|
||||
#endif
|
||||
|
||||
if (BOOST_GEOMETRY_CONDITION(sizeof(long) * CHAR_BIT >= 64))
|
||||
{
|
||||
test_ticket_10868<long>("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))");
|
||||
}
|
||||
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
test_ticket_10868<boost::long_long_type>("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "test_intersection_linear_linear.hpp"
|
||||
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/algorithms/intersection.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
#include "../test_set_ops_pl_pl.hpp"
|
||||
#include "../test_set_ops_pointlike.hpp"
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
typedef bg::model::multi_point<point_type> multi_point_type;
|
||||
@@ -51,16 +51,18 @@ BOOST_AUTO_TEST_CASE( test_intersection_point_point )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("ppi01",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"ppi01");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("ppi02",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"ppi02");
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,52 +83,60 @@ BOOST_AUTO_TEST_CASE( test_intersection_multipoint_point )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppi01");
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
("mppi01",
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppi02");
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppi03");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
("mppi02",
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppi04");
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppi03",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppi05");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppi04",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
("mppi05",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
("mppi06",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0)"),
|
||||
"mppi06");
|
||||
from_wkt<MP>("MULTIPOINT(1 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppi07",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppi07");
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
("mppi08",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mppi08");
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,40 +156,46 @@ BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multipoint )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
("mpmpi01",
|
||||
from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,1 1)"),
|
||||
"mpmpi01");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
("mpmp02",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
"mpmpi02");
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
("mpmpi03",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpi03");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
("mpmpi04",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpi04");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
("mpmpi05",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpi05");
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"),
|
||||
("mpmpi06",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,2 0)"),
|
||||
"mpmpi06");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,2 0)")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -20,16 +20,16 @@
|
||||
#include <algorithms/test_overlay.hpp>
|
||||
#include <algorithms/overlay/multi_overlay_cases.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
#include <boost/geometry/multi/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp> // only for testing #77
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/algorithms/within.hpp> // only for testing #77
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
template <typename Ring, typename Polygon, typename MultiPolygon>
|
||||
void test_areal()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// 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)
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometry.hpp>
|
||||
#include "../test_set_ops_linear_linear.hpp"
|
||||
#include <from_wkt.hpp>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "test_sym_difference_linear_linear.hpp"
|
||||
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/algorithms/sym_difference.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <boost/geometry/policies/compare.hpp>
|
||||
#include <boost/geometry/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/reverse.hpp>
|
||||
#include <boost/geometry/multi/algorithms/reverse.hpp>
|
||||
|
||||
#include "test_get_turns_ll_invariance.hpp"
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
#ifndef BOOST_GEOMETRY_TEST_SET_OPS_PL_PL_HPP
|
||||
#define BOOST_GEOMETRY_TEST_SET_OPS_PL_PL_HPP
|
||||
#ifndef BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP
|
||||
#define BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/geometry.hpp>
|
||||
@@ -170,6 +170,54 @@ struct set_op<bg::overlay_intersection>
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename Tag = typename bg::tag<Geometry>::type
|
||||
> struct geometry_info
|
||||
{};
|
||||
|
||||
template <typename Point>
|
||||
struct geometry_info<Point, bg::point_tag>
|
||||
{
|
||||
static std::size_t const topological_dimension = 0;
|
||||
|
||||
static inline char const* name() { return "P"; }
|
||||
};
|
||||
|
||||
template <typename MultiPoint>
|
||||
struct geometry_info<MultiPoint, bg::multi_point_tag>
|
||||
{
|
||||
static std::size_t const topological_dimension = 0;
|
||||
|
||||
static inline char const* name() { return "MP"; }
|
||||
};
|
||||
|
||||
template <typename Linestring>
|
||||
struct geometry_info<Linestring, bg::linestring_tag>
|
||||
{
|
||||
static std::size_t const topological_dimension = 1;
|
||||
|
||||
static inline char const* name() { return "L"; }
|
||||
};
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct geometry_info<MultiLinestring, bg::multi_linestring_tag>
|
||||
{
|
||||
static std::size_t const topological_dimension = 1;
|
||||
|
||||
static inline char const* name() { return "ML"; }
|
||||
};
|
||||
|
||||
template <typename Segment>
|
||||
struct geometry_info<Segment, bg::segment_tag>
|
||||
{
|
||||
static std::size_t const topological_dimension = 1;
|
||||
|
||||
static inline char const* name() { return "S"; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================
|
||||
//==================================================================
|
||||
@@ -188,54 +236,78 @@ template
|
||||
class test_set_op_of_pointlike_geometries
|
||||
{
|
||||
private:
|
||||
template <typename G1, typename G2, typename MP>
|
||||
static inline void base_test(G1 const& geometry1,
|
||||
G2 const& geometry2,
|
||||
MP const& mp_expected,
|
||||
std::string const& case_id)
|
||||
template <bool Enable, typename Dummy = void>
|
||||
struct base_test
|
||||
{
|
||||
MultiPoint mp_output;
|
||||
template <typename G1, typename G2, typename MP>
|
||||
static inline void apply(std::string const& case_id,
|
||||
G1 const& geometry1,
|
||||
G2 const& geometry2,
|
||||
MP const& mp_expected)
|
||||
{
|
||||
MultiPoint mp_output;
|
||||
|
||||
set_op<OverlayType>::apply(geometry1, geometry2, mp_output);
|
||||
set_op<OverlayType>::apply(geometry1, geometry2, mp_output);
|
||||
|
||||
std::string op_name = set_op<OverlayType>::name();
|
||||
std::string op_name = set_op<OverlayType>::name();
|
||||
|
||||
BOOST_CHECK_MESSAGE( equals::apply(mp_expected, mp_output),
|
||||
op_name << " P/P: " << bg::wkt(geometry1)
|
||||
<< " " << bg::wkt(geometry2)
|
||||
<< " -> Expected: " << bg::wkt(mp_expected)
|
||||
<< " computed: " << bg::wkt(mp_output) );
|
||||
BOOST_CHECK_MESSAGE(equals::apply(mp_expected, mp_output),
|
||||
"case ID: " << case_id << ", "
|
||||
<< op_name << " "
|
||||
<< geometry_info<G1>::name() << "/"
|
||||
<< geometry_info<G2>::name() << ": "
|
||||
<< bg::wkt(geometry1)
|
||||
<< " " << bg::wkt(geometry2)
|
||||
<< " -> Expected: " << bg::wkt(mp_expected)
|
||||
<< " computed: " << bg::wkt(mp_output) );
|
||||
|
||||
set_operation_output(op_name, case_id,
|
||||
geometry1, geometry2, mp_output);
|
||||
set_operation_output(op_name, case_id,
|
||||
geometry1, geometry2, mp_output);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl;
|
||||
std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl;
|
||||
std::cout << "expected " << op_name << " : "
|
||||
<< bg::wkt(mp_expected) << std::endl;
|
||||
std::cout << op_name << " : " << bg::wkt(mp_output) << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "************************************" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl;
|
||||
std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl;
|
||||
std::cout << "expected " << op_name << " : "
|
||||
<< bg::wkt(mp_expected) << std::endl;
|
||||
std::cout << op_name << " : " << bg::wkt(mp_output) << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << "************************************" << std::endl;
|
||||
std::cout << std::endl;
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Dummy>
|
||||
struct base_test<false, Dummy>
|
||||
{
|
||||
template <typename G1, typename G2, typename MP>
|
||||
static inline void apply(std::string const&, G1 const&, G2 const&,
|
||||
MP const&)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
static inline void apply(Geometry1 const& geometry1,
|
||||
static inline void apply(std::string const& case_id,
|
||||
Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
MultiPoint const& mp_expected12,
|
||||
MultiPoint const& mp_expected21,
|
||||
std::string const& case_id)
|
||||
MultiPoint const& mp_expected21)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "test case: " << case_id << std::endl;
|
||||
#endif
|
||||
|
||||
base_test(geometry1, geometry2, mp_expected12, case_id);
|
||||
base_test(geometry2, geometry1, mp_expected21, case_id);
|
||||
base_test<true>::apply(case_id, geometry1, geometry2, mp_expected12);
|
||||
// try the same set operation with the arguments' order
|
||||
// reversed only if the two geometries are of the same
|
||||
// topological dimension
|
||||
base_test
|
||||
<
|
||||
(geometry_info<Geometry1>::topological_dimension
|
||||
== geometry_info<Geometry2>::topological_dimension)
|
||||
>::apply(case_id, geometry2, geometry1, mp_expected21);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << std::endl;
|
||||
@@ -243,15 +315,14 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static inline void apply(Geometry1 const& geometry1,
|
||||
static inline void apply(std::string const& case_id,
|
||||
Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
MultiPoint const& mp_expected,
|
||||
std::string const& case_id)
|
||||
MultiPoint const& mp_expected)
|
||||
{
|
||||
apply(geometry1, geometry2, mp_expected, mp_expected, case_id);
|
||||
apply(case_id, geometry1, geometry2, mp_expected, mp_expected);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_TEST_SET_OPS_PL_PL_HPP
|
||||
#endif // BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
test-suite boost-geometry-algorithms-union
|
||||
:
|
||||
[ run multi_union.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run union.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE <toolset>msvc:<cxxflags>/bigobj ]
|
||||
[ run multi_union.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run union.cpp : : : <define>BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ]
|
||||
[ run union_linear_linear.cpp ]
|
||||
[ run union_pl_pl.cpp ]
|
||||
;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,15 +18,15 @@
|
||||
#include <algorithms/test_overlay.hpp>
|
||||
#include <algorithms/overlay/multi_overlay_cases.hpp>
|
||||
|
||||
#include <boost/geometry/multi/algorithms/correct.hpp>
|
||||
#include <boost/geometry/multi/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/multi/algorithms/within.hpp>
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/algorithms/within.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
|
||||
#include <boost/geometry/multi/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
|
||||
|
||||
template <typename Ring, typename Polygon, typename MultiPolygon>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "test_union_linear_linear.hpp"
|
||||
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/algorithms/union.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
#include "../test_set_ops_pl_pl.hpp"
|
||||
#include "../test_set_ops_pointlike.hpp"
|
||||
|
||||
#include <boost/geometry/multi/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
typedef bg::model::multi_point<point_type> multi_point_type;
|
||||
@@ -51,16 +51,18 @@ BOOST_AUTO_TEST_CASE( test_union_point_point )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("ppu01",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1)"),
|
||||
"ppu01");
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<P>("POINT(0 0)"),
|
||||
("ppu02",
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"ppu02");
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,52 +83,60 @@ BOOST_AUTO_TEST_CASE( test_union_multipoint_point )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1)"),
|
||||
"mppu01");
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
("mppu01",
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppu02");
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 1)"),
|
||||
"mppu03");
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
("mppu02",
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppu04");
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
("mppu03",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0,1 1)"),
|
||||
"mppu05");
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(1 0)"),
|
||||
("mppu04",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
("mppu05",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
"mppu06");
|
||||
from_wkt<P>("POINT(1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 0)"),
|
||||
"mppu07");
|
||||
("mppu06",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
("mppu07",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)"),
|
||||
"mppu08");
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
("mppu08",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<P>("POINT(0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0)")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,42 +156,47 @@ BOOST_AUTO_TEST_CASE( test_union_multipoint_multipoint )
|
||||
> tester;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
("mpmpu01",
|
||||
from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,1 1,2 2,3 3,0 0,0 0,2 2)"),
|
||||
"mpmpu01");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,1 1,1 1,1 1,2 2,3 3,0 0,0 0,2 2)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
("mpmpu02",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
"mpmpu02");
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
"mpmpu03");
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
"mpmpu04");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT()"),
|
||||
("mpmpu03",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
"mpmpu05");
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,0 0)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
(from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"),
|
||||
("mpmpu04",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
("mpmpu05",
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT()"),
|
||||
from_wkt<MP>("MULTIPOINT()")
|
||||
);
|
||||
|
||||
tester::apply
|
||||
("mpmpu06",
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0,0 1,0 2)"),
|
||||
from_wkt<MP>("MULTIPOINT(0 1,0 2,1 0,0 0,2 0,3 0)"),
|
||||
"mpmpu06");
|
||||
from_wkt<MP>("MULTIPOINT(0 1,0 2,1 0,0 0,2 0,3 0)")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// 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 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
@@ -26,8 +26,7 @@
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/write.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/length.hpp>
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user