MongoDB C++ Driver  legacy-1.1.2
Public Member Functions | List of all members
mongo::geo::GeometryCollection< TCoordinates > Class Template Reference
+ Inheritance diagram for mongo::geo::GeometryCollection< TCoordinates >:

Public Member Functions

 GeometryCollection (const BSONObj &bson)
 GeometryCollection constructor. More...
 
 ~GeometryCollection ()
 Frees the heap memory for each geometry stored in this collection.
 
virtual BSONObj toBSON () const
 Obtain a BSON representation of this geometry collection. More...
 
virtual BoundingBox< TCoordinates > getBoundingBox () const
 Obtain the bounding box surrounding the set of geometries in this geometry collection. More...
 
virtual GeoObjType getType () const
 Get the geometry type of this object. More...
 
const std::vector< const GeoObj< TCoordinates > * > & getGeometries () const
 Get a vector of pointers to the geometries contained in this geometry collection. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from mongo::geo::Geometry< TCoordinates >
static BoundingBox< TCoordinates > * computeBoundingBox (const std::vector< Point< TCoordinates > > &points)
 Compute the bounding box around the given points. More...
 
static BoundingBox< TCoordinates > * computeBoundingBox (const std::vector< BoundingBox< TCoordinates > > &bboxes)
 Compute the smallest bounding box that contains the given bounding boxes. More...
 
static BoundingBox< TCoordinates > * parseBoundingBox (const BSONObj &bson)
 Parses the bounding box defined by the given geometry shape, represented in BSON. More...
 

Constructor & Destructor Documentation

template<typename TCoordinates >
mongo::geo::GeometryCollection< TCoordinates >::GeometryCollection ( const BSONObj bson)
explicit

GeometryCollection constructor.

Parameters
bsonA BSON representation of the geometry collection.

Member Function Documentation

template<typename TCoordinates >
BoundingBox< TCoordinates > mongo::geo::GeometryCollection< TCoordinates >::getBoundingBox ( ) const
virtual

Obtain the bounding box surrounding the set of geometries in this geometry collection.

Returns
A bounding box containing every geometry in this collection.

Implements mongo::geo::GeoObj< TCoordinates >.

template<typename TCoordinates >
const std::vector< const GeoObj< TCoordinates > * > & mongo::geo::GeometryCollection< TCoordinates >::getGeometries ( ) const

Get a vector of pointers to the geometries contained in this geometry collection.

Each GeoObj has been instantiated as the appropriate subclass of GeoObj. To determine the specific type of each pointed-to object, call ->getType() on the pointer.

This GeometryCollection object has ownership of the const GeoObj*'s returned.

Returns
a vector of const pointers to the geometries in this collection.
template<typename TCoordinates >
virtual GeoObjType mongo::geo::GeometryCollection< TCoordinates >::getType ( ) const
inlinevirtual

Get the geometry type of this object.

Returns
GeoObjType_GeometryCollection

Implements mongo::geo::GeoObj< TCoordinates >.

template<typename TCoordinates >
virtual BSONObj mongo::geo::GeometryCollection< TCoordinates >::toBSON ( ) const
inlinevirtual

Obtain a BSON representation of this geometry collection.

Example structure:

{ "type" : "GeometryCollection", "geometries" : [ { "type": "Point", "coordinates": [ 100.0, 0.0 ] }, { "type": "LineString", "coordinates": [ [ 101.0, 0.0 ], [ 102.0, 1.0 ] ] } ] }

Returns
a BSON representation of this geometry collection.

Implements mongo::geo::GeoObj< TCoordinates >.


The documentation for this class was generated from the following file: