Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GeoUtils.CalculateDistance(GeoPoint, GeoPoint, Boolean) Method

Determines the distance between two geographical points in meters. Allows you to specify whether to use the ellipsoidal-surface formula for the calculation of distance.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v24.2.dll

NuGet Package: DevExpress.Wpf.Map

#Declaration

public static double CalculateDistance(
    GeoPoint p1,
    GeoPoint p2,
    bool ignoreEllipsoidalEffects
)

#Parameters

Name Type Description
p1 GeoPoint

The first geographical point.

p2 GeoPoint

The second geographical point.

ignoreEllipsoidalEffects Boolean

true if ellipsoidal effects are ignored; otherwise, false.

#Returns

Type Description
Double

The distance in meters.

#Remarks

The following code computes the distance between two points:

using DevExpress.Xpf.Map;

private void OnButtonClick(object sender, RoutedEventArgs e) {
    double distance = GeoUtils.CalculateDistance(new GeoPoint(-5.93107, -35.112723), new GeoPoint(4.253438, 5.47072), true);
}
See Also