diff --git a/doc/geometry.qbk b/doc/geometry.qbk
index cfe3b6deb..7ff1d6512 100644
--- a/doc/geometry.qbk
+++ b/doc/geometry.qbk
@@ -113,7 +113,6 @@ Boost.Geometry contains contributions by:
* Federico Fern\u00E1ndez (preliminary version of R-tree spatial index)
* Karsten Ahnert (patch for cross-track distance)
* Mats Taraldsvik (documentation: adapting a legacy model)
-* Menelaos Karavelas (on behalf of Oracle: distance, set operations, etc.)
[include imports.qbk]
diff --git a/doc/reference/status/area_status.qbk b/doc/reference/status/area_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/area_status.qbk
+++ b/doc/reference/status/area_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/centroid_status.qbk b/doc/reference/status/centroid_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/centroid_status.qbk
+++ b/doc/reference/status/centroid_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/clear_status.qbk b/doc/reference/status/clear_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/clear_status.qbk
+++ b/doc/reference/status/clear_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/correct_status.qbk b/doc/reference/status/correct_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/correct_status.qbk
+++ b/doc/reference/status/correct_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/covered_by_status.qbk b/doc/reference/status/covered_by_status.qbk
index 122666d12..cc550988b 100644
--- a/doc/reference/status/covered_by_status.qbk
+++ b/doc/reference/status/covered_by_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
]
diff --git a/doc/reference/status/crosses_status.qbk b/doc/reference/status/crosses_status.qbk
index 512f4bb78..6b1fe8758 100644
--- a/doc/reference/status/crosses_status.qbk
+++ b/doc/reference/status/crosses_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Variant][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
]
diff --git a/doc/reference/status/disjoint_status.qbk b/doc/reference/status/disjoint_status.qbk
index f6562c3a3..0760a55f8 100644
--- a/doc/reference/status/disjoint_status.qbk
+++ b/doc/reference/status/disjoint_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[Linestring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[Ring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Polygon][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
+[[Box][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Linestring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Ring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Polygon][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/distance_status.qbk b/doc/reference/status/distance_status.qbk
index 5dbdeba7f..9209452b6 100644
--- a/doc/reference/status/distance_status.qbk
+++ b/doc/reference/status/distance_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Segment][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Segment][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Variant][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
]
diff --git a/doc/reference/status/envelope_status.qbk b/doc/reference/status/envelope_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/envelope_status.qbk
+++ b/doc/reference/status/envelope_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/equals_status.qbk b/doc/reference/status/equals_status.qbk
index 9abd11cbc..2628e4483 100644
--- a/doc/reference/status/equals_status.qbk
+++ b/doc/reference/status/equals_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Linestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[Ring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Polygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[MultiPolygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
+[[Linestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
+[[Polygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Variant][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/intersects_status.qbk b/doc/reference/status/intersects_status.qbk
index f6562c3a3..0760a55f8 100644
--- a/doc/reference/status/intersects_status.qbk
+++ b/doc/reference/status/intersects_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[Linestring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[Ring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Polygon][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
+[[Box][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Linestring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Ring][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Polygon][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiPoint][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/length_status.qbk b/doc/reference/status/length_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/length_status.qbk
+++ b/doc/reference/status/length_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/num_points_status.qbk b/doc/reference/status/num_points_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/num_points_status.qbk
+++ b/doc/reference/status/num_points_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/overlaps_status.qbk b/doc/reference/status/overlaps_status.qbk
index bcb8a672e..8d26c4daf 100644
--- a/doc/reference/status/overlaps_status.qbk
+++ b/doc/reference/status/overlaps_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Linestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[Ring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[Polygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
-[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[MultiPolygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Linestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Polygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Variant][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
]
diff --git a/doc/reference/status/perimeter_status.qbk b/doc/reference/status/perimeter_status.qbk
index e4d8d3023..edff68193 100644
--- a/doc/reference/status/perimeter_status.qbk
+++ b/doc/reference/status/perimeter_status.qbk
@@ -10,4 +10,5 @@
[[MultiPoint][ [$img/ok.png] ]]
[[MultiLinestring][ [$img/ok.png] ]]
[[MultiPolygon][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ]]
]
diff --git a/doc/reference/status/within_status.qbk b/doc/reference/status/within_status.qbk
index 122666d12..cc550988b 100644
--- a/doc/reference/status/within_status.qbk
+++ b/doc/reference/status/within_status.qbk
@@ -1,13 +1,14 @@
[heading Supported geometries]
[table
-[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]]
-[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Box][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
-[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
-[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ]]
-[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon][Variant]]
+[[Point][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Segment][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Box][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Linestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[Ring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Polygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[MultiPoint][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiLinestring][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
+[[MultiPolygon][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/ok.png] ][ [$img/ok.png] ][ [$img/ok.png] ]]
+[[Variant][ [$img/ok.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]]
]
diff --git a/doc/src/docutils/tools/implementation_status/implementation_status.cpp b/doc/src/docutils/tools/implementation_status/implementation_status.cpp
index 392002d6f..1a3e1e18e 100644
--- a/doc/src/docutils/tools/implementation_status/implementation_status.cpp
+++ b/doc/src/docutils/tools/implementation_status/implementation_status.cpp
@@ -30,7 +30,8 @@ static const int polygon = 5;
static const int multi_point = 6;
static const int multi_linestring = 7;
static const int multi_polygon = 8;
-static const int geometry_count = 9;
+static const int variant = 9;
+static const int geometry_count = 10;
struct compile_bjam
{
@@ -149,6 +150,7 @@ inline std::string typedef_string(int type, bool clockwise, bool open)
out << "bg::model::ring
";
break;
+ case variant :
case polygon :
out << "bg::model::polygon
";
@@ -174,6 +176,7 @@ inline std::string wkt_string(int type)
case segment : return "LINESTRING(1 1,2 2)";
case box : return "POLYGON((1 1,2 2))";
case polygon :
+ case variant :
case ring :
return "POLYGON((0 0,0 1,1 1,0 0))";
case multi_point : return "MULTIPOINT((1 1),(2 2))";
@@ -196,6 +199,7 @@ inline std::string geometry_string(int type)
case multi_point : return "MultiPoint";
case multi_linestring : return "MultiLinestring";
case multi_polygon : return "MultiPolygon";
+ case variant : return "Variant";
}
return "";
}
@@ -235,15 +239,37 @@ int report_library(CompilePolicy& compile_policy,
{
std::ofstream out("tmp/t.cpp");
+ std::string name = "geometry";
+
+ if (type == variant)
+ {
+ name = "source";
+ }
+
+ out << "#include " << std::endl;
+
+ if (type == variant)
+ {
+ out << "#include " << std::endl;
+ }
+
out
- << "#include " << std::endl
<< "template " << std::endl
<< "inline void test()" << std::endl
<< "{" << std::endl
<< " namespace bg = boost::geometry;" << std::endl
- << " " << typedef_string(type, clockwise, open) << " geometry;" << std::endl
- << " bg::read_wkt(\"" << wkt_string(type) << "\", geometry);" << std::endl;
+ << " " << typedef_string(type, clockwise, open) << " " << name << ";" << std::endl
+ << " bg::read_wkt(\"" << wkt_string(type) << "\", " << name << ");" << std::endl;
+ if (type == variant)
+ {
+ out
+ << " typedef " << typedef_string(polygon, clockwise, open) << " type1;" << std::endl
+ << " typedef " << typedef_string(box, clockwise, open) << " type2;" << std::endl
+ << " boost::variant geometry;" << std::endl
+ << " geometry = source;"
+ << std::endl;
+ }
if (algo.arity > 1)
{
diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp
index 106818d67..191866b9a 100644
--- a/include/boost/geometry/algorithms/centroid.hpp
+++ b/include/boost/geometry/algorithms/centroid.hpp
@@ -32,7 +32,6 @@
#include
#include
-#include
#include
#include
#include
diff --git a/include/boost/geometry/algorithms/comparable_distance.hpp b/include/boost/geometry/algorithms/comparable_distance.hpp
index 4f0563a8a..55b827bd3 100644
--- a/include/boost/geometry/algorithms/comparable_distance.hpp
+++ b/include/boost/geometry/algorithms/comparable_distance.hpp
@@ -1,8 +1,13 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// 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-2014 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
+
+// This file was modified by Oracle on 2014.
+// Modifications copyright (c) 2014, 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.
@@ -14,14 +19,43 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_COMPARABLE_DISTANCE_HPP
#define BOOST_GEOMETRY_ALGORITHMS_COMPARABLE_DISTANCE_HPP
+#include
#include
+#include
namespace boost { namespace geometry
{
+// MK::need to add qbk documentation
+template
+inline typename strategy::distance::services::return_type
+ <
+ typename strategy::distance::services::comparable_type
+ <
+ Strategy
+ >::type,
+ typename point_type::type,
+ typename point_type::type
+ >::type
+comparable_distance(Geometry1 const& geometry1, Geometry2 const& geometry2,
+ Strategy const& strategy)
+{
+ concept::check();
+ concept::check();
+
+ return distance(geometry1, geometry2,
+ strategy::distance::services::get_comparable
+ <
+ Strategy
+ >::apply(strategy)
+ );
+}
+
+
+
/*!
\brief \brief_calc2{comparable distance measurement}
\ingroup distance
@@ -39,32 +73,22 @@ namespace boost { namespace geometry
\qbk{[include reference/algorithms/comparable_distance.qbk]}
*/
template
-inline typename default_distance_result::type comparable_distance(
- Geometry1 const& geometry1, Geometry2 const& geometry2)
+inline typename default_comparable_distance_result::type
+comparable_distance(Geometry1 const& geometry1, Geometry2 const& geometry2)
{
concept::check();
concept::check();
- typedef typename point_type::type point1_type;
- typedef typename point_type::type point2_type;
-
- // Define a point-point-distance-strategy
- // for either the normal case, either the reversed case
-
+ // Define the default-distance-strategy
typedef typename strategy::distance::services::comparable_type
<
- typename boost::mpl::if_c
+ typename detail::distance::default_strategy
<
- geometry::reverse_dispatch
- ::type::value,
- typename strategy::distance::services::default_strategy
- ::type,
- typename strategy::distance::services::default_strategy
- ::type
+ Geometry1, Geometry2
>::type
- >::type strategy_type;
+ >::type default_comparable_strategy_type;
- return distance(geometry1, geometry2, strategy_type());
+ return distance(geometry1, geometry2, default_comparable_strategy_type());
}
diff --git a/include/boost/geometry/algorithms/detail/distance/backward_compatibility.hpp b/include/boost/geometry/algorithms/detail/distance/backward_compatibility.hpp
new file mode 100644
index 000000000..5dd69cbcd
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/backward_compatibility.hpp
@@ -0,0 +1,346 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// 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.
+
+// This file was modified by Oracle on 2014.
+// Modifications copyright (c) 2014, 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.
+
+// 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)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BACKWARD_COMPATIBILITY_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BACKWARD_COMPATIBILITY_HPP
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+
+#include
+
+#include
+#include
+#include
+#include
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace distance
+{
+
+
+template
+struct point_to_segment
+{
+ static inline typename strategy::distance::services::return_type
+ <
+ Strategy,
+ Point,
+ typename point_type::type
+ >::type
+ apply(Point const& point, Segment const& segment, Strategy const& )
+ {
+ typename detail::distance::default_ps_strategy
+ <
+ Point,
+ typename point_type::type,
+ Strategy
+ >::type segment_strategy;
+
+ typename point_type::type p[2];
+ geometry::detail::assign_point_from_index<0>(segment, p[0]);
+ geometry::detail::assign_point_from_index<1>(segment, p[1]);
+ return segment_strategy.apply(point, p[0], p[1]);
+ }
+};
+
+
+}} // namespace detail::distance
+#endif // DOXYGEN_NO_DETAIL
+
+
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+// Point-segment version 1, with point-point strategy
+template
+struct distance
+<
+ Point, Segment, Strategy,
+ point_tag, segment_tag, strategy_tag_distance_point_point,
+ false
+> : detail::distance::point_to_segment
+{};
+
+
+// Point-line version 1, where point-point strategy is specified
+template
+struct distance
+<
+ Point, Linestring, Strategy,
+ point_tag, linestring_tag, strategy_tag_distance_point_point,
+ false
+>
+{
+
+ static inline typename return_type::type>::type
+ apply(Point const& point,
+ Linestring const& linestring,
+ Strategy const&)
+ {
+ typedef typename detail::distance::default_ps_strategy
+ <
+ Point,
+ typename point_type::type,
+ Strategy
+ >::type ps_strategy_type;
+
+ return detail::distance::point_to_range
+ <
+ Point, Linestring, closed, ps_strategy_type
+ >::apply(point, linestring, ps_strategy_type());
+ }
+};
+
+
+// Point-ring , where point-point strategy is specified
+template
+struct distance
+<
+ Point, Ring, Strategy,
+ point_tag, ring_tag, strategy_tag_distance_point_point,
+ false
+>
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Point const& point,
+ Ring const& ring,
+ Strategy const&)
+ {
+ typedef typename detail::distance::default_ps_strategy
+ <
+ Point,
+ typename point_type::type,
+ Strategy
+ >::type ps_strategy_type;
+
+ std::pair
+ dc = detail::distance::point_to_ring
+ <
+ Point, Ring,
+ geometry::closure::value,
+ ps_strategy_type
+ >::apply(point, ring, ps_strategy_type());
+
+ return dc.second ? return_type(0) : dc.first;
+ }
+};
+
+
+// Point-polygon , where point-point strategy is specified
+template
+struct distance
+<
+ Point, Polygon, Strategy,
+ point_tag, polygon_tag, strategy_tag_distance_point_point,
+ false
+>
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Point const& point,
+ Polygon const& polygon,
+ Strategy const&)
+ {
+ typedef typename detail::distance::default_ps_strategy
+ <
+ Point,
+ typename point_type::type,
+ Strategy
+ >::type ps_strategy_type;
+
+ std::pair
+ dc = detail::distance::point_to_polygon
+ <
+ Point, Polygon,
+ geometry::closure::value,
+ ps_strategy_type
+ >::apply(point, polygon, ps_strategy_type());
+
+ return dc.second ? return_type(0) : dc.first;
+ }
+};
+
+
+
+
+namespace splitted_dispatch
+{
+
+
+template
+<
+ typename Point,
+ typename MultiGeometry,
+ typename MultiGeometryTag,
+ typename Strategy
+>
+struct distance_single_to_multi
+ <
+ Point, MultiGeometry, Strategy,
+ point_tag, MultiGeometryTag,
+ strategy_tag_distance_point_point
+ >
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Point const& point,
+ MultiGeometry const& multigeometry,
+ Strategy const&)
+ {
+ typedef typename detail::distance::default_ps_strategy
+ <
+ Point,
+ typename point_type::type,
+ Strategy
+ >::type ps_strategy_type;
+
+ return distance_single_to_multi
+ <
+ Point, MultiGeometry, ps_strategy_type,
+ point_tag, MultiGeometryTag,
+ strategy_tag_distance_point_segment
+ >::apply(point, multigeometry, ps_strategy_type());
+ }
+};
+
+
+template
+<
+ typename Geometry,
+ typename MultiPoint,
+ typename GeometryTag,
+ typename Strategy
+>
+struct distance_single_to_multi
+ <
+ Geometry, MultiPoint, Strategy,
+ GeometryTag, multi_point_tag,
+ strategy_tag_distance_point_point
+ >
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Geometry const& geometry,
+ MultiPoint const& multipoint,
+ Strategy const&)
+ {
+ typedef typename detail::distance::default_ps_strategy
+ <
+ typename point_type::type,
+ typename point_type::type,
+ Strategy
+ >::type ps_strategy_type;
+
+ return distance_single_to_multi
+ <
+ Geometry, MultiPoint, ps_strategy_type,
+ GeometryTag, multi_point_tag,
+ strategy_tag_distance_point_segment
+ >::apply(geometry, multipoint, ps_strategy_type());
+ }
+};
+
+
+template
+<
+ typename MultiPoint,
+ typename MultiGeometry,
+ typename MultiGeometryTag,
+ typename Strategy
+>
+struct distance_multi_to_multi
+ <
+ MultiPoint, MultiGeometry, Strategy,
+ multi_point_tag, MultiGeometryTag,
+ strategy_tag_distance_point_point
+ >
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(MultiPoint const& multipoint,
+ MultiGeometry const& multigeometry,
+ Strategy const&)
+ {
+ typedef typename detail::distance::default_ps_strategy
+ <
+ typename point_type::type,
+ typename point_type::type,
+ Strategy
+ >::type ps_strategy_type;
+
+ return distance_multi_to_multi
+ <
+ MultiPoint, MultiGeometry, ps_strategy_type,
+ multi_point_tag, MultiGeometryTag,
+ strategy_tag_distance_point_segment
+ >::apply(multipoint, multigeometry, ps_strategy_type());
+ }
+};
+
+
+} // namespace splitted_dispatch
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BACKWARD_COMPATIBILITY_HPP
diff --git a/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp
new file mode 100644
index 000000000..7b032a19c
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp
@@ -0,0 +1,59 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2014, Oracle and/or its affiliates.
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+
+// Licensed under the Boost Software License version 1.0.
+// http://www.boost.org/users/license.html
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BOX_TO_BOX_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BOX_TO_BOX_HPP
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+template
+struct distance
+ <
+ Box1, Box2, Strategy, box_tag, box_tag,
+ strategy_tag_distance_box_box, false
+ >
+{
+ static inline typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type
+ apply(Box1 const& box1, Box2 const& box2, Strategy const& strategy)
+ {
+ boost::ignore_unused_variable_warning(strategy);
+ return strategy.apply(box1, box2);
+ }
+};
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BOX_TO_BOX_HPP
diff --git a/include/boost/geometry/algorithms/detail/distance/default_strategies.hpp b/include/boost/geometry/algorithms/detail/distance/default_strategies.hpp
new file mode 100644
index 000000000..131265c0e
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/default_strategies.hpp
@@ -0,0 +1,147 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// 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.
+
+// This file was modified by Oracle on 2014.
+// Modifications copyright (c) 2014, 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.
+
+// 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)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_DEFAULT_STRATEGIES_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_DEFAULT_STRATEGIES_HPP
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace distance
+{
+
+
+
+// Helper metafunction for default strategy retrieval
+template
+<
+ typename Geometry1,
+ typename Geometry2,
+ typename Tag1 = typename tag_cast
+ <
+ typename tag::type, pointlike_tag
+ >::type,
+ typename Tag2 = typename tag_cast
+ <
+ typename tag::type, pointlike_tag
+ >::type,
+ bool Reverse = geometry::reverse_dispatch::type::value
+>
+struct default_strategy
+ : strategy::distance::services::default_strategy
+ <
+ segment_tag,
+ typename point_type::type,
+ typename point_type::type
+ >
+{};
+
+template
+<
+ typename Geometry1,
+ typename Geometry2,
+ typename Tag1,
+ typename Tag2
+>
+struct default_strategy
+ : default_strategy
+{};
+
+
+template
+struct default_strategy
+ <
+ Pointlike1, Pointlike2,
+ pointlike_tag, pointlike_tag, false
+ > : strategy::distance::services::default_strategy
+ <
+ point_tag,
+ typename point_type::type,
+ typename point_type::type
+ >
+{};
+
+
+template
+struct default_strategy
+ : strategy::distance::services::default_strategy
+ <
+ point_tag,
+ typename point_type::type,
+ typename point_type::type,
+ cartesian_tag,
+ cartesian_tag,
+ void,
+ box_tag
+ >
+{};
+
+
+template
+struct default_strategy
+ : strategy::distance::services::default_strategy
+ <
+ box_tag,
+ typename point_type::type,
+ typename point_type::type,
+ cartesian_tag,
+ cartesian_tag,
+ void,
+ box_tag
+ >
+{};
+
+
+
+// Helper metafunction for default point-segment strategy retrieval
+template
+struct default_ps_strategy
+ : strategy::distance::services::default_strategy
+ <
+ segment_tag,
+ typename point_type::type,
+ typename point_type::type,
+ typename cs_tag::type>::type,
+ typename cs_tag::type>::type,
+ Strategy
+ >
+{};
+
+
+
+}} // namespace detail::distance
+#endif // DOXYGEN_NO_DETAIL
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_DEFAULT_STRATEGIES_HPP
diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_to_geometry_rtree.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_to_geometry_rtree.hpp
new file mode 100644
index 000000000..faa1f20a8
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/geometry_to_geometry_rtree.hpp
@@ -0,0 +1,370 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2014, Oracle and/or its affiliates.
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+
+// Licensed under the Boost Software License version 1.0.
+// http://www.boost.org/users/license.html
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_GEOMETRY_TO_GEOMETRY_RTREE_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_GEOMETRY_TO_GEOMETRY_RTREE_HPP
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace distance
+{
+
+
+
+template
+<
+ typename RTreePoint,
+ typename Geometry,
+ typename Strategy
+>
+class point_range_to_geometry_rtree
+{
+private:
+ typedef typename strategy::distance::services::comparable_type
+ <
+ Strategy
+ >::type comparable_strategy;
+
+ typedef typename strategy::distance::services::return_type
+ <
+ comparable_strategy,
+ RTreePoint,
+ typename point_type::type
+ >::type comparable_return_type;
+
+ typedef index::rtree > r_tree;
+
+ // functor to evaluate minimum comparable distance
+ struct minimum_comparable_distance_evaluator
+ {
+ r_tree const& m_r_tree;
+ comparable_strategy const& m_cstrategy;
+ bool m_first;
+ comparable_return_type m_min_cd;
+
+ minimum_comparable_distance_evaluator
+ (r_tree const& r_tree, comparable_strategy const& cstrategy)
+ : m_r_tree(r_tree)
+ , m_cstrategy(cstrategy)
+ , m_first(true)
+ , m_min_cd()
+ {}
+
+ template
+ inline void operator()(QueryGeometry const& query_geometry)
+ {
+ typename r_tree::value_type t_v;
+ std::size_t n =
+ m_r_tree.query(index::nearest(query_geometry, 1), &t_v);
+
+ BOOST_ASSERT( n > 0 );
+
+ comparable_return_type cd = dispatch::distance
+ <
+ typename r_tree::value_type,
+ QueryGeometry,
+ comparable_strategy
+ >::apply(t_v, query_geometry, m_cstrategy);
+
+ if ( m_first || cd < m_min_cd )
+ {
+ m_first = false;
+ m_min_cd = cd;
+ }
+ }
+ };
+
+
+
+ // class to choose between for_each_point and for_each_segment
+ template ::type>
+ struct for_each_selector
+ {
+ typedef dispatch::for_each_segment type;
+ };
+
+ template
+ struct for_each_selector
+ {
+ typedef dispatch::for_each_point type;
+ };
+
+public:
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ RTreePoint,
+ typename point_type::type
+ >::type return_type;
+
+ template
+ static inline return_type apply(PointIterator points_first,
+ PointIterator points_beyond,
+ Geometry const& geometry,
+ Strategy const& strategy)
+ {
+ BOOST_ASSERT( points_first != points_beyond );
+
+ if ( geometry::has_one_element(points_first, points_beyond) )
+ {
+ return dispatch::distance
+ <
+ typename std::iterator_traits::value_type,
+ Geometry,
+ Strategy
+ >::apply(*points_first, geometry, strategy);
+ }
+
+ // create -- packing algorithm
+ r_tree rt(points_first, points_beyond);
+
+ minimum_comparable_distance_evaluator
+ functor(rt,
+ strategy::distance::services::get_comparable
+ <
+ Strategy
+ >::apply(strategy));
+
+ for_each_selector::type::apply(geometry, functor);
+
+ return strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy, Strategy, RTreePoint, Geometry
+ >::apply(functor.m_min_cd);
+ }
+};
+
+
+
+template
+<
+ typename Geometry1,
+ typename Geometry2,
+ typename Strategy
+>
+class geometry_to_geometry_rtree
+{
+ // the following works with linear geometries seen as ranges of points
+ //
+ // we compute the r-tree for the points of one range and then,
+ // compute nearest points for the segments of the other,
+ // ... and ...
+ // vice versa.
+
+private:
+ typedef typename strategy::distance::services::comparable_type
+ <
+ Strategy
+ >::type comparable_strategy;
+
+ typedef typename strategy::distance::services::return_type
+ <
+ comparable_strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type comparable_return_type;
+
+public:
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Geometry1 const& geometry1,
+ Geometry2 const& geometry2,
+ Strategy const& strategy,
+ bool check_intersection = true)
+ {
+ point_iterator first1 = points_begin(geometry1);
+ point_iterator beyond1 = points_end(geometry1);
+ point_iterator first2 = points_begin(geometry2);
+ point_iterator beyond2 = points_end(geometry2);
+
+ if ( geometry::has_one_element(first1, beyond1) )
+ {
+ return dispatch::distance
+ <
+ typename point_type::type,
+ Geometry2,
+ Strategy
+ >::apply(*first1, geometry2, strategy);
+ }
+
+ if ( geometry::has_one_element(first2, beyond2) )
+ {
+ return dispatch::distance
+ <
+ typename point_type::type,
+ Geometry1,
+ Strategy
+ >::apply(*first2, geometry1, strategy);
+ }
+
+ if ( check_intersection && geometry::intersects(geometry1, geometry2) )
+ {
+ return return_type(0);
+ }
+
+ comparable_strategy cstrategy =
+ strategy::distance::services::get_comparable
+ <
+ Strategy
+ >::apply(strategy);
+
+ comparable_return_type cdist1 = point_range_to_geometry_rtree
+ <
+ typename point_type::type,
+ Geometry2,
+ comparable_strategy
+ >::apply(first1, beyond1, geometry2, cstrategy);
+
+ comparable_return_type cdist2 = point_range_to_geometry_rtree
+ <
+ typename point_type::type,
+ Geometry1,
+ comparable_strategy
+ >::apply(first2, beyond2, geometry1, cstrategy);
+
+
+ return strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy, Strategy, Geometry1, Geometry2
+ >::apply( (std::min)(cdist1, cdist2) );
+ }
+};
+
+
+
+
+}} // namespace detail::distance
+#endif // DOXYGEN_NO_DETAIL
+
+
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+template
+struct distance
+ <
+ Linestring1, Linestring2, Strategy,
+ linestring_tag, linestring_tag,
+ strategy_tag_distance_point_segment, false
+ >
+ : detail::distance::geometry_to_geometry_rtree
+ <
+ Linestring1, Linestring2, Strategy
+ >
+{};
+
+
+
+template
+struct distance
+ <
+ Linestring, Polygon, Strategy,
+ linestring_tag, polygon_tag,
+ strategy_tag_distance_point_segment, false
+ >
+ : detail::distance::geometry_to_geometry_rtree
+ <
+ Linestring, Polygon, Strategy
+ >
+{};
+
+
+
+template
+struct distance
+ <
+ Linestring, Ring, Strategy,
+ linestring_tag, ring_tag,
+ strategy_tag_distance_point_segment, false
+ >
+ : detail::distance::geometry_to_geometry_rtree
+ <
+ Linestring, Ring, Strategy
+ >
+{};
+
+
+
+template
+struct distance
+ <
+ Polygon1, Polygon2, Strategy,
+ polygon_tag, polygon_tag,
+ strategy_tag_distance_point_segment, false
+ >
+ : detail::distance::geometry_to_geometry_rtree
+ <
+ Polygon1, Polygon2, Strategy
+ >
+{};
+
+
+
+template
+struct distance
+ <
+ Polygon, Ring, Strategy,
+ polygon_tag, ring_tag,
+ strategy_tag_distance_point_segment, false
+ >
+ : detail::distance::geometry_to_geometry_rtree
+ <
+ Polygon, Ring, Strategy
+ >
+{};
+
+
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_GEOMETRY_TO_GEOMETRY_RTREE_HPP
diff --git a/include/boost/geometry/algorithms/detail/distance/multi_to_multi.hpp b/include/boost/geometry/algorithms/detail/distance/multi_to_multi.hpp
new file mode 100644
index 000000000..1e6e3c77f
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/multi_to_multi.hpp
@@ -0,0 +1,257 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// 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.
+
+// This file was modified by Oracle on 2014.
+// Modifications copyright (c) 2014, 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.
+
+// 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)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_MULTI_TO_MULTI_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_MULTI_TO_MULTI_HPP
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+
+#include
+
+#include
+#include
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace distance
+{
+
+
+
+template
+class distance_multi_to_multi_generic
+{
+private:
+ typedef typename strategy::distance::services::comparable_type
+ <
+ Strategy
+ >::type comparable_strategy;
+
+ typedef typename strategy::distance::services::return_type
+ <
+ comparable_strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type comparable_return_type;
+
+public:
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Multi1 const& multi1,
+ Multi2 const& multi2, Strategy const& strategy)
+ {
+ comparable_return_type min_cdist = comparable_return_type();
+ bool first = true;
+
+ comparable_strategy cstrategy =
+ strategy::distance::services::get_comparable
+ <
+ Strategy
+ >::apply(strategy);
+
+ for(typename range_iterator::type it = boost::begin(multi1);
+ it != boost::end(multi1);
+ ++it, first = false)
+ {
+ comparable_return_type cdist =
+ dispatch::splitted_dispatch::distance_single_to_multi
+ <
+ typename range_value::type,
+ Multi2,
+ comparable_strategy,
+ typename tag::type>::type,
+ typename tag::type,
+ typename strategy::distance::services::tag
+ <
+ comparable_strategy
+ >::type
+ >::apply(*it, multi2, cstrategy);
+ if (first || cdist < min_cdist)
+ {
+ min_cdist = cdist;
+ }
+ if ( geometry::math::equals(min_cdist, 0) )
+ {
+ break;
+ }
+ }
+
+ return strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy,
+ Strategy,
+ Multi1,
+ Multi2
+ >::apply(min_cdist);
+ }
+};
+
+
+}} // namespace detail::distance
+#endif // DOXYGEN_NO_DETAIL
+
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+namespace splitted_dispatch
+{
+
+
+template
+<
+ typename MultiGeometry1,
+ typename MultiGeometry2,
+ typename Strategy,
+ typename Tag1,
+ typename Tag2,
+ typename StrategyTag
+>
+struct distance_multi_to_multi
+ : not_implemented
+{};
+
+
+
+template
+<
+ typename MultiPoint,
+ typename MultiPolygon,
+ typename Strategy
+>
+struct distance_multi_to_multi
+ <
+ MultiPoint, MultiPolygon, Strategy,
+ multi_point_tag, multi_polygon_tag,
+ strategy_tag_distance_point_segment
+ > : detail::distance::distance_multi_to_multi_generic
+ <
+ MultiPoint, MultiPolygon, Strategy
+ >
+{};
+
+
+
+template
+<
+ typename MultiLinestring1,
+ typename MultiLinestring2,
+ typename Strategy
+>
+struct distance_multi_to_multi
+ <
+ MultiLinestring1, MultiLinestring2, Strategy,
+ multi_linestring_tag, multi_linestring_tag,
+ strategy_tag_distance_point_segment
+ > : detail::distance::geometry_to_geometry_rtree
+ <
+ MultiLinestring1, MultiLinestring2, Strategy
+ >
+{};
+
+
+template
+<
+ typename MultiLinestring,
+ typename MultiPolygon,
+ typename Strategy
+>
+struct distance_multi_to_multi
+ <
+ MultiLinestring, MultiPolygon, Strategy,
+ multi_linestring_tag, multi_polygon_tag,
+ strategy_tag_distance_point_segment
+ > : detail::distance::geometry_to_geometry_rtree
+ <
+ MultiLinestring, MultiPolygon, Strategy
+ >
+{};
+
+
+template
+struct distance_multi_to_multi
+ <
+ MultiPolygon1, MultiPolygon2, Strategy,
+ multi_polygon_tag, multi_polygon_tag,
+ strategy_tag_distance_point_segment
+ > : detail::distance::geometry_to_geometry_rtree
+ <
+ MultiPolygon1, MultiPolygon2, Strategy
+ >
+{};
+
+
+} // namespace splitted_dispatch
+
+
+
+
+template
+<
+ typename MultiGeometry1,
+ typename MultiGeometry2,
+ typename Strategy,
+ typename StrategyTag
+>
+struct distance
+ <
+ MultiGeometry1, MultiGeometry2, Strategy, multi_tag, multi_tag,
+ StrategyTag, false
+ > : splitted_dispatch::distance_multi_to_multi
+ <
+ MultiGeometry1, MultiGeometry2, Strategy,
+ typename geometry::tag::type,
+ typename geometry::tag::type,
+ StrategyTag
+ >
+{};
+
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_MULTI_TO_MULTI_HPP
diff --git a/include/boost/geometry/algorithms/detail/distance/multipoint_to_range.hpp b/include/boost/geometry/algorithms/detail/distance/multipoint_to_range.hpp
new file mode 100644
index 000000000..5a800175c
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/multipoint_to_range.hpp
@@ -0,0 +1,182 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2014, Oracle and/or its affiliates.
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+
+// Licensed under the Boost Software License version 1.0.
+// http://www.boost.org/users/license.html
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_MULTIPOINT_TO_RANGE_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_MULTIPOINT_TO_RANGE_HPP
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace distance
+{
+
+template
+struct multipoint_to_multipoint
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(MultiPoint1 const& multipoint1,
+ MultiPoint2 const& multipoint2,
+ Strategy const& strategy)
+ {
+ if ( boost::size(multipoint1) > boost::size(multipoint2) )
+
+ {
+ return multipoint_to_multipoint
+ <
+ MultiPoint2, MultiPoint1, Strategy
+ >::apply(multipoint2, multipoint1, strategy);
+ }
+
+ return point_range_to_geometry_rtree
+ <
+ typename point_type::type,
+ MultiPoint2,
+ Strategy
+ >::apply(points_begin(multipoint1), points_end(multipoint1),
+ multipoint2, strategy);
+ }
+};
+
+
+}} // namespace detail::distance
+#endif // DOXYGEN_NO_DETAIL
+
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+namespace splitted_dispatch
+{
+
+// specializations of distance_single_to_multi for various geometry combinations
+
+template
+struct distance_single_to_multi
+ <
+ Linestring, MultiPoint, Strategy,
+ linestring_tag, multi_point_tag,
+ strategy_tag_distance_point_segment
+ >
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Linestring const& linestring,
+ MultiPoint const& multipoint,
+ Strategy const& strategy)
+ {
+ return detail::distance::point_range_to_geometry_rtree
+ <
+ typename point_type::type,
+ Linestring,
+ Strategy
+ >::apply(geometry::points_begin(multipoint),
+ geometry::points_end(multipoint),
+ linestring, strategy);
+
+ }
+};
+
+
+
+
+// specializations of distance_multi_to_multi for various geometry combinations
+
+
+template
+struct distance_multi_to_multi
+ <
+ MultiPoint1, MultiPoint2, Strategy,
+ multi_point_tag, multi_point_tag,
+ strategy_tag_distance_point_point
+ > : detail::distance::multipoint_to_multipoint
+ <
+ MultiPoint1, MultiPoint2, Strategy
+ >
+{};
+
+
+
+template
+<
+ typename MultiPoint,
+ typename MultiLinestring,
+ typename Strategy
+>
+struct distance_multi_to_multi
+ <
+ MultiPoint, MultiLinestring, Strategy,
+ multi_point_tag, multi_linestring_tag,
+ strategy_tag_distance_point_segment
+ >
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy,
+ typename point_type::type,
+ typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(MultiPoint const& multipoint,
+ MultiLinestring const& multilinestring,
+ Strategy const& strategy)
+ {
+ return detail::distance::point_range_to_geometry_rtree
+ <
+ typename point_type::type,
+ MultiLinestring,
+ Strategy
+ >::apply(geometry::points_begin(multipoint),
+ geometry::points_end(multipoint),
+ multilinestring, strategy);
+
+ }
+};
+
+} // namespace splitted_dispatch
+
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DISTANCE_ALTERNATE_HPP
diff --git a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp
new file mode 100644
index 000000000..7b89dcad1
--- /dev/null
+++ b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp
@@ -0,0 +1,431 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// 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.
+
+// This file was modified by Oracle on 2014.
+// Modifications copyright (c) 2014, 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.
+
+// 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)
+
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_POINT_TO_GEOMETRY_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_POINT_TO_GEOMETRY_HPP
+
+#include
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace distance
+{
+
+
+template
+struct point_to_point
+{
+ static inline
+ typename strategy::distance::services::return_type::type
+ apply(P1 const& p1, P2 const& p2, Strategy const& strategy)
+ {
+ boost::ignore_unused_variable_warning(strategy);
+ return strategy.apply(p1, p2);
+ }
+};
+
+
+template
+<
+ typename Point,
+ typename Range,
+ closure_selector Closure,
+ typename Strategy
+>
+class point_to_range
+{
+private:
+ typedef typename strategy::distance::services::comparable_type
+ <
+ Strategy
+ >::type comparable_strategy;
+
+ typedef typename strategy::distance::services::return_type
+ <
+ comparable_strategy, Point, typename point_type::type
+ >::type comparable_return_type;
+
+public:
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Point const& point, Range const& range,
+ Strategy const& strategy)
+ {
+ comparable_strategy c_strategy =
+ strategy::distance::services::get_comparable
+ <
+ Strategy
+ >::apply(strategy);
+
+ comparable_return_type const zero = comparable_return_type(0);
+
+ if (boost::size(range) == 0)
+ {
+ return zero;
+ }
+
+ typedef typename closeable_view::type view_type;
+
+ view_type view(range);
+
+ // line of one point: return point distance
+ typedef typename boost::range_iterator::type iterator_type;
+ iterator_type it = boost::begin(view);
+ iterator_type prev = it++;
+ if (it == boost::end(view))
+ {
+ return strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy, Strategy, Point, Range
+ >::apply( c_strategy.apply(point,
+ *boost::begin(view),
+ *boost::begin(view)) );
+ }
+
+ // start with first segment distance
+ comparable_return_type cd = c_strategy.apply(point, *prev, *it);
+
+ // check if other segments are closer
+ for (++prev, ++it; it != boost::end(view); ++prev, ++it)
+ {
+ comparable_return_type cds = c_strategy.apply(point, *prev, *it);
+ if (geometry::math::equals(cds, zero))
+ {
+ return strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy, Strategy, Point, Range
+ >::apply(zero);
+ }
+ else if (cds < cd)
+ {
+ cd = cds;
+ }
+ }
+
+ return strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy, Strategy, Point, Range
+ >::apply(cd);
+ }
+};
+
+
+template
+<
+ typename Point,
+ typename Ring,
+ closure_selector Closure,
+ typename Strategy
+>
+struct point_to_ring
+{
+ typedef std::pair
+ <
+ typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type,
+ bool
+ > distance_containment;
+
+ static inline distance_containment apply(Point const& point,
+ Ring const& ring,
+ Strategy const& strategy)
+ {
+ return distance_containment
+ (
+ point_to_range
+ <
+ Point,
+ Ring,
+ Closure,
+ Strategy
+ >::apply(point, ring, strategy),
+ geometry::within(point, ring)
+ );
+ }
+};
+
+
+
+template
+<
+ typename Point,
+ typename Polygon,
+ closure_selector Closure,
+ typename Strategy
+>
+class point_to_polygon
+{
+private:
+ typedef typename strategy::distance::services::comparable_type
+ <
+ Strategy
+ >::type comparable_strategy;
+
+ typedef typename strategy::distance::services::return_type
+ <
+ comparable_strategy, Point, typename point_type::type
+ >::type comparable_return_type;
+
+ typedef std::pair
+ <
+ comparable_return_type, bool
+ > comparable_distance_containment;
+
+public:
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+ typedef std::pair distance_containment;
+
+ static inline distance_containment apply(Point const& point,
+ Polygon const& polygon,
+ Strategy const& strategy)
+ {
+ comparable_strategy c_strategy =
+ strategy::distance::services::get_comparable
+ <
+ Strategy
+ >::apply(strategy);
+
+ // Check distance to all rings
+ typedef point_to_ring
+ <
+ Point,
+ typename ring_type::type,
+ Closure,
+ comparable_strategy
+ > per_ring;
+
+ comparable_distance_containment dc =
+ per_ring::apply(point, exterior_ring(polygon), c_strategy);
+
+ typename interior_return_type::type rings
+ = interior_rings(polygon);
+ for (typename boost::range_iterator
+ <
+ typename interior_type::type const
+ >::type it = boost::begin(rings);
+ it != boost::end(rings); ++it)
+ {
+ comparable_distance_containment dcr =
+ per_ring::apply(point, *it, c_strategy);
+ if (dcr.first < dc.first)
+ {
+ dc.first = dcr.first;
+ }
+ // If it was inside, and also inside inner ring,
+ // turn off the inside-flag, it is outside the polygon
+ if (dc.second && dcr.second)
+ {
+ dc.second = false;
+ }
+ }
+
+ return_type rd = strategy::distance::services::comparable_to_regular
+ <
+ comparable_strategy, Strategy, Point, Polygon
+ >::apply(dc.first);
+
+ return std::make_pair(rd, dc.second);
+ }
+};
+
+
+}} // namespace detail::distance
+#endif // DOXYGEN_NO_DETAIL
+
+
+
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+// Point-point
+template
+struct distance
+ <
+ P1, P2, Strategy,
+ point_tag, point_tag, strategy_tag_distance_point_point,
+ false
+ >
+ : detail::distance::point_to_point
+{};
+
+
+// Point-line version 2, where point-segment strategy is specified
+template
+struct distance
+<
+ Point, Linestring, Strategy,
+ point_tag, linestring_tag, strategy_tag_distance_point_segment,
+ false
+> : detail::distance::point_to_range
+{};
+
+
+// Point-ring , where point-segment strategy is specified
+template
+struct distance
+<
+ Point, Ring, Strategy,
+ point_tag, ring_tag, strategy_tag_distance_point_segment,
+ false
+>
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Point const& point,
+ Ring const& ring,
+ Strategy const& strategy)
+ {
+ std::pair
+ dc = detail::distance::point_to_ring
+ <
+ Point, Ring,
+ geometry::closure::value,
+ Strategy
+ >::apply(point, ring, strategy);
+
+ return dc.second ? return_type(0) : dc.first;
+ }
+};
+
+
+// Point-polygon , where point-segment strategy is specified
+template
+struct distance
+<
+ Point, Polygon, Strategy, point_tag, polygon_tag,
+ strategy_tag_distance_point_segment, false
+>
+{
+ typedef typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type::type
+ >::type return_type;
+
+ static inline return_type apply(Point const& point,
+ Polygon const& polygon,
+ Strategy const& strategy)
+ {
+ std::pair
+ dc = detail::distance::point_to_polygon
+ <
+ Point, Polygon,
+ geometry::closure::value,
+ Strategy
+ >::apply(point, polygon, strategy);
+
+ return dc.second ? return_type(0) : dc.first;
+ }
+};
+
+
+// Point-segment version 2, with point-segment strategy
+template
+struct distance
+<
+ Point, Segment, Strategy,
+ point_tag, segment_tag, strategy_tag_distance_point_segment,
+ false
+>
+{
+ static inline typename return_type::type>::type
+ apply(Point const& point,
+ Segment const& segment,
+ Strategy const& strategy)
+ {
+ typename point_type::type p[2];
+ geometry::detail::assign_point_from_index<0>(segment, p[0]);
+ geometry::detail::assign_point_from_index<1>(segment, p[1]);
+
+ boost::ignore_unused_variable_warning(strategy);
+ return strategy.apply(point, p[0], p[1]);
+ }
+};
+
+
+
+template
+struct distance
+ <
+ Point, Box, Strategy, point_tag, box_tag,
+ strategy_tag_distance_point_box, false
+ >
+{
+ static inline typename strategy::distance::services::return_type
+ <
+ Strategy, Point, typename point_type