How does Google calculate my location on a desktop?
Asked Answered
L

9

115

Right this is confusing me quite a bit, i'm not sure if any of you have noticed or used the "my location" feature on google maps using your desktop (or none GPS/none mobile device). If you have a browser with google gears (easiest to use is Google Chrome) then you will have a blue circle above the zoom function in Google Maps, when clicked (without being logged into my Google Account) using standard Wi Fi to my own personal router and a normal internet connection to my ISP, it somehow manages to pinpoint my exact location with a 100% accuracy (at this moment in time).

How does it do it? they breifly mention it here but it doesn't quite explain it, it says that my browser knows where i am...

...i am baffled, how?

I am intrigued because I would love to integrate it in the future of my programming projects, just like some background understanding and it doesn't seem too well documented at the moment.

Laurinda answered 3/11, 2009 at 16:7 Comment(3)
"duplicate" of my superuser question superuser.com/questions/12495/how-does-google-my-location-workMalmo
They find the exact position of my house. It's quite remarkable.Combinative
@badbod99 - i'm sure they can find it in other ways too :P @Stefano - you still don't have an answer and i think this is programming related thus stackoverflow @ben - exactly!Laurinda
M
96

I am currently in Tokyo, and I used to be in Switzerland. Yet, my location until some days ago was not pinpinted exactly, except in the broad Tokyo area. Today I tried, and I appear to be in Switzerland. How?

Well the secret is that I am now connected through wireless, and my wireless router has been identified (thanks to association to other wifis around me at that time) in a very accurate area in Switzerland. Now, my wifi moved to Tokyo, but the queried system still thinks the wifi router is in Switzerland, because either it has no information about the additional wifis surrounding me right now, or it cannot sort out the conflicting info (namely, the specific info about my wifi router against my ip geolocation, which pinpoints me in the far east).

So, to answer your question, google, or someone for him, did "wardriving" around, mapping the wifi presence. Every time a query is performed to the system (probably in compliance with the W3C draft for the geolocation API) your computer sends the wifi identifiers it sees, and the system does two things:

  1. queries its database if geolocation exists for some of the wifis you passed, and returns the "wardrived" position if found, eventually with triangulation if intensities are present. The more wifi networks around, the higher is the accuracy of the positioning.
  2. adds additional networks you see that are currently not in the database to their database, so they can be reused later.

As you see, the system builds up by itself. The only thing you need is good seeding. After that, it extends in "50 meters chunks" (the range of a newly found wifi connection).

Of course, if you really want the system go banana, you can start exchanging wifi routers around the globe with fellow revolutionaries of the no-global-positioning movement.

Malmo answered 3/11, 2009 at 16:21 Comment(6)
You posted the edit to your post as i was writing my answer :)Laurinda
It seems to know where I am in the my house to great accuracy, although I have no wireless communication dongles/cards connected to my system.Chimp
It all seems good and well. But my desktop doesn't not have any form of wireless? However when I go to google maps. It knows exactly where I am. And if I go and try trace my IP or use the browsers locations its far off from where google maps says I am? How does that work?Michelinemichell
@Michelinemichell This is a really good question, "How does Google maps know my position from my desktop without any wireless network card installed?". By testing this on my own i see that it only knows my position, when i'm logged in with my Google account. When I use another browser which is not logged in with my Google account, my location would be in the nearest big city (IP geolocation). I believe that google uses my android smartphone to share my real location, with google maps on the desktop.Hyrcania
Excellent explanation!Hulky
That explains my confusion too, I am on VPN and google finds my location. I RDPed into a computer at third location and from google maps on that computer also it found my exact location (where I am sitting)Redound
B
14

It's a lot more simple that you think. You've signed into both your mobile and Chrome on your desktop using the same Google account. Google simply expect you will have your mobile with you most of the time. They take the location data from your phone and assume the location of your current desktop session is the same.

I proved this by RDPing into my Windows machine at home from work and checking Google maps remotely. It show my location as the same as Chrome on Linux at work.

If you don't have a mobile that is signed into Google then all they can do is lookup GeoIP data for the IP address assigned by your ISP. It will typically be wildly inaccurate.

Bitartrate answered 1/11, 2016 at 2:31 Comment(3)
Thanks for sharing your test with us. that was an hole new level of answer.Upgrowth
THAT IS TOTAL NONSENSE!! My phone GPS is turned off all the time. Not connected to wifi. How can they get my phone exact location? Cant. So your hypothesis is wrong. Connect to VPN and then go to google and see, you did not move but will show other location. I think ISPs leak data about client's address and their IP to Google. SO as always clients is being sold.Kabyle
Tommix I think you've been watching too much CSI. GeoIP data is not granular enough. It is accurate at country or state level precision at best. As an example the widely used MaxMind GeoIP2 City database correctly resolves 58% of IP addresses to the exact city (remember city, not street or street number) within the US. At a 50 km radius this improves to 87%.Bitartrate
B
10

They use a combination of IP geolocation, as well as comparing the results of a scan for nearby wireless networks with a database on their side (which is built by collecting GPS coordinates alongside wifi scan data when Android phone users use their GPS)

Boutin answered 3/11, 2009 at 16:9 Comment(3)
Ok lets assume they got my ip geolocation to London, i don't really understand the next part? How are they scanning what wireless is near me, how do they know where "near me" is? My WiFi router is mine and doesn't allow access to anyone else, so they can't know about it or use it.Laurinda
see my comment below: they run client code (in Chrome etc), so google don't access your router, but the client browser can access your wireless card and determine what wireless networks are nearby.Rakish
So how google knows what wifi SSID is where? I hav SSID "suckMyBalls" how do they know SuckMyBalls location? If based on other WIFI ssid's - how they got their location? Answer is easy - ISP sell client IP and location data to google.Kabyle
L
7

I've finally worked it out. The biggest issue is how they managed to work out what Wireless networks were around me and how do they know where these networks are.

It "seems" to be something similar to this:

  1. skyhookwireless.com [or similar] Company has mapped the location of many wireless access points, i assume by similar means that google streetview went around and picked up all the photos.
  2. Using Google gears and my browser, we can report which wireless networks i see and have around me
  3. Compare these wireless points to their geolocation and triangulate my position.

Reference: Slashdot

Laurinda answered 3/11, 2009 at 16:27 Comment(1)
No this theory is WRONG. Nobody is mapping nothing. ISP sell your ip and address to google.Kabyle
S
2

According to Google Maps' own help:
If your browser cannot show images, get a new one!

Sideling answered 9/4, 2017 at 1:52 Comment(0)
B
1

Rejecting the WiFi networks idea!

Sorry folks... I don't see it. Using WiFi networks around you seems to be a highly inaccurate and ineffective method of collecting data. WiFi networks these days simply don't stay long in one place.

Think about it, the WiFi networks change every day. Not to mention MiFi and Adhoc networks which are "designed" to be mobile and travel with the users. Equipment breaks, network settings change, people move... Relying on "WiFi Networks" in your area seems highly inaccurate and in the end may not even offer a significant improvement in granularity over IP lookup.

I think the idea that iPhone users are "scanning and sending" the WiFi survey data back to google, and the wardriving, perhaps in conjunction with the Google Maps "Street View" mapping might seem like a very possible method of collecting this data however, in practicality, it does not work as a business model.

Oh and btw, I forgot to mention in my prior post... when I originally pulled my location the time I was pinpointed "precisely" on the map I was connecting to a router from my desktop over an ethernet connection. I don't have a WiFi card on my desktop.

So if that "nearby WiFi networks" theory was true... then I shouldn't have been able to pinpoint my location with such precision.

I'll call my ISP, SKyrim, and ask them as to whether they share their network topology to enable geolocation on their networks.

Bangweulu answered 10/11, 2009 at 18:12 Comment(2)
coderrr.wordpress.com/2008/09/10/… you were connected by ethernet, but was it to a wireless router?Laurinda
Whether or not collecting location data works as a business model, Google does it - googleblog.blogspot.com/2009/08/…Jorge
R
0

I know you can look up IP address to get approximate location, but it's not always accurate. Perhaps they're using that?

update:

Typically, your browser uses information about the Wi-Fi access points around you to estimate your location. If no Wi-Fi access points are in range, or your computer doesn't have Wi-Fi, it may resort to using your computer's IP address to get an approximate location.

Rakish answered 3/11, 2009 at 16:9 Comment(5)
That's too easy, and not accurate enough. You can map it to the nearest exchange at the maximum, not to my exact point.Laurinda
yeah, sometimes it's not accurate at all. We show as in Glasgow even though we're hundreds of miles away in London.Rakish
Regarding the update - How does it know what WiFi access points are around me? :PLaurinda
The quote is from the link you provided. I'm assuming the browser (and it has to be a supported browser, so there's definitely client specific code for this to work), can get info from the OS on the Wifi access points your PC can see (even if it's not connected to them), and use a server to look up info on them to determine their locations. Then you can maybe triangulate to calculate the computer's location?Rakish
IP is assigned to ISP. so NOBODY can know exact IP and location. EXCEPT ISP. ISP sells your data private data to google and so on.Kabyle
H
0

It is possible get your approximate locate based on your IP address (wireless or fixed).

See for example hostip.info or maxmind which basically provide a mapping from IP address to geographical coordinates. The probably use many kinds of heuristics and datasources. This kind of system has probably enough accuracy to put you in right major city, in most cases.

Google probably uses somewhat similar approach in addition to WiFi tricks.

Halo answered 3/11, 2009 at 16:43 Comment(1)
IP location has been known for a while, and it's quite easy to work out to city level, it's the precision of location that this question was interested in...Laurinda
Z
0
  • So Google keep records of Wifi router location by using any cellphone GPS that connected to that router when you use Google maps or location on cellphone. then google knows every device that connected to that Wifi router uses the same location.
  • when GPS off or no cellphone connected to router Google uses IP geolocation
Zig answered 21/8, 2020 at 9:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.