-3

I just found out that my GPS is returning shorter length latitude and longitude coordinates.

It's returning latitude: 00.0000000 (9 chars)
Instead of: 00.00000000000000 (16 chars),

Due to the length, when I use my Geocoder it returns different names of places. How can I receive full-length coordinates?

Here is the code:

val listenerMain = object : LocationListener {
  override fun onLocationChanged(location: Location) {
      locationManager.removeUpdates(this)
      lastLatitude = location.latitude
      lastLongitude = location.longitude
  }

  override fun onStatusChanged(s: String, i: Int, bundle: Bundle) { }
  override fun onProviderEnabled(s: String) { }
  override fun onProviderDisabled(s: String) { }
}

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0f, listenerMain)
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0f, listenerMain)

lastLatitude and lastLongitude are 9-chars.

TheFrack
  • 2,823
  • 7
  • 28
  • 47
SET1
  • 29
  • 4
  • Perhaps add the code you're using? – pgSystemTester Jun 29 '18 at 16:34
  • @PGCodeRider It's a simple GPS and NETWORK listeners. When `onLocationChanged` is called, I'm getting the latitude and longitue: `location.getLatitude` and `location.getLongitude`. – SET1 Jun 29 '18 at 16:39
  • @SET1, without code, it is very unlikely that the question fits here. Please provide the relevant code – Derek Pollard Jun 29 '18 at 16:57
  • @Derek Code added. – SET1 Jun 29 '18 at 17:25
  • 1
    Those extra decimal points are totally useless - even at the Equator where a degree of latitude is 111 miles, 0.0000001 degrees is only 0.7 inches, which I'd bet is smaller than the precision of your GPS hardware. – tar Jun 29 '18 at 18:06

1 Answers1

0

It's very common for GPS to return 6-7 digits after the dot. The average GPS EPE (estimated positional error) is in the range of meters for the most parts of the world, and the 6th digit of GPS coordinate is equal to 1e-6 * 111km is about 10cm, which is way above the precision of the GPS itself.

Using 7th digit, which is in single centimeter range, seems to be an overkill, and you're striving for 14th digit?? One millionth part of the centimeter??

lenik
  • 23,228
  • 4
  • 34
  • 43