ILatLongReport::GetAltitude method
Retrieves the altitude, in meters. Altitude is relative to the reference ellipsoid.
Syntax
HRESULT GetAltitude( [out] DOUBLE *pAltitude );
Parameters
- pAltitude [out]
-
Address of a DOUBLE that receives the altitude, in meters. May be NULL.
Return value
Possible values include, but are not limited to, those in the following table.
| Return value | Description |
|---|---|
|
The method returned successfully. |
|
The location report does not include data for the requested field. This result is returned when the location sensor does not support altitude. |
Remarks
The GetAltitude method retrieves the altitude relative to the reference ellipsoid that is defined by the latest revision of the World Geodetic System (WGS 84), rather than the altitude relative to sea level.
Examples
The following code example demonstrates how to call GetAltitude. Altitude is an optional field in latitude/longitude reports, so GetAltitude may not always return data.
DOUBLE altitude = 0; // Print the Altitude if (SUCCEEDED(spLatLongReport->GetAltitude(&altitude))) { wprintf(L"Altitude: %f\n", altitude); } else { // Altitude is optional and may not be available wprintf(L"Altitude: Not available.\n"); }
Requirements
|
Minimum supported client | Windows 7 [desktop apps only] |
|---|---|
|
Minimum supported server | None supported [desktop apps only] |
|
Client | Windows 7 |
|
Header |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 10/27/2012