Class GeoSpatialStageBuilder
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime.dll
public static class GeoSpatialStageBuilder
Inheritance
object ← GeoSpatialStageBuilder
Inherited Members
object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()
Extension Methods
ObjectExtension.ConvertToBsonValue(object)
Methods
BuildGeoNearStage(string, GeoJsonObject, double?, double?, bool)
Generates a BsonDocument MongoDB aggregation pipeline stage for performing geospatial queries.
public static BsonDocument BuildGeoNearStage(string field, GeoJsonObject value, double? maxDistance = 0, double? minDistance = 0, bool spherical = false)
Parameters
field string
This parameter specifies the name of the field in your documents that contains location data or coordinates.
value GeoJsonObject
A GeoJsonObject geometry for use with the following geospatial query operators.
maxDistance double?
This parameter specifies the maximum distance within which to find documents.
minDistance double?
This parameter specifies the minimum distance from the target location.
spherical bool
The parameter indicating whether to use spherical calculations for distances.
Returns
BsonDocument
A BsonDocument.
BuildNearStage(string, double, double, double?, double?, bool)
Generates a BsonDocument MongoDB aggregation pipeline stage for performing geospatial queries.
public static BsonDocument BuildNearStage(string field, double x, double y, double? maxDistance = 0, double? minDistance = 0, bool spherical = false)
Parameters
field string
This parameter specifies the name of the field in your documents that contains location data or coordinates.
x double
The parameter represent the longitude.
y double
The parameter represent the latitude.
maxDistance double?
This parameter specifies the maximum distance within which to find documents.
minDistance double?
This parameter specifies the minimum distance from the target location.
spherical bool
The parameter indicating whether to use spherical calculations for distances.
Returns
BsonDocument
A BsonDocument