GeodesicDistanceMeters
Page properties, Measurement and Geospatial
Description
Returns the ground distance in metres between two WGS 84 latitude and longitude pairs
Syntax
Delphi
Function TPDFlib.GeodesicDistanceMeters(Latitude1, Longitude1, Latitude2, Longitude2: Double): Double;
DLL
int DLGeodesicDistanceMeters(int InstanceID, double Latitude1, double Longitude1, double Latitude2, double Longitude2, PDouble Distance);
The export is available in the Windows DLL, the macOS Dylib and the Linux shared library
ActiveX
Function PDFlib::GeodesicDistanceMeters(Latitude1 As Double, Longitude1 As Double, Latitude2 As Double, Longitude2 As Double) As Double
Available on IPDFlibrary21. Delphi clients using the generated type-library unit can obtain it with CoPDFlibrary.CreateEditionTools21
Automation returns the distance directly. Zero represents a coincident point or invalid coordinates
Parameters
| Latitude1, Latitude2 | Latitudes in degrees from −90 to 90 |
|---|---|
| Longitude1, Longitude2 | Longitudes in degrees from −180 to 180 |
| Distance | Receives the result in metres through the DLL function |
Return values
Pascal and ActiveX return a distance in metres, including zero for coincident points, and return zero for invalid input. The DLL function returns 1 for valid coordinates, including coincident points. Invalid coordinates return 0 and set a writable distance result to zero
Remarks
The normal path measures on the WGS 84 ellipsoid. If the inverse solution does not converge near antipodal points, the distance uses a mean-radius spherical approximation. No document is required
See also
PagePointToLatLon · LatLonToPagePoint · GeodesicPolygonAreaSqMeters · PageGeoViewportDistanceMeters