Share via


Geometry.Distance(Geometry) Method

Definition

Distance in meters between two geometries in the Azure Cosmos DB service.

public double Distance (Microsoft.Azure.Cosmos.Spatial.Geometry to);
member this.Distance : Microsoft.Azure.Cosmos.Spatial.Geometry -> double
Public Function Distance (to As Geometry) As Double

Parameters

to
Geometry

Second Geometry.

Returns

Returns distance in meters between two geometries.

Examples

var distanceQuery = documents.Where(document => document.Location.Distance(new Point(20.1, 20)) < 20000);

Remarks

Today this function support only geometries of Point type.

Applies to