Is W3C Geolocation API more accurate the IP geolocation for non-mobile devices? - geolocation

Is W3C Geolocation API more accurate the IP geolocation for non-mobile devices? I am using https://ipstack.com/ and I am seeing big discrepancies between actual location and location identified by the service for desktop users, but after reading
https://en.wikipedia.org/wiki/W3C_Geolocation_API
GPS (Global Positioning System) This happens for any device which has GPS capabilities. A smartphone with GPS capabilities and set
to high accuracy mode will be likely to obtain the location data from
this. GPS calculate location information from the satellite signal. It
has the highest accuracy; in most Android smartphones, the accuracy
can be up to 10 metres.
Mobile Network Location Mobile phone tracking is used if a cellphone or wireless modem is used without a GPS chip built in.
Wi-Fi Positioning System If Wi-Fi is used indoors, a Wi-Fi positioning system is the likeliest source. Some Wi-Fi spots have
location services capabilities.
IP Address Location Location is detected based on nearest Public IP Address on a device (which can be a computer, the router it is
connected to, or the ISP the router uses). The location depends on the
IP information available, but in many cases where the IP is hidden
behind Internet Service Provider NAT, the accuracy is only to the
level of a city, region or even country.
It doesn't seem the W3C Geolocation API is any better for desktop users. It seems to be more precise for mobile users, but not desktop users. Is this correct?

It doesn't seem the W3C Geolocation API is any better for desktop users. It seems to be more precise for mobile users, but not desktop users. Is this correct?
This is correct, the W3C geolocation API is a good bet when
The user is using a browser (the UX for informed consent is well thought through by the browser maker, e.g Apple's Safari or the Firefox teams)
The user is on mobile (GPS hardware, WiFi triangulation, Google or Apple's-proprietary services such as Google Play Location Services being available) with the underlying OS
Fine location matters for your application (e.g ride-hailing or food delivery to your current location)
If the above criteria are generally not applicable most of the time to your application, then IP geolocation API services such as Fastah are a good choice for the country, approximate city, and geo-coordinates information.

In general, W3C Geolocation API is more accurate than IP geolocation such as IP2Location because it uses multiple parameters to determine location.
If GPS is not available in non-mobile device, they can use the WIFI MAC address or cell tower ID to determine location.

Related

Google Geolocation Api to track users Location - COuntry, City, State, Timezone

Does google offer geo location ip services like freegeoip, maxmind etc which can offer me the users exact ( need almost accurate like how gooogle offers) location, Country - State - City, Timezone,
Brower used
Mobile or PC
Google offers it as service of HTML5 in web browsers. You will need to have users permission to retrieve their geolocation information. The web browser will prompt for permission.
If you need the best accuracy for mobile users you should use the navigator geolocation API (see https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) and enable high accuracy to get the exact GPS position.
A good practice if your app can benefit from a less accurate location instead of no location at all is to fall back to an external IP geolocation API when the user denies location access : https://db-ip.com/api/jsdoc.php#browsergeo

Getting User's Location Without Permission

This website finds my location with a reasonable presicion. If i use mobilephone the website finds my exact location. If it is possible without asking permission why most of them asks me before getting my location? Isn't it makes personal security vulnerabilities?
From the same page you gave us:
Webkay uses the Google Geolocation API to locate you. This is an
educated guess and never as accurate as a GPS Location. The accuracy
depends on your location and also on your connection type. If you are
on a mobile network expect an error of up to 50km. This example just
tries to demonstrate how accurate a website can guess your location
without asking you for permission to access your GPS.
A site only needs permission, if it wants to enable your device's GPS. Also, without the permission, the guessed location is heavily dependent on your mobile carrier signal and IP address. If you are in a location with a lot of mobile towers, the location (obviously) will get more precise.
A site can use the information from all near mobile towers around you to triangulate the position and guess where you are. Think of it like a mesh.
For example: I am using a computer to write this now and the location is easy ~100km off, because it has only my IP adress to estimate the location.

How do I accurately target my user's current geolocation on desktop browsers?

The Geolocation API with its getCurrentPosition method works only using WIFI router information and IP addresses. In India where I am, there seems be NO correspondence between IP address and location.
Sometimes it shows I am in Pune - sometimes in Hyderabad - but I am in Mumbai. But When I use the same gMaps application with my mobile devices, it manages to accurately triangulate my position, which is fantastic.
But with the car pooling application I am building I need users to register and inputs their current location automatically using their laptops and desktop computers. How do I do this?
FYI: I am using chrome on Mac OSx
There are essentially four levels of accuracy for geolocation:
GPS, for devices with a GPS receiver
GSM, for mobile devices connected to the mobile phone network
WiFi, for devices within hearing distance of WiFi networks - NB the accuracy is only good if the area has been surveyed, either by the Google streetview vehicles, or by consumers crowdsourcing the information from devices with a real GPS receiver.
IP address - ISPs get allocated a number of blocks, and typically they assign these regionally. In parts of the world where IP ranges are scarce (i.e. not in North America), you can see where the telephone network will connect to different local hubs.
It sounds like it is the last case that you're seeing on your desktop only, which implies the WiFi networks near you haven't been surveyed with enough confidence for the geolocation to work.

3G/Edge/GPRS IP addresses and geocoding

We're looking to develop a mobile website. On this mobile website, we'd like to automatically populate a user's location (with proper fallback) based on their IP address. I'm aware of geocoding a location based on IP address (mapping to latitude, longitude and then getting the location with that information).
However, I'm curious how accurate this information is? Are mobile devices assigned IPs when they utilize 3G, EDGE, and GPRS connections? I think so. If that is so, does it map to a relatively accurate location? It doesn't have to be spot on, but relatively accurate would be nice.
Short answer: No.
The network assigns an IP address to the phone when the PDP context is activated (activation of PDP context is telecomms-speak for 'asking for packet data services'). It can be changed under network control, but this usually only happens when the connection has been dormant for some time.
You need to bear in mind that a typical mobile network may have several million users, and since signaling (i.e. address reconfiguration and the like) doesn't generate revenue, but costs the network scarce radio resources, it gets avoided as far as possible.
There is a further issue. Due to the architecture of mobile networks, if you have a visitor to a country who is operating using the roaming service with their home operator, they will in fact 'appear' to be in their home country. This is because the mobile device always connects to the internet through a node called the GGSN in their home network.
This is a major issue for websites which must deal with rightsholders. As an example, the BBC iPlayer service allows people located in the UK to 'catch up' on any BBC TV or radio content free of charge. In many cases, TV rights are geographically licensed, so the BBC is required to make every effort to ensure that the service is only available to users located in the UK.
This is, as I have explained above, impossible for mobile users. If I am using the SIM card of a UK network, I will 'appear' by geolocation to be in the UK regardless of where I actually am in the world.
This is not so much of a problem as yet: streaming a TV program over a 3G connection when roaming in a foreign network is prohibitively expensive (could easily be $100 or upwards for a single program), so this theoretical problem doesn't arise very often as yet. However, as roaming data costs fall (and everyone knows they will), it will become a real issue.
New smart phones (like Apple's iPhone) generally have web browsers that support HTML5 and/or some other form of client-side geolocation.
HTML5, for example, has the ability to geolocate the computer or mobile device based on a) position of the device's GPS, b) Wifi Triangulation and then c) IP address.
This is a client-side approach, and the browser will ask the user if they wish to share their location with you (which may or may not be a deal-breaker for you), but it is capable of providing < 20m accuracy.
See: About Geolocation in HTML 5

Using Dell GPS in FireFox 3.5, not Google/Skyhookwireless

I want to make sure FireFox is using my local GPS on my machine (Dell Mini-10) for Location Aware browsing, not Google wi-fi triangulation services.
How would one make sure FireFox is using the GPS? To use GPS a driver or browser plugin (Loki?) I assume is needed to talk locally with Firefox and local hardware. Firefox config would need to be modified to point to a local URI?
1) type about:config in FireFox address line, 2) filter by "geo" and you will see:
List item
geo.enabled;true
geo.wifi.uri;https://www.google.com/loc/json
The "will it work" test would be working FireFox offline, and having a good GPS signal in the middle of nowhere (no wi-fi, radio turn off), Firefox should be able to report your GPS location.
How to?
Currently Firefox only uses the Google geolocation service to translate WiFi IDs and IP addresses into latitude and longitude coordinates, it doesn't support attached GPS.
It might be that Firefox will one day support multiple location providers including your own GPS or, since Firefox is open source, you could even write that code yourself. Also, the Location Platform on Windows 7 provides support for external GPS, so it may be that Internet Explorer or Firefox will one day use that Location Platform for W3C Geolocation requests. But neither can be configured to use your GPS today.

Resources