Geocoordinate Geocoordinate Geocoordinate Geocoordinate Class

Contains the information for identifying a geographic location.

Syntax

Declaration

public sealed class Geocoordinatepublic sealed class GeocoordinatePublic NotInheritable Class Geocoordinatepublic sealed class Geocoordinate

Remarks

Retrieve an instance of this class using the Coordinate property.

Values for the Latitude, Longitude, and Accuracy properties are always provided. Values for the Altitude, AltitudeAccuracy, Heading, and Speed properties are provided if available. If they are not available, they will be null in JavaScript code.

Properties summary

The accuracy of the location in meters.

Note

Altitude may be altered or unavailable after Windows 8.1 and Windows Phone 8.1. Instead, use Point.

The altitude of the location, in meters.

The accuracy of the altitude, in meters.

The current heading in degrees relative to true north.

Note

Latitude may be altered or unavailable after Windows 8.1 and Windows Phone 8.1. Instead, use Point.

The latitude in degrees.

Note

Longitude may be altered or unavailable after Windows 8.1 and Windows Phone 8.1. Instead, use Point.

The longitude in degrees.

The location of the Geocoordinate

Gets the source used to obtain a Geocoordinate.

Gets the time at which the associated Geocoordinate position was calculated.

Gets information about the satellites used to obtain a Geocoordinate.

The speed in meters per second.

The system time at which the location was determined.

Properties

  • Accuracy
    Accuracy
    Accuracy
    Accuracy

    The accuracy of the location in meters.

    public double Accuracy { get; }public double Accuracy { get; }Public ReadOnly Property Accuracy As doublepublic double Accuracy { get; }

    Property Value

    • double
      double
      double
      double

      The accuracy in meters.

    Remarks

    Location services accuracy depends on the location data available. For example, if Wi-Fi is available, data is accurate to within 50 meters. If Wi-Fi is not available, the data could be accurate to within 10 miles or larger.

    A GNSS device can provide data accurate to within a few meters. However, its accuracy can vary if the GNSS sensor is obscured by buildings, trees, or cloud cover. GNSS data may not be available at all within a building.

  • Altitude
    Altitude
    Altitude
    Altitude
    Note

    Altitude may be altered or unavailable after Windows 8.1 and Windows Phone 8.1. Instead, use Point.

    The altitude of the location, in meters.

    public IReference<double> Altitude { get; }public IReference<double> Altitude { get; }Public ReadOnly Property Altitude As IReference<double>public IReference<double> Altitude { get; }

    Property Value

    • The altitude in meters.

    Remarks

    This optional property will be set if it is available. If the property is not available, the value will be NULL or NaN (depending on the operating system version). We recommend that your app checks for both of these possibilities.

  • AltitudeAccuracy
    AltitudeAccuracy
    AltitudeAccuracy
    AltitudeAccuracy

    The accuracy of the altitude, in meters.

    public IReference<double> AltitudeAccuracy { get; }public IReference<double> AltitudeAccuracy { get; }Public ReadOnly Property AltitudeAccuracy As IReference<double>public IReference<double> AltitudeAccuracy { get; }

    Property Value

    • The accuracy of the altitude.

    Remarks

    This optional property will be set if it is available. If the property is not available, the value will be NULL.

  • Heading
    Heading
    Heading
    Heading

    The current heading in degrees relative to true north.

    public IReference<double> Heading { get; }public IReference<double> Heading { get; }Public ReadOnly Property Heading As IReference<double>public IReference<double> Heading { get; }

    Property Value

    • The current heading in degrees relative to true north.

    Remarks

    This optional property will be set if it is available. If the property is not available, the value will be NULL or NaN (depending on the operating system version). We recommend that your app checks for both of these possibilities.

  • Latitude
    Latitude
    Latitude
    Latitude
    Note

    Latitude may be altered or unavailable after Windows 8.1 and Windows Phone 8.1. Instead, use Point.

    The latitude in degrees.

    public double Latitude { get; }public double Latitude { get; }Public ReadOnly Property Latitude As doublepublic double Latitude { get; }

    Property Value

    • double
      double
      double
      double

      The latitude in degrees. The valid range of values is from -90.0 to 90.0.

  • Longitude
    Longitude
    Longitude
    Longitude
    Note

    Longitude may be altered or unavailable after Windows 8.1 and Windows Phone 8.1. Instead, use Point.

    The longitude in degrees.

    public double Longitude { get; }public double Longitude { get; }Public ReadOnly Property Longitude As doublepublic double Longitude { get; }

    Property Value

    • double
      double
      double
      double

      The longitude in degrees. The valid range of values is from -180.0 to 180.0.

  • Point
    Point
    Point
    Point

    The location of the Geocoordinate

    public Geopoint Point { get; }public Geopoint Point { get; }Public ReadOnly Property Point As Geopointpublic Geopoint Point { get; }

    Property Value

  • PositionSource
    PositionSource
    PositionSource
    PositionSource

    Gets the source used to obtain a Geocoordinate.

    public PositionSource PositionSource { get; }public PositionSource PositionSource { get; }Public ReadOnly Property PositionSource As PositionSourcepublic PositionSource PositionSource { get; }

    Property Value

  • PositionSourceTimestamp
    PositionSourceTimestamp
    PositionSourceTimestamp
    PositionSourceTimestamp

    Gets the time at which the associated Geocoordinate position was calculated.

    public IReference<DateTime> PositionSourceTimestamp { get; }public IReference<DateTime> PositionSourceTimestamp { get; }Public ReadOnly Property PositionSourceTimestamp As IReference<DateTime>public IReference<DateTime> PositionSourceTimestamp { get; }

    Property Value

    • The time at which the associated Geocoordinate position was calculated.

    Remarks

    When this property is not available, the value will be NULL.

    The timestamp returned by this property depends on how the location was obtained and may be completely unrelated to the system time on the device. For example, if the position is obtained from the Global Navigation Satellite System (GNSS) the timestamp would be obtained from the satellites. If the position was is obtained from Secure User Plane Location (SUPL), the timestamp would be obtained from SUPL servers. This means that the timestamps obtained from these services will be precise and, most importantly, consistent across all devices regardless of whether the system time on the devices is set correctly.

  • SatelliteData
    SatelliteData
    SatelliteData
    SatelliteData

    Gets information about the satellites used to obtain a Geocoordinate.

    public GeocoordinateSatelliteData SatelliteData { get; }public GeocoordinateSatelliteData SatelliteData { get; }Public ReadOnly Property SatelliteData As GeocoordinateSatelliteDatapublic GeocoordinateSatelliteData SatelliteData { get; }

    Property Value

  • Speed
    Speed
    Speed
    Speed

    The speed in meters per second.

    public IReference<double> Speed { get; }public IReference<double> Speed { get; }Public ReadOnly Property Speed As IReference<double>public IReference<double> Speed { get; }

    Property Value

    • The speed in meters per second.

    Remarks

    This optional property will be set if it is available. If the property is not available, the value will be NULL or NaN (depending on the operating system version). We recommend that your app checks for both of these possibilities.

  • Timestamp
    Timestamp
    Timestamp
    Timestamp

    The system time at which the location was determined.

    public DateTime Timestamp { get; }public DateTimeOffset Timestamp { get; }Public ReadOnly Property Timestamp As DateTimeOffsetpublic DateTime Timestamp { get; }

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Capabilities

ID_CAP_LOCATION [Windows Phone]
location

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Devices.Geolocation.dll