7 ms·
Ask HN: how is browser geolocation so precise?
I'm in the middle of nowhere, connecting through cable, google maps doesn't even have the street view anywhere within 40 miles, my laptop doesn't have a GPS. Yet my browser geolocates me exactly. And I mean EXACTLY, it points to the house I'm in.
I just asked my wife, who is traveling abroad, to try it, and it also pinpointed her within 50 feet.
Try it yourself - go to google maps, click on the dot above the orange man icon.
I have no idea how it works so well.
I tried IP to location services, and none of them are even close. Most of them are 40-70 miles off.
- LogEx 15y agoRegardless of where you are, as long as you have wi-fi on and there's a wi-fi router nearby, even in the absence of street view cars or anything like that, all it takes is one person using a GPS-enabled device near you to geo-compromise your router (and in some cases, your wi-fi client devices). Apple, Google, and others use different databases, but if you are on a Mac, then any one person using GPS on iOS near your wi-fi access point has forever pinpointed it in Apple's databases, and when you use Mac OS X Location Services, it draws on Apple's MAC address-to-geolocation database. Similar for Android devices and Google. Or Microsoft devices and Windows.
- LogEx 15y agoTry this: turn off wi-fi on your computer and try again. This is why I only use wi-fi when necessary, and also generally keep Location Services turned off on every device I own, unless I specifically need location.
- arkitaip 15y ago""So how does it work? When you activate the My Location feature, Google Maps asks your web browser for your location. 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. As you'd expect, the accuracy of My Location varies with your location, and in some cases, Google Maps may not be able to provide a location at all."" http://google-latlong.blogspot.com/2009/07/blue-circle-comes-to-your-desktop.html http://google-latlong.blogspot.com/2009/07/blue-circle-comes...
- rorrr 15y agoThat doesn't really answer anything. In my case, there's no wifi, I'm on cable. So it must use my IP. Yet all other IP->location services I've tried are not even close. I'm asking because I'm writing some code that would benefit greatly from such precise geolocation. Unfortunately that browser thing (navigator.geolocation.getCurrentPosition) only works after your user explicitly allows to share his location, which is annoying at best.
- Samuel_Michon 15y ago"In my case, there's no wifi, I'm on cable." But is your computer's WiFi receiver turned off? If not, that's how Google knows where you are. They have an enormous database of MAC addresses of WiFi access points and their geographic location. Many of those were gathered while taking StreetView pictures, others are provided by companies like Skyhook Wireless. I have a wired connection (fiber optic) so I usually leave WiFi turned off. After reading your question, I tried the geolocator in Google Maps. It couldn't find me at all. Once I turned on WiFi, it knew exactly where I am. After I turned WiFi off again, Google still knew my location, but only in the web browser that I used before.
- rorrr 15y agoYes, I do have a router, but I doubt google has visited us, we only recently moved here. There's no street view anywhere near here, as I said.
- Samuel_Michon 15y agoOK, if Google didn't drive by, then another company could've -- or perhaps someone used an Android device near your house. For instance, check this map to see whether Skyhook Wireless has wardriven by your house: http://www.skyhookwireless.com/howitworks/coverage.php http://www.skyhookwireless.com/howitworks/coverage.php And again, they don't need your router. You just need to have a WiFi receiver in your computer, turn it on, and your computer will scan for nearby networks. The MAC addresses of your neighbors' networks are checked against those in Google's database. If Google finds three or more, it knows exactly where you are.
- joezydeco 15y agoHow do you know Google isn't using other cross-referenced data to find you? Do you use other Google services that might have your address? What does Mapquest or Bing show as your location?
- rorrr 15y agoBecause I tried it without google, just using this: navigator.geolocation.getCurrentPosition(callback) Gives you the same precise coordinates, in all browsers I've tried.
- dfc 15y agoClear your cache and run tshark when you send the request. See what data it sends. I do not understand how it could nail your house with just your IP. Do you have a cellular connection built into your laptop? What ISP? Maybe your ISP shares data with google?
- byoung2 15y agoI do not understand how it could nail your house with just your IP If you've submitted contact information (mailing address, billing address) on a site that partners with MaxMind, then you may have provided them your exact address and IP. I'm sure Google must use this as one of their geolocation sources. http://www.maxmind.com/app/ip-location-explained http://www.maxmind.com/app/ip-location-explained
- rorrr 15y agoNope, maxmind detects my location incorrectly (25 miles off).
- byoung2 15y agoKeep in mind that this would be one of many data points Google pieces together to get the most accurate location. MaxMind is 1000 feet off for me (likely because the data was incomplete because of privacy scrubbing), but spot on with Google Maps (down to my location within my condo complex). Some other data points that would give Google this information are Google Maps on my Android phone. With explicit permission to read and report my coarse (network-based) and fine (GPS) location, it would be able to read any WiFi access point in range of my phone and link that with my exact GPS location and report that to Google. I leave this enabled at all times for Google Latitude. I would imagine that anyone with a smartphone and Google Maps who came near enough to your house could have reported your access point and GPS location to Google. Even if you don't have WiFi, if the neighbors on both sides of you do, they could extrapolate that to your house in the middle.
- byoung2 15y agoThe html5 geolocation API allows your browser to share your location using the most accurate source available. On a smartphone, this is the GPS antenna (when it's on), cell tower triangulation, or WiFi geolocation. The WiFi location works because you can register your location on sites such as Skyhook, and Google collects this data when they drive the street view cars around. On a desktop or laptop, this is usually WiFi or IP address (keep in mind you don't have to actually join the network, just be in range of one, so it could be a neighbor's). With IP addresses, you can very accurately determine the country, and a general region, since IP blocks are usually assigned to ISP's, so if you are a cable customer, you can be traced to the nearest hop from your house, which will be about a 50-100 mile radius in most of the US. For a more accurate position, here's where the privacy concerns come in. There are companies like MaxMind that gather data on individual IP addresses. In their words: MaxMind partners with various websites where users are asked to enter some form of geographical location information. The IP address and location data are forwarded to MaxMind after all personally identifiable information have been scrubbed to protect privacy concerns. MaxMind then runs millions of these IP location pairs through a series of algorithms and programs that identify, extract, and extrapolate relevant associations between IP address and geographical information. Source: http://www.maxmind.com/app/ip-location-explained http://www.maxmind.com/app/ip-location-explained So think about that the next time you fill out a form online. When you put in your billing address, they are collecting your physical location and tying it to your IP address. Even if they aren't getting full address to IP lists, they could at least calculate that certain ranges apply to certain streets.
- Geee 15y agoHave you used a GPS device in that house with that IP address? That's one possibility how they might have acquired the location. Same thing if someone accessed your Wi-Fi using a GPS device.
- rorrr 15y agoHmmm, yes, my wife used her iPhone. But who is "they"? Who has my precise coordinates?
- DenisM 15y agoWell, there's your answer. iPhone sends GPS coordinates, wifi mac address, cell tower ids, and IP address to the mothership. Your browser can then send the same IP, and MAC, to get back the GPS location.
- jonah 15y agoBecause she used Google Maps over her home wifi with the GPS turned on?
- Samuel_Michon 15y ago"iPhone sends GPS coordinates, wifi mac address, cell tower ids, and IP address to the mothership." Apple does collect this kind of data, but they don't sell it (and especially not to Google). The Maps app on the iPhone doesn't send this data to Google either. Apple built the Maps app themselves, they only use Google's map data. It's in Apple's interest to keep the data they've collected to themselves, they're using it to build an alternative to Google Maps.
- byoung2 15y agoIt could have been anyone who came within range of the wireless router with a smartphone. That could be a postal carrier, electric or gas company meter reader, UPS/FedEx delivery person, you name it.
- rorrr 15y agoWhat's the "mothership"? I tried Chrome, FF, Opera and Safari - all of them showed my exact location.
- brg 15y agoI would wager you are pinpointed because you are using wireless, and the Google streetView car recorded the name of your access point. They need not have made streetview of your area online, but it is likely if you are in the US or Canada that they did drive by. There are also other companies collecting this data, so it may not be just Google's. Browser geolocation uses the id and signal strength of wireless access points. But as mentioned in this thread already, that is only one of many signals including your device's gps and rev-ip data.
- notatoad 15y agoyou must have something running on your computer giving your location. my browser can only find me to within about 150km. theoretically, they should have me on skyhook or whatever because i've had the same wifi running for a couple years and streetview has been down my street.
- swah 15y agoI'm in Brazil and the same thing amazed me yesterday, through a service that was posted on HN that would let you see folks near you.
- wlievens 15y agoFor me it's off by more than 1 kilometre.
- deleted 15y ago[deleted]
- systemtrigger 15y agoIt's because you're running OS X 10.6+ and your browser supports the HTML5 GeoLocation API. Snow Leopard introduced the CoreLocation API which periodically sends Apple the network addresses and strengths of all the WiFi routers near your mac, which returns your triangulated position.