diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile
index 4c9aa41d3..aab8e217b 100644
--- a/doc/doxy/Doxyfile
+++ b/doc/doxy/Doxyfile
@@ -211,6 +211,7 @@ INPUT = . .. ../../../../boost/geometry/core \
../../../../boost/geometry/strategies/agnostic \
../../../../boost/geometry/strategies/cartesian \
../../../../boost/geometry/strategies/spherical \
+ ../../../../boost/geometry/strategies/geographic \
../../../../boost/geometry/strategies/transform \
../../../../boost/geometry/util \
../../../../boost/geometry/views \
diff --git a/doc/geometry.qbk b/doc/geometry.qbk
index 442604534..6c30c833a 100644
--- a/doc/geometry.qbk
+++ b/doc/geometry.qbk
@@ -1,9 +1,10 @@
[/============================================================================
Boost.Geometry (aka GGL, Generic Geometry Library)
- Copyright (c) 2009-2015 Barend Gehrels, Amsterdam, the Netherlands.
- Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
- Copyright (c) 2009-2015 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2017 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2009-2017 Mateusz Loskot, London, UK.
+ Copyright (c) 2009-2017 Bruno Lalande, Paris, France.
+ Copyright (c) 2011-2017 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
@@ -12,8 +13,8 @@
[library Geometry
[quickbook 1.5]
- [authors [Gehrels, Barend], [Lalande, Bruno], [Loskot, Mateusz], [Wulkiewicz, Adam], [Karavelas, Menelaos]]
- [copyright 2009-2015 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates]
+ [authors [Gehrels, Barend], [Lalande, Bruno], [Loskot, Mateusz], [Wulkiewicz, Adam], [Karavelas, Menelaos], [Fisikopoulos, Vissarion]]
+ [copyright 2009-2017 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates]
[purpose Documentation of Boost.Geometry library]
[license
Distributed under the Boost Software License, Version 1.0.
diff --git a/doc/html/index.html b/doc/html/index.html
index 841fbf5b1..d8afcf098 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -37,8 +37,12 @@
-Copyright © 2009-2014 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
- Wulkiewicz, Oracle and/or its affiliates
+
+Vissarion Fisikopoulos
+
+Copyright © 2009-2017 Barend
+ Gehrels, Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its
+ affiliates
Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -72,6 +76,7 @@
Constants
Coordinate Systems
Core Metafunctions
+
DE-9IM
Enumerations
Exceptions
IO (input/output)
@@ -81,11 +86,9 @@
Strategies
Views
-
Indexes
-
-- Reference Matrix
-- Alphabetical Index
-
+
Reference Matrix
+
Reference Alphabetical
+ Index
Examples
- Example:
@@ -124,6 +127,9 @@
-
Mats Taraldsvik (documentation: adapting a legacy model)
+-
+ Matt Amos (fixes for point_on_surface)
+
-
Samuel Debionne (variant support for distance, assign, crosses, intersection,
...)
@@ -131,7 +137,7 @@
-Last revised: July 17, 2014 at 20:45:09 GMT |
+Last revised: February 26, 2017 at 00:30:21 GMT |
|
diff --git a/doc/index/rtree/query.qbk b/doc/index/rtree/query.qbk
index 0cf80acc7..75f40ec29 100644
--- a/doc/index/rtree/query.qbk
+++ b/doc/index/rtree/query.qbk
@@ -1,7 +1,7 @@
[/============================================================================
Boost.Geometry Index
- Copyright (c) 2011-2013 Adam Wulkiewicz.
+ Copyright (c) 2011-2017 Adam Wulkiewicz.
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,7 +57,7 @@ Query iterators returned by free functions
__box__ box_region(...);
std::copy(bgi::qbegin(rt, bgi::intersects(box_region)), bgi::qend(rt), std::back_inserter(returned_values));
-[h4 Spatial predicates]
+[h4 Spatial queries]
Queries using spatial predicates returns `__value__`s which are related somehow to some Geometry - box, polygon, etc.
Names of spatial predicates correspond to names of __boost_geometry__ algorithms (boolean operations).
@@ -129,6 +129,9 @@ The same way different query Geometries can be used:
Segment seg(/*...*/);
rt.query(bgi::nearest(seg, k), std::back_inserter(returned_values));
+[note In case of k-NN queries performed with `query()` function it's not guaranteed that the returned values will be sorted according to the distance.
+ It's different in case of k-NN queries performed with query iterator returned by `qbegin()` function which guarantees the iteration over the closest `__value__`s first. ]
+
[h4 User-defined unary predicate]
The user may pass a `UnaryPredicate` - function, function object or lambda expression taking const reference to Value and returning bool.
@@ -175,7 +178,7 @@ may use `index::satisfies()` function like on the example below:
rt.query(index::intersects(box) && !index::satisfies(is_not_red),
std::back_inserter(result));
-[h4 Passing a set of predicates]
+[h4 Passing set of predicates]
It's possible to use some number of predicates in one query by connecting them with `operator&&` e.g. `Pred1 && Pred2 && Pred3 && ...`.
@@ -190,7 +193,7 @@ left-to-right so placing most restrictive predicates first should accelerate the
rt.query(index::intersects(box1) && !index::within(box2) && index::overlaps(box3),
std::back_inserter(result));
-Of course it's possible to connect different types of predicates together.
+It's possible to connect different types of predicates together.
index::query(rt, index::nearest(pt, k) && index::within(b), std::back_inserter(returned_values));
@@ -211,13 +214,11 @@ or may be stopped at some point, when all interesting values were gathered. The
break;
}
-[note In the case of iterative k-NN queries it's guaranteed to iterate over the closest `__value__`s first. ]
-
[warning The modification of the `rtree`, e.g. insertion or removal of `__value__`s may invalidate the iterators. ]
-[h4 Inserting query results into the other R-tree]
+[h4 Inserting query results into another R-tree]
-There are several ways of inserting Values returned by a query to the other R-tree container.
+There are several ways of inserting Values returned by a query into another R-tree container.
The most basic way is creating a temporary container for Values and insert them later.
namespace bgi = boost::geometry::index;
@@ -231,14 +232,13 @@ The most basic way is creating a temporary container for Values and insert them
rt1.query(bgi::intersects(Box(/*...*/)), std::back_inserter(result));
RTree rt2(result.begin(), result.end());
-However there are better ways. One of these methods is mentioned in the "Creation and modification" section.
+However there are other ways. One of these methods is mentioned in the "Creation and modification" section.
The insert iterator may be passed directly into the query.
RTree rt3;
rt1.query(bgi::intersects(Box(/*...*/))), bgi::inserter(rt3));
-If you're a user of Boost.Range you'll appreciate the third option. You may pass the result Range directly into the
-constructor or `insert()` member function.
+You may also pass the resulting Range directly into the constructor or `insert()` member function using Boost.Range adaptor syntax.
RTree rt4(rt1 | bgi::adaptors::queried(bgi::intersects(Box(/*...*/)))));
diff --git a/doc/make_qbk.py b/doc/make_qbk.py
index db6cc0ab9..184e42223 100755
--- a/doc/make_qbk.py
+++ b/doc/make_qbk.py
@@ -4,6 +4,7 @@
# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
# Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
# Copyright (c) 2009-2012 Mateusz Loskot (mateusz@loskot.net), London, UK
+# Copyright (c) 2017 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
@@ -123,7 +124,8 @@ strategies = ["distance::pythagoras", "distance::pythagoras_box_box"
, "distance::cross_track", "distance::cross_track_point_box"
, "distance::projected_point"
, "within::winding", "within::franklin", "within::crossings_multiply"
- , "area::surveyor", "area::huiller"
+ , "area::surveyor", "area::spherical"
+ #, "area::geographic"
, "buffer::point_circle", "buffer::point_square"
, "buffer::join_round", "buffer::join_miter"
, "buffer::end_round", "buffer::end_flat"
diff --git a/doc/quickref.xml b/doc/quickref.xml
index 16047e897..755fdd255 100644
--- a/doc/quickref.xml
+++ b/doc/quickref.xml
@@ -10,10 +10,10 @@
Copyright (c) 2009-2015 Bruno Lalande, Paris, France.
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.
-
+ This file was modified by Oracle on 2014, 2015, 2017.
+ Modifications copyright (c) 2014-2017, Oracle and/or its affiliates.
Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+ Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -521,7 +521,8 @@
Area
strategy::area::surveyor
- strategy::area::huiller
+ strategy::area::spherical
+
diff --git a/doc/reference.qbk b/doc/reference.qbk
index a39f0b5ff..e84115ece 100644
--- a/doc/reference.qbk
+++ b/doc/reference.qbk
@@ -1,15 +1,16 @@
[/============================================================================
Boost.Geometry (aka GGL, Generic Geometry Library)
- Copyright (c) 2009-2014 Barend Gehrels, Amsterdam, the Netherlands.
- Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
- Copyright (c) 2009-2014 Bruno Lalande, Paris, France.
- Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
+ Copyright (c) 2009-2017 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2009-2017 Mateusz Loskot, London, UK.
+ Copyright (c) 2009-2017 Bruno Lalande, Paris, France.
+ Copyright (c) 2013-2017 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, 2017.
+ Modifications copyright (c) 2014-2017, Oracle and/or its affiliates.
Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+ Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -94,10 +95,17 @@
[include generated/covered_by.qbk]
[endsect]
+[section:crosses crosses]
[include generated/crosses.qbk]
+[endsect]
+[section:difference difference]
[include generated/difference.qbk]
+[endsect]
+
+[section:disjoint disjoint]
[include generated/disjoint.qbk]
+[endsect]
[section:distance distance]
[include generated/distance.qbk]
@@ -107,16 +115,21 @@
[include generated/envelope.qbk]
[endsect]
+[section:equals equals]
[include generated/equals.qbk]
+[endsect]
+
+[section:expand expand]
[include generated/expand.qbk]
+[endsect]
[section:for_each for_each]
[include generated/for_each.qbk]
[endsect]
-[/section:intersection intersection]
+[section:intersection intersection]
[include generated/intersection.qbk]
-[/endsect]
+[endsect]
[section:intersects intersects]
[include generated/intersects.qbk]
@@ -124,7 +137,9 @@
[include generated/is_empty.qbk]
+[section:is_simple is_simple]
[include generated/is_simple.qbk]
+[endsect]
[section:is_valid is_valid]
[include generated/is_valid.qbk]
@@ -143,16 +158,21 @@
[include generated/num_points.qbk]
[include generated/num_segments.qbk]
-
+[section:overlaps overlaps]
[include generated/overlaps.qbk]
+[endsect]
[section:perimeter perimeter]
[include generated/perimeter.qbk]
[endsect]
+[section:relate relate]
[include generated/relate.qbk]
+[endsect]
+[section:relation relation]
[include generated/relation.qbk]
+[endsect]
[include generated/reverse.qbk]
@@ -160,9 +180,9 @@
[include generated/simplify.qbk]
[endsect]
-[/section:sym_difference sym_difference]
+[section:sym_difference sym_difference]
[include generated/sym_difference.qbk]
-[/endsect]
+[endsect]
[section:touches touches]
[include generated/touches.qbk]
@@ -172,9 +192,9 @@
[include generated/transform.qbk]
[endsect]
-[/section:union union]
+[section:union_ union_]
[include generated/union.qbk]
-[/endsect]
+[endsect]
[include generated/unique.qbk]
@@ -317,7 +337,8 @@
[include generated/distance_cross_track.qbk]
[include generated/distance_cross_track_point_box.qbk]
[include generated/area_surveyor.qbk]
-[include generated/area_huiller.qbk]
+[include generated/area_spherical.qbk]
+[/include generated/area_geographic.qbk]
[include generated/buffer_join_round.qbk]
[include generated/buffer_join_miter.qbk]
[include generated/buffer_end_round.qbk]
diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk
index 56fcb8ecc..a640ab0e9 100644
--- a/doc/release_notes.qbk
+++ b/doc/release_notes.qbk
@@ -1,13 +1,13 @@
[/============================================================================
Boost.Geometry (aka GGL, Generic Geometry Library)
- Copyright (c) 2009-2016 Barend Gehrels, Geodan, Amsterdam, the Netherlands.
- Copyright (c) 2009-2016 Bruno Lalande, Paris, France.
- Copyright (c) 2009-2016 Mateusz Loskot , London, UK.
- Copyright (c) 2011-2016 Adam Wulkiewicz, Lodz, Poland.
+ Copyright (c) 2009-2017 Barend Gehrels, Geodan, Amsterdam, the Netherlands.
+ Copyright (c) 2009-2017 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2017 Mateusz Loskot , London, UK.
+ Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland.
- This file was modified by Oracle on 2015, 2016.
- Modifications copyright (c) 2015-2016, Oracle and/or its affiliates.
+ This file was modified by Oracle on 2015, 2017.
+ Modifications copyright (c) 2015-2017, Oracle and/or its affiliates.
Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -29,6 +29,8 @@
[*Breaking changes]
* ublas_transformer is renamed to matrix_transformer
+* explicit modifier is added to constructors of rtree index::dynamic_* parameters
+* strategy::area::huiller replaced by strategy::area::spherical
[*Solved issues]
@@ -38,6 +40,7 @@
[*Solved tickets]
* [@https://svn.boost.org/trac/boost/ticket/12566 12566] Ambiguous template instantiation in equal_to<> when pair value contains raw pointer
+* [@https://svn.boost.org/trac/boost/ticket/12861 12566] Segmentation fault in stdlibc++ (gcc 4.8.2) affecting rtree
[/=================]
[heading Boost 1.63]
diff --git a/doc/src/examples/algorithms/append.cpp b/doc/src/examples/algorithms/append.cpp
index f5a3085b5..fd90a6a04 100644
--- a/doc/src/examples/algorithms/append.cpp
+++ b/doc/src/examples/algorithms/append.cpp
@@ -12,12 +12,12 @@
#include
-#include
-
#include
#include
#include
+#include /*< At the end to avoid conflicts with Boost.QVM >*/
+
BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
int main()
diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp
index bb5b765ec..5e4c70687 100644
--- a/doc/src/examples/core/tag.cpp
+++ b/doc/src/examples/core/tag.cpp
@@ -12,13 +12,13 @@
#include
-#include
-
#include
#include
#include
#include
+#include /*< At the end to avoid conflicts with Boost.QVM >*/
+
BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
template struct dispatch {};
diff --git a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp
index bdfd74c62..45cab8195 100644
--- a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp
+++ b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp
@@ -12,13 +12,13 @@
#include
-#include
-
#include
#include
#include
#include
+#include /*< At the end to avoid conflicts with Boost.QVM >*/
+
int main()
{
diff --git a/doc/src/examples/geometries/adapted/boost_range/strided.cpp b/doc/src/examples/geometries/adapted/boost_range/strided.cpp
index 8b9dc6865..1ed9b5ecc 100644
--- a/doc/src/examples/geometries/adapted/boost_range/strided.cpp
+++ b/doc/src/examples/geometries/adapted/boost_range/strided.cpp
@@ -12,13 +12,13 @@
#include
-#include
-
#include
#include
#include
#include
+#include /*< At the end to avoid conflicts with Boost.QVM >*/
+
int main()
{
diff --git a/doc/src/examples/quick_start.cpp b/doc/src/examples/quick_start.cpp
index f77c8909b..41d3beb32 100644
--- a/doc/src/examples/quick_start.cpp
+++ b/doc/src/examples/quick_start.cpp
@@ -19,6 +19,8 @@
//#pragma warning( disable : 4244 )
#endif // defined(_MSC_VER)
+#include
+
//[quickstart_include
#include
diff --git a/extensions/test/gis/io/wkb/read_wkb.cpp b/extensions/test/gis/io/wkb/read_wkb.cpp
index eae9301e8..95e7f525a 100644
--- a/extensions/test/gis/io/wkb/read_wkb.cpp
+++ b/extensions/test/gis/io/wkb/read_wkb.cpp
@@ -27,6 +27,12 @@
#include
#include
+#include
+#include
+#include
+
+#include
+
namespace bg = boost::geometry;
namespace { // anonymous
@@ -42,6 +48,15 @@ void test_geometry_wrong_wkb(std::string const& wkbhex, std::string const& wkt)
BOOST_MESSAGE("read_wkb: " << bg::read_wkb(wkb.begin(), wkb.end(), g_wkb));
}
+template
+void test_geometry_parse_failure(std::string const& wkbhex, std::string const& wkt)
+{
+ byte_vector wkb;
+ BOOST_CHECK( bg::hex2wkb(wkbhex, std::back_inserter(wkb)) );
+ Geometry g_wkb;
+ BOOST_CHECK( bg::read_wkb(wkb.begin(), wkb.end(), g_wkb) == false );
+}
+
template
void test_geometry_equals_old(std::string const& wkbhex, std::string const& wkt)
{
@@ -130,16 +145,17 @@ int test_main(int, char* [])
// "POINT (1.234 5.678)");
}
+
+ typedef bg::model::point point_type;
+ typedef bg::model::point point3d_type;
+
+ typedef bg::model::linestring linestring_type;
+ //typedef bg::model::linestring linestring3d_type;
+
+ typedef bg::model::polygon polygon_type;
+ //typedef bg::model::polygon polygon3d_type;
{
- typedef bg::model::point point_type;
- typedef bg::model::point point3d_type;
-
- typedef bg::model::linestring linestring_type;
- //typedef bg::model::linestring linestring3d_type;
-
- typedef bg::model::polygon polygon_type;
- //typedef bg::model::polygon polygon3d_type;
//
// POINT
@@ -165,6 +181,16 @@ int test_main(int, char* [])
);
}
+ {
+ point3d_type point(1.234, 5.678, 99.0);
+
+ test_geometry_equals
+ (
+ point,
+ "01e90300005839b4c876bef33f83c0caa145b616400000000000c05840"
+ );
+ }
+
//
// LINESTRING
//
@@ -185,6 +211,30 @@ int test_main(int, char* [])
"010200000003000000000000000000F03F00000000000000400000000000000040000000000000084000000000000010400000000000001440"
);
}
+
+
+ {
+ linestring_type linestring;
+
+ bg::append(linestring,
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(9.1011, 10.1112))
+ (point_type(13.1415, 16.1718))
+ );
+
+ test_geometry_equals
+ (
+ linestring,
+ "0102000000030000005839B4C876BEF33F83C0CAA145B616404F401361C333224062A1D634EF3824409CC420B072482A40EB73B515FB2B3040"
+ );
+
+ test_geometry_equals
+ (
+ linestring,
+ "0102000080030000005839B4C876BEF33F83C0CAA145B616400000000000C058404F401361C333224062A1D634EF3824400000000000C058409CC420B072482A40EB73B515FB2B30400000000000C05840"
+ );
+ }
// {
// linestring3d_type linestring;
@@ -225,7 +275,26 @@ int test_main(int, char* [])
"010300000001000000050000000000000000004940000000000000494000000000000049400000000000005940000000000000594000000000000059400000000000005940000000000000494000000000000049400000000000004940"
);
}
+
+ {
+ polygon_type polygon;
+ bg::append(polygon,
+ boost::assign::list_of
+ (point_type(100.0, 200.0))
+ (point_type(200.0, 200.0))
+ (point_type(200.0, 400.0))
+ (point_type(100.0, 400.0))
+ (point_type(100.0, 200.0))
+ );
+
+ test_geometry_equals
+ (
+ polygon,
+ "010300000001000000050000000000000000005940000000000000694000000000000069400000000000006940000000000000694000000000000079400000000000005940000000000000794000000000000059400000000000006940"
+ );
+ }
+
// {
// polygon3d_type polygon;
//
@@ -251,7 +320,7 @@ int test_main(int, char* [])
);
// Create an interior ring (append does not do this automatically)
- boost::geometry::interior_rings(polygon).resize(1);
+ polygon.inners().resize(1);
bg::append(polygon,
boost::assign::list_of
@@ -269,6 +338,158 @@ int test_main(int, char* [])
}
}
+
+ //
+ // Multi Geometries
+ //
+
+ typedef bg::model::multi_point multipoint_type;
+ typedef bg::model::multi_linestring multilinestring_type;
+ typedef bg::model::multi_polygon multipolygon_type;
+
+ //
+ // MultiPoint
+ //
+
+ {
+ multipoint_type multipoint;
+
+ bg::append(multipoint,
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ );
+ test_geometry_equals
+ (
+ multipoint,
+ "01040000000100000001010000005839b4c876bef33f83c0caa145b61640"
+ );
+ }
+
+ {
+ multipoint_type multipoint;
+
+ bg::append(multipoint,
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(10.1112, 13.1415))
+ );
+
+ test_geometry_equals
+ (
+ multipoint,
+ "01040000000200000001010000005839b4c876bef33f83c0caa145b61640010100000062a1d634ef3824409cc420b072482a40"
+ );
+ }
+
+ //
+ // MultiLineString
+ //
+
+ {
+ multilinestring_type multilinestring;
+
+ // Create linestrings (append does not do this automatically)
+ multilinestring.resize(1);
+
+ bg::append(multilinestring[0],
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(9.1011, 10.1112))
+ (point_type(13.1415, 16.1718))
+ );
+
+ test_geometry_equals
+ (
+ multilinestring,
+ "0105000000010000000102000000030000005839b4c876bef33f83c0caa145b616404f401361c333224062a1d634ef3824409cc420b072482a40eb73b515fb2b3040"
+ );
+ }
+
+ {
+ multilinestring_type multilinestring;
+
+ // Create linestrings (append does not do this automatically)
+ multilinestring.resize(2);
+
+ bg::append(multilinestring[0],
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(9.1011, 10.1112))
+ (point_type(13.1415, 16.1718))
+ );
+
+ bg::append(multilinestring[1],
+ boost::assign::list_of
+ (point_type(19.2, 21.22))
+ (point_type(23.24, 25.26))
+ );
+
+ test_geometry_equals
+ (
+ multilinestring,
+"0105000000020000000102000000030000005839b4c876bef33f83c0caa145b616404f401361c333224062a1d634ef3824409cc420b072482a40eb73b515fb2b30400102000000020000003333333333333340b81e85eb513835403d0ad7a3703d3740c3f5285c8f423940"
+ );
+ }
+
+ //
+ // MultiPolygon
+ //
+
+ {
+ multipolygon_type multipolygon;
+
+ // Create polygons (append does not do this automatically)
+ multipolygon.resize(1);
+
+ bg::append(multipolygon[0],
+ boost::assign::list_of
+ (point_type(100, 200))
+ (point_type(200, 200))
+ (point_type(200, 400))
+ (point_type(100, 400))
+ (point_type(100, 200))
+ );
+
+ test_geometry_equals
+ (
+ multipolygon,
+"010600000001000000010300000001000000050000000000000000005940000000000000694000000000000069400000000000006940000000000000694000000000000079400000000000005940000000000000794000000000000059400000000000006940"
+ );
+ }
+
+ {
+ multipolygon_type multipolygon;
+
+ // Create polygons (append does not do this automatically)
+ multipolygon.resize(1);
+ // Create an interior ring (append does not do this automatically)
+ multipolygon[0].inners().resize(1);
+
+ bg::append(multipolygon[0],
+ boost::assign::list_of
+ (point_type(35, 10))
+ (point_type(10, 20))
+ (point_type(15, 40))
+ (point_type(45, 45))
+ (point_type(35, 10))
+ );
+
+ bg::append(multipolygon[0],
+ boost::assign::list_of
+ (point_type(20, 30))
+ (point_type(35, 35))
+ (point_type(30, 20))
+ (point_type(20, 30)),
+ 0
+ );
+
+ test_geometry_equals
+ (
+ multipolygon,
+"0106000000010000000103000000020000000500000000000000008041400000000000002440000000000000244000000000000034400000000000002e40000000000000444000000000008046400000000000804640000000000080414000000000000024400400000000000000000034400000000000003e40000000000080414000000000008041400000000000003e40000000000000344000000000000034400000000000003e40"
+ );
+ }
+
return 0;
}
diff --git a/extensions/test/gis/io/wkb/write_wkb.cpp b/extensions/test/gis/io/wkb/write_wkb.cpp
index 3b71c0f17..1e87eae90 100644
--- a/extensions/test/gis/io/wkb/write_wkb.cpp
+++ b/extensions/test/gis/io/wkb/write_wkb.cpp
@@ -27,9 +27,17 @@
#include
+#include
+#include
+#include
+
+#include
+
#include
#include
+#include
+
namespace bg = boost::geometry;
namespace { // anonymous
@@ -42,10 +50,11 @@ void test_geometry_equals(Geometry const& geometry, std::string const& wkbhex)
std::string hex_out;
BOOST_CHECK( bg::wkb2hex(wkb_out.begin(), wkb_out.end(), hex_out) );
-
+
+ boost::algorithm::to_lower(hex_out);
+
BOOST_CHECK_EQUAL( wkbhex, hex_out);
}
-
} // namespace anonymous
int test_main(int, char* [])
@@ -67,7 +76,7 @@ int test_main(int, char* [])
test_geometry_equals
(
point,
- "0101000000000000000000F03F0000000000000040"
+ "0101000000000000000000f03f0000000000000040"
);
}
@@ -77,7 +86,7 @@ int test_main(int, char* [])
test_geometry_equals
(
point,
- "01E9030000000000000000F03F00000000000000400000000000000840"
+ "01e9030000000000000000f03f00000000000000400000000000000840"
);
}
@@ -98,7 +107,7 @@ int test_main(int, char* [])
test_geometry_equals
(
linestring,
- "010200000003000000000000000000F03F00000000000000400000000000000040000000000000084000000000000010400000000000001440"
+ "010200000003000000000000000000f03f00000000000000400000000000000040000000000000084000000000000010400000000000001440"
);
}
@@ -115,7 +124,7 @@ int test_main(int, char* [])
test_geometry_equals
(
linestring,
- "01EA03000003000000000000000000F03F00000000000000400000000000000840000000000000004000000000000008400000000000001040000000000000104000000000000014400000000000001840"
+ "01ea03000003000000000000000000f03f00000000000000400000000000000840000000000000004000000000000008400000000000001040000000000000104000000000000014400000000000001840"
);
}
@@ -157,7 +166,7 @@ int test_main(int, char* [])
test_geometry_equals
(
polygon,
- "01EB0300000100000005000000000000000000494000000000000049400000000000001440000000000000494000000000000059400000000000002440000000000000594000000000000059400000000000001440000000000000594000000000000049400000000000002440000000000000494000000000000049400000000000001440"
+ "01eb0300000100000005000000000000000000494000000000000049400000000000001440000000000000494000000000000059400000000000002440000000000000594000000000000059400000000000001440000000000000594000000000000049400000000000002440000000000000494000000000000049400000000000001440"
);
}
@@ -187,9 +196,161 @@ int test_main(int, char* [])
test_geometry_equals
(
polygon,
- "0103000000020000000500000000000000008041400000000000002440000000000080464000000000008046400000000000002E40000000000000444000000000000024400000000000003440000000000080414000000000000024400400000000000000000034400000000000003E40000000000080414000000000008041400000000000003E40000000000000344000000000000034400000000000003E40"
+ "0103000000020000000500000000000000008041400000000000002440000000000080464000000000008046400000000000002e40000000000000444000000000000024400000000000003440000000000080414000000000000024400400000000000000000034400000000000003e40000000000080414000000000008041400000000000003e40000000000000344000000000000034400000000000003e40"
);
}
+ //
+ // Multi Geometries
+ //
+
+ typedef bg::model::multi_point multipoint_type;
+ typedef bg::model::multi_linestring multilinestring_type;
+ typedef bg::model::multi_polygon multipolygon_type;
+
+ //
+ // MultiPoint
+ //
+
+ {
+ multipoint_type multipoint;
+
+ bg::append(multipoint,
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ );
+
+ test_geometry_equals
+ (
+ multipoint,
+ "01040000000100000001010000005839b4c876bef33f83c0caa145b61640"
+ );
+ }
+
+ {
+ multipoint_type multipoint;
+
+ bg::append(multipoint,
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(10.1112, 13.1415))
+ );
+
+ test_geometry_equals
+ (
+ multipoint,
+ "01040000000200000001010000005839b4c876bef33f83c0caa145b61640010100000062a1d634ef3824409cc420b072482a40"
+ );
+ }
+
+ //
+ // MultiLineString
+ //
+
+ {
+ multilinestring_type multilinestring;
+
+ // Create linestrings (append does not do this automatically)
+ multilinestring.resize(1);
+
+ bg::append(multilinestring[0],
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(9.1011, 10.1112))
+ (point_type(13.1415, 16.1718))
+ );
+
+ test_geometry_equals
+ (
+ multilinestring,
+ "0105000000010000000102000000030000005839b4c876bef33f83c0caa145b616404f401361c333224062a1d634ef3824409cc420b072482a40eb73b515fb2b3040"
+ );
+ }
+
+ {
+ multilinestring_type multilinestring;
+
+ // Create linestrings (append does not do this automatically)
+ multilinestring.resize(2);
+
+ bg::append(multilinestring[0],
+ boost::assign::list_of
+ (point_type(1.234, 5.678))
+ (point_type(9.1011, 10.1112))
+ (point_type(13.1415, 16.1718))
+ );
+
+ bg::append(multilinestring[1],
+ boost::assign::list_of
+ (point_type(19.2, 21.22))
+ (point_type(23.24, 25.26))
+ );
+
+ test_geometry_equals
+ (
+ multilinestring,
+"0105000000020000000102000000030000005839b4c876bef33f83c0caa145b616404f401361c333224062a1d634ef3824409cc420b072482a40eb73b515fb2b30400102000000020000003333333333333340b81e85eb513835403d0ad7a3703d3740c3f5285c8f423940"
+ );
+ }
+
+ //
+ // MultiPolygon
+ //
+
+ {
+ multipolygon_type multipolygon;
+
+ // Create polygons (append does not do this automatically)
+ multipolygon.resize(1);
+
+ bg::append(multipolygon[0],
+ boost::assign::list_of
+ (point_type(100, 200))
+ (point_type(200, 200))
+ (point_type(200, 400))
+ (point_type(100, 400))
+ (point_type(100, 200))
+ );
+
+ test_geometry_equals
+ (
+ multipolygon,
+"010600000001000000010300000001000000050000000000000000005940000000000000694000000000000069400000000000006940000000000000694000000000000079400000000000005940000000000000794000000000000059400000000000006940"
+ );
+ }
+
+ {
+ multipolygon_type multipolygon;
+
+ // Create polygons (append does not do this automatically)
+ multipolygon.resize(1);
+ // Create an interior ring (append does not do this automatically)
+ multipolygon[0].inners().resize(1);
+
+ bg::append(multipolygon[0],
+ boost::assign::list_of
+ (point_type(35, 10))
+ (point_type(10, 20))
+ (point_type(15, 40))
+ (point_type(45, 45))
+ (point_type(35, 10))
+ );
+
+ bg::append(multipolygon[0],
+ boost::assign::list_of
+ (point_type(20, 30))
+ (point_type(35, 35))
+ (point_type(30, 20))
+ (point_type(20, 30)),
+ 0
+ );
+
+ test_geometry_equals
+ (
+ multipolygon,
+"0106000000010000000103000000020000000500000000000000008041400000000000002440000000000000244000000000000034400000000000002e40000000000000444000000000008046400000000000804640000000000080414000000000000024400400000000000000000034400000000000003e40000000000080414000000000008041400000000000003e40000000000000344000000000000034400000000000003e40"
+ );
+ }
+
return 0;
}
diff --git a/include/boost/geometry/algorithms/area.hpp b/include/boost/geometry/algorithms/area.hpp
index 4751d4e74..18aea2403 100644
--- a/include/boost/geometry/algorithms/area.hpp
+++ b/include/boost/geometry/algorithms/area.hpp
@@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// This file was modified by Oracle on 2017.
+// Modifications copyright (c) 2017 Oracle and/or its affiliates.
+// Contributed and/or modified by Adam Wulkiewicz, 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.
@@ -303,7 +307,8 @@ inline typename default_area_result::type area(Geometry const& geometr
[heading Available Strategies]
\* [link geometry.reference.strategies.strategy_area_surveyor Surveyor (cartesian)]
-\* [link geometry.reference.strategies.strategy_area_huiller Huiller (spherical)]
+\* [link geometry.reference.strategies.strategy_area_spherical Spherical]
+[/link geometry.reference.strategies.strategy_area_geographic Geographic]
}
*/
template
diff --git a/include/boost/geometry/algorithms/crosses.hpp b/include/boost/geometry/algorithms/crosses.hpp
index 8a906b2e1..c9e3651ab 100644
--- a/include/boost/geometry/algorithms/crosses.hpp
+++ b/include/boost/geometry/algorithms/crosses.hpp
@@ -228,6 +228,7 @@ namespace resolve_variant
\param strategy \param_strategy{crosses}
\return \return_check2{crosses}
+\qbk{distinguish,with strategy}
\qbk{[include reference/algorithms/crosses.qbk]}
*/
template
diff --git a/include/boost/geometry/algorithms/detail/disjoint/interface.hpp b/include/boost/geometry/algorithms/detail/disjoint/interface.hpp
index 9b505e560..64898e35f 100644
--- a/include/boost/geometry/algorithms/detail/disjoint/interface.hpp
+++ b/include/boost/geometry/algorithms/detail/disjoint/interface.hpp
@@ -203,6 +203,7 @@ struct disjoint
\param strategy \param_strategy{disjoint}
\return \return_check2{are disjoint}
+\qbk{distinguish,with strategy}
\qbk{[include reference/algorithms/disjoint.qbk]}
*/
template
diff --git a/include/boost/geometry/algorithms/detail/envelope/interface.hpp b/include/boost/geometry/algorithms/detail/envelope/interface.hpp
index d768c2bbd..8e9c35b39 100644
--- a/include/boost/geometry/algorithms/detail/envelope/interface.hpp
+++ b/include/boost/geometry/algorithms/detail/envelope/interface.hpp
@@ -135,6 +135,7 @@ struct envelope >
\param mbr \param_box \param_set{envelope}
\param strategy \param_strategy{envelope}
+\qbk{distinguish,with strategy}
\qbk{[include reference/algorithms/envelope.qbk]}
\qbk{
[heading Example]
@@ -142,7 +143,7 @@ struct envelope >
}
*/
template
-inline void envelope(Geometry const& geometry, Box& mbr, Strategy& strategy)
+inline void envelope(Geometry const& geometry, Box& mbr, Strategy const& strategy)
{
resolve_variant::envelope::apply(geometry, mbr, strategy);
}
@@ -169,6 +170,32 @@ inline void envelope(Geometry const& geometry, Box& mbr)
}
+/*!
+\brief \brief_calc{envelope}
+\ingroup envelope
+\details \details_calc{return_envelope,\det_envelope}. \details_return{envelope}
+\tparam Box \tparam_box
+\tparam Geometry \tparam_geometry
+\tparam Strategy \tparam_strategy{Envelope}
+\param geometry \param_geometry
+\param strategy \param_strategy{envelope}
+\return \return_calc{envelope}
+
+\qbk{distinguish,with strategy}
+\qbk{[include reference/algorithms/envelope.qbk]}
+\qbk{
+[heading Example]
+[return_envelope] [return_envelope_output]
+}
+*/
+template
+inline Box return_envelope(Geometry const& geometry, Strategy const& strategy)
+{
+ Box mbr;
+ resolve_variant::envelope::apply(geometry, mbr, strategy);
+ return mbr;
+}
+
/*!
\brief \brief_calc{envelope}
\ingroup envelope
diff --git a/include/boost/geometry/algorithms/detail/expand/interface.hpp b/include/boost/geometry/algorithms/detail/expand/interface.hpp
index dc383d4b9..5aacd8e72 100644
--- a/include/boost/geometry/algorithms/detail/expand/interface.hpp
+++ b/include/boost/geometry/algorithms/detail/expand/interface.hpp
@@ -160,10 +160,13 @@ inline void expand(Box& box, Geometry const& geometry,
\ingroup expand
\tparam Box type of the box
\tparam Geometry \tparam_geometry
+\tparam Strategy \tparam_strategy{expand}
\param box box to be expanded using another geometry, mutable
\param geometry \param_geometry geometry which envelope (bounding box)
+\param strategy \param_strategy{expand}
will be added to the box
+\qbk{distinguish,with strategy}
\qbk{[include reference/algorithms/expand.qbk]}
*/
template
diff --git a/include/boost/geometry/algorithms/detail/intersection/interface.hpp b/include/boost/geometry/algorithms/detail/intersection/interface.hpp
index ddf49ad03..0efc9731b 100644
--- a/include/boost/geometry/algorithms/detail/intersection/interface.hpp
+++ b/include/boost/geometry/algorithms/detail/intersection/interface.hpp
@@ -15,12 +15,14 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_INTERFACE_HPP
-// TODO: those headers probably may be removed
-#include
-#include
+#include
+#include
+#include
#include
#include
+#include
+#include
namespace boost { namespace geometry
@@ -98,33 +100,46 @@ struct intersection
} // namespace dispatch
#endif // DOXYGEN_NO_DISPATCH
-
-namespace resolve_variant
-{
-
-template
+
+namespace resolve_strategy {
+
struct intersection
{
- template
- static inline bool
- apply(
- const Geometry1& geometry1,
- const Geometry2& geometry2,
- GeometryOut& geometry_out)
+ template
+ <
+ typename Geometry1,
+ typename Geometry2,
+ typename RobustPolicy,
+ typename GeometryOut,
+ typename Strategy
+ >
+ static inline bool apply(Geometry1 const& geometry1,
+ Geometry2 const& geometry2,
+ RobustPolicy const& robust_policy,
+ GeometryOut & geometry_out,
+ Strategy const& strategy)
{
- concepts::check();
- concepts::check();
-
- typedef typename geometry::rescale_overlay_policy_type
+ return dispatch::intersection
<
Geometry1,
Geometry2
- >::type rescale_policy_type;
-
- rescale_policy_type robust_policy
- = geometry::get_rescale_policy(geometry1,
- geometry2);
-
+ >::apply(geometry1, geometry2, robust_policy, geometry_out,
+ strategy);
+ }
+
+ template
+ <
+ typename Geometry1,
+ typename Geometry2,
+ typename RobustPolicy,
+ typename GeometryOut
+ >
+ static inline bool apply(Geometry1 const& geometry1,
+ Geometry2 const& geometry2,
+ RobustPolicy const& robust_policy,
+ GeometryOut & geometry_out,
+ default_strategy)
+ {
typedef typename strategy::relate::services::default_strategy
<
Geometry1, Geometry2
@@ -139,44 +154,83 @@ struct intersection
}
};
+} // resolve_strategy
+
+
+namespace resolve_variant
+{
+
+template
+struct intersection
+{
+ template
+ static inline bool apply(Geometry1 const& geometry1,
+ Geometry2 const& geometry2,
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
+ {
+ concepts::check();
+ concepts::check();
+
+ typedef typename geometry::rescale_overlay_policy_type
+ <
+ Geometry1,
+ Geometry2
+ >::type rescale_policy_type;
+
+ rescale_policy_type robust_policy
+ = geometry::get_rescale_policy(geometry1,
+ geometry2);
+
+ return resolve_strategy::intersection::apply(geometry1,
+ geometry2,
+ robust_policy,
+ geometry_out,
+ strategy);
+ }
+};
+
template
struct intersection, Geometry2>
{
- template
+ template
struct visitor: static_visitor
{
Geometry2 const& m_geometry2;
GeometryOut& m_geometry_out;
+ Strategy const& m_strategy;
visitor(Geometry2 const& geometry2,
- GeometryOut& geometry_out)
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
: m_geometry2(geometry2)
, m_geometry_out(geometry_out)
+ , m_strategy(strategy)
{}
template
- result_type operator()(Geometry1 const& geometry1) const
+ bool operator()(Geometry1 const& geometry1) const
{
return intersection
- <
- Geometry1,
- Geometry2
- >::template apply
- <
- GeometryOut
- >
- (geometry1, m_geometry2, m_geometry_out);
+ <
+ Geometry1,
+ Geometry2
+ >::apply(geometry1, m_geometry2, m_geometry_out, m_strategy);
}
};
- template
+ template
static inline bool
apply(variant const& geometry1,
Geometry2 const& geometry2,
- GeometryOut& geometry_out)
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
{
- return boost::apply_visitor(visitor(geometry2, geometry_out), geometry1);
+ return boost::apply_visitor(visitor(geometry2,
+ geometry_out,
+ strategy),
+ geometry1);
}
};
@@ -184,40 +238,43 @@ struct intersection, Geometry2>
template
struct intersection >
{
- template
+ template
struct visitor: static_visitor
{
Geometry1 const& m_geometry1;
GeometryOut& m_geometry_out;
+ Strategy const& m_strategy;
visitor(Geometry1 const& geometry1,
- GeometryOut& geometry_out)
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
: m_geometry1(geometry1)
, m_geometry_out(geometry_out)
+ , m_strategy(strategy)
{}
template
- result_type operator()(Geometry2 const& geometry2) const
+ bool operator()(Geometry2 const& geometry2) const
{
return intersection
- <
- Geometry1,
- Geometry2
- >::template apply
- <
- GeometryOut
- >
- (m_geometry1, geometry2, m_geometry_out);
+ <
+ Geometry1,
+ Geometry2
+ >::apply(m_geometry1, geometry2, m_geometry_out, m_strategy);
}
};
- template
+ template
static inline bool
apply(Geometry1 const& geometry1,
- const variant& geometry2,
- GeometryOut& geometry_out)
+ variant const& geometry2,
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
{
- return boost::apply_visitor(visitor(geometry1, geometry_out), geometry2);
+ return boost::apply_visitor(visitor(geometry1,
+ geometry_out,
+ strategy),
+ geometry2);
}
};
@@ -225,44 +282,83 @@ struct intersection >
template
struct intersection, variant >
{
- template
+ template
struct visitor: static_visitor
{
GeometryOut& m_geometry_out;
+ Strategy const& m_strategy;
- visitor(GeometryOut& geometry_out)
+ visitor(GeometryOut& geometry_out, Strategy const& strategy)
: m_geometry_out(geometry_out)
+ , m_strategy(strategy)
{}
template
- result_type operator()(Geometry1 const& geometry1,
- Geometry2 const& geometry2) const
+ bool operator()(Geometry1 const& geometry1,
+ Geometry2 const& geometry2) const
{
return intersection
- <
- Geometry1,
- Geometry2
- >::template apply
- <
- GeometryOut
- >
- (geometry1, geometry2, m_geometry_out);
+ <
+ Geometry1,
+ Geometry2
+ >::apply(geometry1, geometry2, m_geometry_out, m_strategy);
}
};
- template
+ template
static inline bool
- apply(const variant& geometry1,
- const variant& geometry2,
- GeometryOut& geometry_out)
+ apply(variant const& geometry1,
+ variant const& geometry2,
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
{
- return boost::apply_visitor(visitor(geometry_out), geometry1, geometry2);
+ return boost::apply_visitor(visitor(geometry_out,
+ strategy),
+ geometry1, geometry2);
}
};
} // namespace resolve_variant
+/*!
+\brief \brief_calc2{intersection}
+\ingroup intersection
+\details \details_calc2{intersection, spatial set theoretic intersection}.
+\tparam Geometry1 \tparam_geometry
+\tparam Geometry2 \tparam_geometry
+\tparam GeometryOut Collection of geometries (e.g. std::vector, std::deque, boost::geometry::multi*) of which
+ the value_type fulfills a \p_l_or_c concept, or it is the output geometry (e.g. for a box)
+\tparam Strategy \tparam_strategy{Intersection}
+\param geometry1 \param_geometry
+\param geometry2 \param_geometry
+\param geometry_out The output geometry, either a multi_point, multi_polygon,
+ multi_linestring, or a box (for intersection of two boxes)
+\param strategy \param_strategy{intersection}
+
+\qbk{distinguish,with strategy}
+\qbk{[include reference/algorithms/intersection.qbk]}
+*/
+template
+<
+ typename Geometry1,
+ typename Geometry2,
+ typename GeometryOut,
+ typename Strategy
+>
+inline bool intersection(Geometry1 const& geometry1,
+ Geometry2 const& geometry2,
+ GeometryOut& geometry_out,
+ Strategy const& strategy)
+{
+ return resolve_variant::intersection
+ <
+ Geometry1,
+ Geometry2
+ >::apply(geometry1, geometry2, geometry_out, strategy);
+}
+
+
/*!
\brief \brief_calc2{intersection}
\ingroup intersection
@@ -285,18 +381,14 @@ template
typename GeometryOut
>
inline bool intersection(Geometry1 const& geometry1,
- Geometry2 const& geometry2,
- GeometryOut& geometry_out)
+ Geometry2 const& geometry2,
+ GeometryOut& geometry_out)
{
return resolve_variant::intersection
<
- Geometry1,
- Geometry2
- >::template apply
- <
- GeometryOut
- >
- (geometry1, geometry2, geometry_out);
+ Geometry1,
+ Geometry2
+ >::apply(geometry1, geometry2, geometry_out, default_strategy());
}
diff --git a/include/boost/geometry/algorithms/detail/is_simple/always_simple.hpp b/include/boost/geometry/algorithms/detail/is_simple/always_simple.hpp
index 91e2ef76b..5cec5e192 100644
--- a/include/boost/geometry/algorithms/detail/is_simple/always_simple.hpp
+++ b/include/boost/geometry/algorithms/detail/is_simple/always_simple.hpp
@@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2014, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@@ -27,7 +28,8 @@ namespace detail { namespace is_simple
template
struct always_simple
{
- static inline bool apply(Geometry const&)
+ template
+ static inline bool apply(Geometry const&, Strategy const&)
{
return true;
}
diff --git a/include/boost/geometry/algorithms/detail/is_simple/areal.hpp b/include/boost/geometry/algorithms/detail/is_simple/areal.hpp
index a2322e483..d4d6db9bc 100644
--- a/include/boost/geometry/algorithms/detail/is_simple/areal.hpp
+++ b/include/boost/geometry/algorithms/detail/is_simple/areal.hpp
@@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2014-2015, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@@ -37,6 +38,12 @@ namespace detail { namespace is_simple
template
struct is_simple_ring
{
+ template
+ static inline bool apply(Ring const& ring, Strategy const&)
+ {
+ return apply(ring);
+ }
+
static inline bool apply(Ring const& ring)
{
simplicity_failure_policy policy;
@@ -69,6 +76,12 @@ private:
}
public:
+ template
+ static inline bool apply(Polygon const& polygon, Strategy const&)
+ {
+ return apply(polygon);
+ }
+
static inline bool apply(Polygon const& polygon)
{
return
@@ -119,7 +132,8 @@ struct is_simple
template
struct is_simple
{
- static inline bool apply(MultiPolygon const& multipolygon)
+ template
+ static inline bool apply(MultiPolygon const& multipolygon, Strategy const&)
{
return
detail::check_iterator_range
diff --git a/include/boost/geometry/algorithms/detail/is_simple/interface.hpp b/include/boost/geometry/algorithms/detail/is_simple/interface.hpp
index 6d425232b..af0127dc7 100644
--- a/include/boost/geometry/algorithms/detail/is_simple/interface.hpp
+++ b/include/boost/geometry/algorithms/detail/is_simple/interface.hpp
@@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2014, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@@ -17,46 +18,106 @@
#include
#include
+#include
+#include
+#include
namespace boost { namespace geometry
{
+namespace resolve_strategy
+{
-namespace resolve_variant {
+struct is_simple
+{
+ template
+ static inline bool apply(Geometry const& geometry,
+ Strategy const& strategy)
+ {
+ return dispatch::is_simple::apply(geometry, strategy);
+ }
+
+ template
+ static inline bool apply(Geometry const& geometry,
+ default_strategy)
+ {
+ // NOTE: Currently the strategy is only used for Linear geometries
+ typedef typename strategy::intersection::services::default_strategy
+ <
+ typename cs_tag::type
+ >::type strategy_type;
+
+ return dispatch::is_simple::apply(geometry, strategy_type());
+ }
+};
+
+} // namespace resolve_strategy
+
+namespace resolve_variant
+{
template
struct is_simple
{
- static inline bool apply(Geometry const& geometry)
+ template
+ static inline bool apply(Geometry const& geometry, Strategy const& strategy)
{
concepts::check();
- return dispatch::is_simple::apply(geometry);
+
+ return resolve_strategy::is_simple::apply(geometry, strategy);
}
};
template
struct is_simple >
{
+ template
struct visitor : boost::static_visitor
{
+ Strategy const& m_strategy;
+
+ visitor(Strategy const& strategy)
+ : m_strategy(strategy)
+ {}
+
template
bool operator()(Geometry const& geometry) const
{
- return is_simple::apply(geometry);
+ return is_simple::apply(geometry, m_strategy);
}
};
+ template
static inline bool
- apply(boost::variant const& geometry)
+ apply(boost::variant const& geometry,
+ Strategy const& strategy)
{
- return boost::apply_visitor(visitor(), geometry);
+ return boost::apply_visitor(visitor(strategy), geometry);
}
};
} // namespace resolve_variant
+/*!
+\brief \brief_check{is simple}
+\ingroup is_simple
+\tparam Geometry \tparam_geometry
+\tparam Strategy \tparam_strategy{Is_simple}
+\param geometry \param_geometry
+\param strategy \param_strategy{is_simple}
+\return \return_check{is simple}
+
+\qbk{distinguish,with strategy}
+\qbk{[include reference/algorithms/is_simple.qbk]}
+*/
+template
+inline bool is_simple(Geometry const& geometry, Strategy const& strategy)
+{
+ return resolve_variant::is_simple::apply(geometry, strategy);
+}
+
/*!
\brief \brief_check{is simple}
@@ -70,7 +131,7 @@ struct is_simple >
template
inline bool is_simple(Geometry const& geometry)
{
- return resolve_variant::is_simple::apply(geometry);
+ return resolve_variant::is_simple::apply(geometry, default_strategy());
}
diff --git a/include/boost/geometry/algorithms/detail/is_simple/linear.hpp b/include/boost/geometry/algorithms/detail/is_simple/linear.hpp
index 6c469f07f..52b9d9d1c 100644
--- a/include/boost/geometry/algorithms/detail/is_simple/linear.hpp
+++ b/include/boost/geometry/algorithms/detail/is_simple/linear.hpp
@@ -189,8 +189,8 @@ private:
};
-template
-inline bool has_self_intersections(Linear const& linear)
+template
+inline bool has_self_intersections(Linear const& linear, Strategy const& strategy)
{
typedef typename point_type::type point_type;
@@ -217,16 +217,11 @@ inline bool has_self_intersections(Linear const& linear)
is_acceptable_turn
> interrupt_policy(predicate);
- typedef typename strategy::intersection::services::default_strategy
- <
- typename cs_tag::type
- >::type strategy_type;
-
detail::self_get_turn_points::get_turns
<
turn_policy
>::apply(linear,
- strategy_type(),
+ strategy,
detail::no_rescale_policy(),
turns,
interrupt_policy);
@@ -252,8 +247,19 @@ struct is_simple_linestring
&& ! detail::is_valid::has_spikes
<
Linestring, closed
- >::apply(linestring, policy)
- && ! (CheckSelfIntersections && has_self_intersections(linestring));
+ >::apply(linestring, policy);
+ }
+};
+
+template
+struct is_simple_linestring
+{
+ template
+ static inline bool apply(Linestring const& linestring,
+ Strategy const& strategy)
+ {
+ return is_simple_linestring::apply(linestring)
+ && ! has_self_intersections(linestring, strategy);
}
};
@@ -261,7 +267,9 @@ struct is_simple_linestring
template
struct is_simple_multilinestring
{
- static inline bool apply(MultiLinestring const& multilinestring)
+ template
+ static inline bool apply(MultiLinestring const& multilinestring,
+ Strategy const& strategy)
{
// check each of the linestrings for simplicity
// but do not compute self-intersections yet; these will be
@@ -281,7 +289,7 @@ struct is_simple_multilinestring
return false;
}
- return ! has_self_intersections(multilinestring);
+ return ! has_self_intersections(multilinestring, strategy);
}
};
diff --git a/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp b/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp
index f9f43d1cd..61f0bc913 100644
--- a/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp
+++ b/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp
@@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2014-2015, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@@ -38,7 +39,8 @@ namespace detail { namespace is_simple
template
struct is_simple_multipoint
{
- static inline bool apply(MultiPoint const& multipoint)
+ template
+ static inline bool apply(MultiPoint const& multipoint, Strategy const&)
{
if (boost::empty(multipoint))
{
diff --git a/include/boost/geometry/algorithms/detail/is_valid/box.hpp b/include/boost/geometry/algorithms/detail/is_valid/box.hpp
index 863ce625f..69a4d4e78 100644
--- a/include/boost/geometry/algorithms/detail/is_valid/box.hpp
+++ b/include/boost/geometry/algorithms/detail/is_valid/box.hpp
@@ -1,6 +1,6 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2014-2015, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -71,8 +71,8 @@ struct has_valid_corners
template
struct is_valid_box
{
- template
- static inline bool apply(Box const& box, VisitPolicy& visitor)
+ template
+ static inline bool apply(Box const& box, VisitPolicy& visitor, Strategy const&)
{
return
! has_invalid_coordinate::apply(box, visitor)
diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp
index 9f278ac04..b91dc6a69 100644
--- a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp
+++ b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp
@@ -48,11 +48,6 @@ class has_valid_self_turns
private:
typedef typename point_type::type point_type;
- typedef typename strategy::intersection::services::default_strategy
- <
- typename cs_tag::type
- >::type intersection_strategy_type;
-
typedef typename geometry::rescale_policy_type
<
point_type
@@ -75,15 +70,14 @@ public:
> turn_type;
// returns true if all turns are valid
- template
+ template
static inline bool apply(Geometry const& geometry,
Turns& turns,
- VisitPolicy& visitor)
+ VisitPolicy& visitor,
+ Strategy const& strategy)
{
boost::ignore_unused(visitor);
- intersection_strategy_type intersection_strategy;
-
rescale_policy_type robust_policy
= geometry::get_rescale_policy(geometry);
@@ -93,7 +87,7 @@ public:
> interrupt_policy;
geometry::self_turns(geometry,
- intersection_strategy,
+ strategy,
robust_policy,
turns,
interrupt_policy);
@@ -110,11 +104,11 @@ public:
}
// returns true if all turns are valid
- template
- static inline bool apply(Geometry const& geometry, VisitPolicy& visitor)
+ template
+ static inline bool apply(Geometry const& geometry, VisitPolicy& visitor, Strategy const& strategy)
{
std::vector turns;
- return apply(geometry, turns, visitor);
+ return apply(geometry, turns, visitor, strategy);
}
};
diff --git a/include/boost/geometry/algorithms/detail/is_valid/interface.hpp b/include/boost/geometry/algorithms/detail/is_valid/interface.hpp
index 5a04a9282..ee013377c 100644
--- a/include/boost/geometry/algorithms/detail/is_valid/interface.hpp
+++ b/include/boost/geometry/algorithms/detail/is_valid/interface.hpp
@@ -1,8 +1,9 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2014-2015, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
@@ -23,48 +24,88 @@
#include
#include
#include
+#include
+#include
namespace boost { namespace geometry
{
+
+namespace resolve_strategy
+{
+struct is_valid
+{
+ template
+ static inline bool apply(Geometry const& geometry,
+ VisitPolicy& visitor,
+ Strategy const& strategy)
+ {
+ return dispatch::is_valid::apply(geometry, visitor, strategy);
+ }
-namespace resolve_variant {
+ template
+ static inline bool apply(Geometry const& geometry,
+ VisitPolicy& visitor,
+ default_strategy)
+ {
+ // NOTE: Currently the strategy is only used for Areal geometries
+ typedef typename strategy::intersection::services::default_strategy
+ <
+ typename cs_tag::type
+ >::type strategy_type;
+
+ return dispatch::is_valid::apply(geometry, visitor, strategy_type());
+ }
+};
+
+} // namespace resolve_strategy
+
+namespace resolve_variant
+{
template
struct is_valid
{
- template
- static inline bool apply(Geometry const& geometry, VisitPolicy& visitor)
+ template
+ static inline bool apply(Geometry const& geometry,
+ VisitPolicy& visitor,
+ Strategy const& strategy)
{
concepts::check();
- return dispatch::is_valid::apply(geometry, visitor);
+
+ return resolve_strategy::is_valid::apply(geometry, visitor, strategy);
}
};
template
struct is_valid >
{
- template
+ template
struct visitor : boost::static_visitor
{
- visitor(VisitPolicy& policy) : m_policy(policy) {}
+ visitor(VisitPolicy& policy, Strategy const& strategy)
+ : m_policy(policy)
+ , m_strategy(strategy)
+ {}
template
bool operator()(Geometry const& geometry) const
{
- return is_valid::apply(geometry, m_policy);
+ return is_valid::apply(geometry, m_policy, m_strategy);
}
VisitPolicy& m_policy;
+ Strategy const& m_strategy;
};
- template
+ template
static inline bool
apply(boost::variant const& geometry,
- VisitPolicy& policy_visitor)
+ VisitPolicy& policy_visitor,
+ Strategy const& strategy)
{
- return boost::apply_visitor(visitor(policy_visitor),
+ return boost::apply_visitor(visitor