CoordinateThe Coordinate element represents and stores a geographic position. More... Inherits QtObject This type was introduced in Qt Location 5.0. Properties
Methods
Detailed DescriptionCoordinate elements represent a geographic location in the form of numbers: in particular, latitude, longitude and altitude. These, together, specify a 3-dimensional position anywhere on or near the Earth's surface. Coordinates are used by many other elements in the Qt Location module, for specifying the position of an object on a Map, the current position of a device and many other tasks. They also feature a number of important utility methods that make otherwise complex calculations simple to use, such as atDistanceAndAzimuth. AccuracyThe latitude, longitude and altitude numbers stored in a Coordinate are represented as doubles, giving them approximately 16 decimal digits of precision -- enough to specify micrometers. The calculations performed in Coordinate's methods such as azimuthTo and distanceTo also use doubles for all intermediate values, but the inherent inaccuracies in their spherical Earth model dominate the amount of error in their output. Example UsageThe following snippet defines two coordinates near Brisbane, Australia. Coordinate { id: coord1 latitude: -27.2 longitude: 153.1 altitude: 1.0 } Coordinate { id: coord2 latitude: -27.5 longitude: 153.2 altitude: 5.0 } As an example, the value of coord1.distanceTo(coord2) would now be approximately 34790 (34.8 km). NOTE: if another element has a Coordinate property, a change notification signal for that property will only be emitted if that property is assigned a new Coordinate, and not if the position data of the existing Coordinate assigned to the property changes. The only exception to this rule is that the Position element does emit change signals if its coordinate property's values change. Property DocumentationThis property holds the value of altitude (meters above sea level). If the property has not been set, its default value is zero. For details on how to use this property to interface between C++ and QML see "Interfaces between C++ and QML Code". This property holds the current validity of the coordinate. Coordinates are considered valid if they have been set with a valid latitude and longitude (altitude is not required). The latitude must be between -90 to 90 inclusive to be considered valid, and the longitude must be between -180 to 180 inclusive to be considered valid. This property holds latitude value of the geographical position (decimal degrees). A positive latitude indicates the Northern Hemisphere, and a negative latitude indicates the Southern Hemisphere. If the property has not been set, its default value is zero. This property holds the longitude value of the geographical position (decimal degrees). A positive longitude indicates the Eastern Hemisphere, and a negative longitude indicates the Western Hemisphere If the property has not been set, its default value is zero. Method DocumentationReturns the coordinate that is reached by traveling distance metres from the current coordinate at azimuth degrees along a great-circle. There is an assumption that the Earth is spherical for the purpose of this calculation. Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other. Altitude is not used in the calculation. There is an assumption that the Earth is spherical for the purpose of this calculation. Returns the distance (in meters) from this coordinate to the coordinate specified by other. Altitude is not used in the calculation. This calculation returns the great-circle distance between the two coordinates, with an assumption that the Earth is spherical for the purpose of this calculation. |