MongoDB C++ Driver legacy-1.1.2
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
mongo::geo::Parser< TCoordinates > Class Template Reference

Static Public Member Functions

static GeoObj< TCoordinates > * parse (const BSONObj &bson)
 Parse the given BSON into a geometry type.
 

Member Function Documentation

◆ parse()

template<typename TCoordinates >
GeoObj< TCoordinates > * mongo::geo::Parser< TCoordinates >::parse ( const BSONObj bson)
static

Parse the given BSON into a geometry type.

Caller has ownership of the returned pointer. An assertion is raised if the BSON is not a valid GeoJSON object.

Parameters
bsonThe BSON defining the geometry type. Must be a valid GeoJSON object and define a "type" field that describes its specific geometry.
Returns
A pointer to the instantiated geometry object. This object will be instantiated as the appropriate subclass of GeoObj. E.g., if the bson parameter defines a LineString, the returned GeoObj* actually points to a LineString. So the returned GeoObj* can be statically cast to a LineString* in such case.

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