diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/geo/geoparser.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/geo/geoparser.h')
-rw-r--r-- | src/mongo/db/geo/geoparser.h | 111 |
1 files changed, 56 insertions, 55 deletions
diff --git a/src/mongo/db/geo/geoparser.h b/src/mongo/db/geo/geoparser.h index 796db6b087f..91cdb6649ea 100644 --- a/src/mongo/db/geo/geoparser.h +++ b/src/mongo/db/geo/geoparser.h @@ -33,64 +33,65 @@ namespace mongo { - // This class parses geographic data. - // It parses a subset of GeoJSON and creates S2 shapes from it. - // See http://geojson.org/geojson-spec.html for the spec. - // - // This class also parses the ad-hoc geo formats that MongoDB introduced. - // - // parse* methods may do some more validation than the is* methods; they return false if they - // encounter invalid geometry and true if the geometry is parsed successfully. - class GeoParser { - public: - - // Geospatial specifier after $geoWithin / $geoIntersects predicates. - // i.e. "$box" in { $box: [[1, 2], [3, 4]] } - enum GeoSpecifier { - UNKNOWN = 0, - BOX, // $box - CENTER, // $center - POLYGON, // $polygon - CENTER_SPHERE, // $centerSphere - GEOMETRY // GeoJSON geometry, $geometry - }; +// This class parses geographic data. +// It parses a subset of GeoJSON and creates S2 shapes from it. +// See http://geojson.org/geojson-spec.html for the spec. +// +// This class also parses the ad-hoc geo formats that MongoDB introduced. +// +// parse* methods may do some more validation than the is* methods; they return false if they +// encounter invalid geometry and true if the geometry is parsed successfully. +class GeoParser { +public: + // Geospatial specifier after $geoWithin / $geoIntersects predicates. + // i.e. "$box" in { $box: [[1, 2], [3, 4]] } + enum GeoSpecifier { + UNKNOWN = 0, + BOX, // $box + CENTER, // $center + POLYGON, // $polygon + CENTER_SPHERE, // $centerSphere + GEOMETRY // GeoJSON geometry, $geometry + }; - // GeoJSON type defined in GeoJSON document. - // i.e. "Point" in { type: "Point", coordinates: [1, 2] } - enum GeoJSONType { - GEOJSON_UNKNOWN = 0, - GEOJSON_POINT, - GEOJSON_LINESTRING, - GEOJSON_POLYGON, - GEOJSON_MULTI_POINT, - GEOJSON_MULTI_LINESTRING, - GEOJSON_MULTI_POLYGON, - GEOJSON_GEOMETRY_COLLECTION - }; + // GeoJSON type defined in GeoJSON document. + // i.e. "Point" in { type: "Point", coordinates: [1, 2] } + enum GeoJSONType { + GEOJSON_UNKNOWN = 0, + GEOJSON_POINT, + GEOJSON_LINESTRING, + GEOJSON_POLYGON, + GEOJSON_MULTI_POINT, + GEOJSON_MULTI_LINESTRING, + GEOJSON_MULTI_POLYGON, + GEOJSON_GEOMETRY_COLLECTION + }; - static GeoSpecifier parseGeoSpecifier(const BSONElement& elem); - static GeoJSONType parseGeoJSONType(const BSONObj& obj); + static GeoSpecifier parseGeoSpecifier(const BSONElement& elem); + static GeoJSONType parseGeoJSONType(const BSONObj& obj); - // Legacy points can contain extra data as extra fields - these are valid to index - // e.g. { x: 1, y: 1, z: 1 } - static Status parseLegacyPoint(const BSONElement &elem, PointWithCRS *out, bool allowAddlFields = false); - // Parse the BSON object after $box, $center, etc. - static Status parseLegacyBox(const BSONObj& obj, BoxWithCRS *out); - static Status parseLegacyCenter(const BSONObj& obj, CapWithCRS *out); - static Status parseLegacyPolygon(const BSONObj& obj, PolygonWithCRS *out); - static Status parseCenterSphere(const BSONObj& obj, CapWithCRS *out); - static Status parseGeoJSONPolygon(const BSONObj &obj, PolygonWithCRS *out); - static Status parseGeoJSONPoint(const BSONObj &obj, PointWithCRS *out); - static Status parseGeoJSONLine(const BSONObj& obj, LineWithCRS* out); - static Status parseMultiPoint(const BSONObj &obj, MultiPointWithCRS *out); - static Status parseMultiLine(const BSONObj &obj, MultiLineWithCRS *out); - static Status parseMultiPolygon(const BSONObj &obj, MultiPolygonWithCRS *out); - static Status parseGeometryCollection(const BSONObj &obj, GeometryCollection *out); + // Legacy points can contain extra data as extra fields - these are valid to index + // e.g. { x: 1, y: 1, z: 1 } + static Status parseLegacyPoint(const BSONElement& elem, + PointWithCRS* out, + bool allowAddlFields = false); + // Parse the BSON object after $box, $center, etc. + static Status parseLegacyBox(const BSONObj& obj, BoxWithCRS* out); + static Status parseLegacyCenter(const BSONObj& obj, CapWithCRS* out); + static Status parseLegacyPolygon(const BSONObj& obj, PolygonWithCRS* out); + static Status parseCenterSphere(const BSONObj& obj, CapWithCRS* out); + static Status parseGeoJSONPolygon(const BSONObj& obj, PolygonWithCRS* out); + static Status parseGeoJSONPoint(const BSONObj& obj, PointWithCRS* out); + static Status parseGeoJSONLine(const BSONObj& obj, LineWithCRS* out); + static Status parseMultiPoint(const BSONObj& obj, MultiPointWithCRS* out); + static Status parseMultiLine(const BSONObj& obj, MultiLineWithCRS* out); + static Status parseMultiPolygon(const BSONObj& obj, MultiPolygonWithCRS* out); + static Status parseGeometryCollection(const BSONObj& obj, GeometryCollection* out); - // For geo near - static Status parseQueryPoint(const BSONElement &elem, PointWithCRS *out); - static Status parseStoredPoint(const BSONElement &elem, PointWithCRS *out); - static bool parsePointWithMaxDistance(const BSONObj& obj, PointWithCRS* out, double* maxOut); - }; + // For geo near + static Status parseQueryPoint(const BSONElement& elem, PointWithCRS* out); + static Status parseStoredPoint(const BSONElement& elem, PointWithCRS* out); + static bool parsePointWithMaxDistance(const BSONObj& obj, PointWithCRS* out, double* maxOut); +}; } // namespace mongo |