2

I am not sure if this is the correct forum for gathering this information, please do let me know I will move it to the android forum in case this is not the correct place.

I would like to understand how cell id and lac is translated into lat and long when only the network provider is being used.

Theory 1: I have looked around a little and I do know that sometimes the secret API is used-- "http://www.google.com/glm/mmap" is a non-public API to convert cellLocation to latitude and longitude.

Theory 2: But there also theories that cell trilateration is also performed in order to determine the lat and long. Of course since we are using NETWORK_PROVIDER there would be an error of about 100-500m meters.

I am wondering which of these 2 theories are being used? and how is cell-id and lac translated into lat long

jcm
  • 2,568
  • 14
  • 18
bhavs
  • 2,091
  • 8
  • 36
  • 66

3 Answers3

3

I'd lean to Theory 1. Google has compiled over time a full database of cell towers and Wifi access points. They expose them though their maps API, and that is probably the same thing they use in Android to give you your location: https://developers.google.com/maps/documentation/business/geolocation/#cell_tower_object

Alejandro Mezcua
  • 1,211
  • 1
  • 9
  • 13
3

I have worked in mobile operator some time ago. Mobile operators (in Russia) doesn't provide information about their cells coordinates. When you using your phone with GPS, your phone collect information about nearest cell and send it to google. With these data google calculate coordinates of every cell and store them. When you using NETWORK_PROVIDER google get information about all nearest cells (get cell-id, lac and signal strength). With these data they calculate your coords.

And I think both of theories are true. They use some private api to retrieve coords of nearest cells and use trilateration (or some other algorythms like that) to calculate your coords.

Alexander Mikhaylov
  • 1,790
  • 1
  • 13
  • 23
0

Well, actually, both are valid responses, I mean, Android provides 3 types of location providers:

GPS_PROVIDER: This provider determines location using satellites. Depending on
              conditions, this provider may take a while to return a location fix.
NETWORK_PROVIDER: This provider determines location based on availability of cell
                  tower and WiFi access points. Results are retrieved by means of 
                  a network lookup.
PASSIVE_PROVIDER: This provider can be used to passively receive location updates 
                  when other applications or services request them without 
                  actually requesting the locations yourself. This provider will 
                  return locations generated by other providers.

When you chose Network Location Provider, you're both accessing and providing information to Google's location service and, in order to provide best possible location, this mechanism uses, not only Cell signal strength, but also WiFi information to triangulate the position. I would recommend this post to getting started to Android Location: Getting Started With Android Location

Actually, this is also the "magic" behind Assisted GPS (AGPS): slowest part of retrieving information in GPS device is looking for satellites, as you've to look for all available ones (30) because you actually don't know your initial location. With AGPS, a rough location estimation is available thanks to Network Based Location, then, you can limit significantly your satellite list (to only satellites available in your estimated position), speeding up the process a lot.

Some interesting articles regarding this: Android Location Providers, Mobile Phone Tracking, Android Location Manager class and Android Location Strategies

jcm
  • 2,568
  • 14
  • 18