Location data involves a precisely specified position on the Earth's surface — as provided by a latitude-longitude coordinate — along with associated data, such as:
更多信息见 Geographic Coordinate .
This data can be extracted through a variety of methods. One of the most well known methods of positioning is GPS (Global Positioning System), a publicly available system that uses radiowave signals received from Earth-orbiting satellites to calculate the precise position and time of the receiver. Another popular method is 'Cell Identifier Positioning', which uses the cell identifier of the cell site that is currently serving the receiving device to calculate its approximate location. These and other positioning methods can all be used with the Location API; the only requirement for a location data source within the API is that it provides a latitude-longitude coordinate with a date/time value, with the option of providing the other attributes listed above.
The
coordinate
is a basic unit of geographical information. The
coordinate
type has attributes to hold the
latitude
,
longitude
and
altitude
。
定位
contains this
coordinate
in addition to a physical address and a bounding box.
另请参阅
:
retrieving a location
除了 coordinate type, which holds the three-dimensional position of an object, Position 提供 speed 和 timestamp to compute future positions. Position validates sensible values for these properties, which are exposed as the following properties:
We have a Position 类型, coordinate type but where does the data come from? Also it is a good idea to be able to indicate alternative sources. Perhaps instead of directly picking up GPS satellites it might be desirable to do some testing using a datafile.
The PositionSource type provides the developer with control, within the limits allowed by the platform, of the source of the geographical data. PositionSource supports multiple plugins, including an NMEA 插件。
NMEA is a common text-based protocol for specifying navigational data. The PositionSource NMEA plugin supports multiple data sources, including raw file or TCP socket. The source will emit updates according to the time stamp of each NMEA sentence to produce a "replay" of the recorded data.
见 plugin description for usage examples.
The 卫星信息 example uses the PositionSource and SatelliteSource QML types to get the satellite information relevant to the current location.