Applications can use the Location API module to access basic geographical information obtained from satellite or other sources about the user, including latitude and longitude, bearing, speed and altitude. This allows you to develop a range of geographical applications, for example, maps.
The Location module provides a library for location positioning, landmark management, and mapping and navigation. You can emulate position and speed.
Note: You can also use the emulator to test applications that use landmark management, mapping, and navigation in the emulator, but there are no specific controls for emulating these features.
Global positioning system (GPS) connections can consume the battery power rapidly, so you should take this into account when designing applications that access this functionality.
Location-based services (LBS) use coordinates from the world geodetic system (WGS 84), which is also used as a reference system by the GPS. The coordinates are based on values for latitude, longitude, and altitude (elevation above sea level).
The North Pole is 90 degrees North (+90 degrees) and the South Pole is 90 degrees South (-90 degrees). The Equator is defined as 0 degrees; locations above it have positive latitudes (0 to +90 degrees); those below (0 to -90 degrees) negative ones.
There are two definitions of North Pole; Magnetic North Pole and True (Geographical) North Pole. Any application with a compass must check how the API defines North Pole.
The Magnetic North Pole is the point to which compasses point. The True North Pole defines latitude as +90 degrees.
Meridians are constant longitudinal (north-south) values. The Prime (Greenwich) Meridian's value is 0 degrees. WGS84, which LBS use, defines its zero meridian some 100 meters east of the Prime one. Locations east of the Prime Meridian have positive longitudinal values (0 to +180 degrees), those west (0 to -180 degrees) have negative ones.
Latitude lines are smaller near the poles. At the equator, one degree of longitude is roughly 111.3 km, whereas at 60 degrees of latitude one degree of longitude is only 55.8 km.
To test an application that uses LBS, specify the following values in the Location view:
- In the Latitude and Longitude fields, specify the reported position (in decimal degrees). To adjust the position, you can specify the accuracy of the provided latitude-longitude value (in meters) in the Horizontal Accuracy field.
- In the Altitude field, specify the elevation from sea level of the reported position (in meters). To adjust the altitude, you can specify the accuracy of the reported value (in meters) in the Vertical Accuracy field.
- in the Direction field, specify the bearing of the device (in degrees), relative to true north.
- In the Ground speed or Vertical speed field, specify the velocity of the device (in meters per second) that reported the position.
- In the Magnetic variation field, specify the angle between the horizontal component of the magnetic field and true north (in degrees). A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction.
- In the Timestamp field, specify the date and time at which the position was reported.
To test satellite-monitoring applications, you can emulate GPS or GLONASS satellites. Open advanced settings to change satellite properties in the Satellites view:
- In the Satellite identifier field, select a satellite. To use other than the pre-defined values, click Change identifier and specify the identifier of a satellite.
- In the Azimuth field, specify the direction of the satellite from the current position (in degrees), as an offset to true north.
- In the Elevation field, specify the angle (in degrees) to see the satellite from the current position.
- In the Signal strength field, specify the satellite signal strength in decibels.
- Select the In use check box to specify that the satellite is used to determine the current position.
- In the System field, select the system to emulate: GPS or GLONASS.
© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.