Ejemplo n.º 1
0
 bool GeoParser::parsePoint(const BSONObj &obj, Point *out) {
     if (isGeoJSONPoint(obj)) {
         parseGeoJSONPoint(obj, out);
         return true;
     } else if (isLegacyPoint(obj)) {
         parseLegacyPoint(obj, out);
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 bool GeoParser::parsePoint(const BSONObj &obj, S2Point *out) {
     if (isGeoJSONPoint(obj)) {
         parseGeoJSONPoint(obj, out);
         return true;
     } else if (isLegacyPoint(obj)) {
         BSONObjIterator it(obj);
         BSONElement x = it.next();
         BSONElement y = it.next();
         *out = coordToPoint(x.number(), y.number());
         return true;
     }
     return false;
 }