Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How, exactly does HTML5's GeoLocation work?

I know the browser shares my IP address and details of nearby wireless networks to determine my location, but what sort of info does it know about nearby wifi networks?

For example, where I live are no public wireless networks, and from my home I can see about 5 private networks, yet my location is determined within 20 meters. With there being no open networks nearby, how does Google determine my location? The only way I can think of is that Google mapped the locations of all wireless networks when they mapped streets for Street View.

I've searched about online, but all I can't find any specific details.

like image 983
Dan Avatar asked Jun 14 '10 21:06

Dan


People also ask

How does HTML5 geolocation work explain with the help of code snippet?

HTML5 Geolocation. The Geolocation is one of the best HTML5 API which is used to identify the user's geographic location for the web application. Most of the geolocation services use Network routing addresses such as IP addresses, RFID, WIFI and MAC addresses or internal GPS devices to identify the user's location.

How accurate is navigator geolocation?

Geolocation sources Mobile devices tend to use triangulation techniques such as GPS (accurate to 10m and only works outside), WiFi and GSM / CDMA cell IDs (accurate to 1000m).

How accurate is HTML Geolocation API?

There is no guarantee the geolocation information will be accurate, because this API can also use the IP address to infer user location in the absence of more accurate technologies, such as GPS receivers on the client's device. The browser exposes this API via the navigator.

How is geolocation implemented in HTML5?

If supported, run the getCurrentPosition() method. If not, display a message to the user. If the getCurrentPosition() method is successful, it returns a coordinates object to the function specified in the parameter (showPosition) The showPosition() function outputs the Latitude and Longitude.


2 Answers

The data sent by Firefox to Google is for all visible access points, public or private. For each access point detected, it sends the following data to https://www.google.com/loc/json:

  "mac_address": "01-23-45-67-89-ab",   "signal_strength": 8,   "age": 0,   "SSID": "MyAccessPoint" 

where

  • mac_address is the mac address of the WiFi node.
  • signal_strength is current signal strength measured in dBm.
  • age is the number of milliseconds since the WiFi node was detected.
  • SSID is the name or ESSID of the WiFi node.

The georeferenced WiFi data used to geocode your request was collected when Google was driving around taking pictures for StreetView.

It is important to note that, however, that this is how the HTML5 geolocation API is implmeneted on Firefox using Google's Geolocation Services. This is an implementation, not a specification. If your device has a built-in GPS, it is probably desirable that your HTML5 implementation queries the GPS directly, rather than using a geolocation service.

Even firefox implements this feature differently on Windows and Linux. Using a current Firefox on Windows, details of all visible WiFi nodes are sent to Google. Using a current Firefox on Linux, only details of the currently connected WiFi node is sent, due to the reliance on libiw for access point data.

As another answerer noted, Safari uses Skyhook Wireless's service which does much the same thing as Google's Location Services.

like image 178
fmark Avatar answered Sep 22 '22 06:09

fmark


Data is gathered by Skyhook Wireless (Wikipedia), and they make no distinction between public and private wifi points - they log the locations of all of them. I wouldn't be surprised if the Google Street View vans also logged location data for access points.

like image 24
ceejayoz Avatar answered Sep 24 '22 06:09

ceejayoz