7

What is the projection of a Location object returned from the LocationClient by a class implementing the LocationListener interface with a fused provider in the Google Play Services SDK? For example, if I performed the following,

1)

Location mLocation = mLocationClient.getLastLocation();
double mLongitude  = mLocation.getLongitude();
double mLatitude   = mLocation.getLatitude();

2) converted those values to String objects,

3) performed I/O to a file/network/database,

4) converted or outputted them to a .csv file of the form,

Longitude,Latitude
-85.26418009999999,35.1050902

5) and then finally imported this file into QGIS, what projection would I choose?

Baskinomics
  • 898
  • 11
  • 22

3 Answers3

5

Android Location latitude and longitude are unprojected and use the WGS84 ellipsoid.

Here's the source code for the Location Java class: https://github.com/android/platform_frameworks_base/blob/master/location/java/android/location/Location.java

You can see there are multiple references to WGS84 in the code, especially surrounding the distance and bearing calculations.

Android Location docs also include references to WGS84.

So, in the import to QGIS, you would specify that these coordinates are in the WGS84 Geographic Coordinate System, and then you can project them to whatever projection you'd like.

Sean Barbeau
  • 1,603
  • 13
  • 20
2

Since the API does not specify the projection (coordinate reference system), there is no guarantee that it is in any particular projection / CRS.

That said, its a pretty safe bet that Google will use WGS-84 / World Mercator pretty consistently: http://spatialreference.org/ref/epsg/3395/ (or 3857 if you like). In QGIS, you should probably start with WGS-84 (EPSG:4326), and sanity check the results.

Note that you should be careful about the order of your coordinates during import. Latitude then longitude (as you've shown) is not universal, and the reverse (conceptually X then Y) is more usual.

BradHards
  • 12,881
  • 2
  • 37
  • 70
  • related aka 'epsg 900913' http://gis.stackexchange.com/questions/40538/what-is-the-difference-between-epsg900913-and-epsg3857 – Mapperz Oct 24 '13 at 01:16
  • 2
    @BradHards +1 on the order of coordinates. I've been so deep into my CS curriculum that I'd forgotten something so basic! – Baskinomics Oct 25 '13 at 23:01
1

The data that you get from Android's Location Class, is not projected. It is in a Geographic Coordinate System.

If you look into the Source Code, you'll find that the location is directly calculated from the GPS signals, and hence follows the coordinate system of the GPS system which is the geographic coordinate system based on the WGS84 datum, i.e. EPSG:4326.

Devdatta Tengshe
  • 41,311
  • 35
  • 139
  • 263