summaryrefslogtreecommitdiff
path: root/src/mongo/db/geo
diff options
context:
space:
mode:
authorKevin Albertson <kevin.albertson@10gen.com>2015-06-29 12:22:34 -0400
committerKevin Albertson <kevin.albertson@10gen.com>2015-07-17 12:07:32 -0400
commitfa5851d3313e74086eb2c1340758e6b535decdf3 (patch)
treec6c647a2ba44763de79d8f55a8efe49457575570 /src/mongo/db/geo
parentc33f68518b06e6b98596a8133d097e75d8431293 (diff)
downloadmongo-fa5851d3313e74086eb2c1340758e6b535decdf3.tar.gz
SERVER-18921 Index points to finest level
Diffstat (limited to 'src/mongo/db/geo')
-rw-r--r--src/mongo/db/geo/geometry_container.cpp4
-rw-r--r--src/mongo/db/geo/geometry_container.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/geo/geometry_container.cpp b/src/mongo/db/geo/geometry_container.cpp
index c74918e40c2..f3bfca36cfb 100644
--- a/src/mongo/db/geo/geometry_container.cpp
+++ b/src/mongo/db/geo/geometry_container.cpp
@@ -42,6 +42,10 @@ bool GeometryContainer::isSimpleContainer() const {
return NULL != _point || NULL != _line || NULL != _polygon;
}
+bool GeometryContainer::isPoint() const {
+ return nullptr != _point;
+}
+
bool GeometryContainer::supportsContains() const {
return NULL != _polygon || NULL != _box || NULL != _cap || NULL != _multiPolygon ||
(NULL != _geometryCollection && (_geometryCollection->polygons.vector().size() > 0 ||
diff --git a/src/mongo/db/geo/geometry_container.h b/src/mongo/db/geo/geometry_container.h
index 95dc8525440..0d7cea0e7c4 100644
--- a/src/mongo/db/geo/geometry_container.h
+++ b/src/mongo/db/geo/geometry_container.h
@@ -61,6 +61,11 @@ public:
bool isSimpleContainer() const;
/**
+ * Whether this geometry is a point
+ */
+ bool isPoint() const;
+
+ /**
* Reports the CRS of the contained geometry.
* TODO: Rework once we have collections of multiple CRSes
*/