-1

I have used ipinfo (not need user's autorization) or equivalent to get user's location informations, which is used to get it weather informations from openWeatherMap. The problem is that localization by using ip-address can be not precise considering it depend of the user internet access point (ISP, ...). For example, considering the Cameroon as country, if my internet connexion is provided by a server located in Yaoundé and i am located in Dschang ; common ip localization API like ipinfo one, will give me Yaoundé as my city location. That say, we will have the equivalent result if the server is located in a different country.

In the same order, HTML5-geolocalization API (need user's autorization) is seem be an excellent way, considering the fact that it can be more precise (sometimes with 100m accuracy). However, that precision depends of considering API function's arguments settings and browser configuration ; this article from html5doctor.com gives some lighting about that. My problem is, i don't also get expected result with it; considering the previous example, i get Douala (ISP location) as result instead of Dschang.

So How to have better precise result with these methods or is there another way to get user's precise location ?

tnga
  • 182
  • 2
  • 8
  • 5
    This has been answered here [http://stackoverflow.com/questions/2577305/how-to-get-gps-location-from-the-web-browser](http://stackoverflow.com/questions/2577305/how-to-get-gps-location-from-the-web-browser) – Juha Tauriainen Mar 29 '16 at 11:29
  • I also know about HTML5-geolocalization method but it also seem to be not precise (i don't get the expected result with it), however it seem to be more precise than ip-address localization method. are these two method the only available methods ? (maybe it how i use them, but i think not). – tnga Mar 29 '16 at 11:54
  • There is no magic. The openWeatherMap site has an input box to type your city name. It then stores the information in a cookie called "cityid". The next time you visit their site it automatically displays information for that cityid. – Yogi Mar 29 '16 at 12:02
  • @Roberto, interresting, i just experimented it by deleting considering cookie and you are right. So there is not better method than previous enumerated? – tnga Mar 29 '16 at 12:13

1 Answers1

1

Using the address for Geolocation purposes is not very accuracy. The reason is that IP geolocation services are based in data collection, that it means that you ip is registered into a dabatase that register the location. Usually the location is the ISP location instead you real location.

There are some ip geolocation services (many of them commercial services) that can offer a very accuracy location. Some of those services can achieve a good accuracy because they pay to Ads providers for the GPS location information. For example when you are using your mobile mobile with location services activated (GPS enable) and you visit any website with Ads, the Ads can get your GPS location and send it to an IP geolocation service that will pay to the Ad provider for the collection service. When the IP geolocation service detects that many users with a very close coordinates are connected to network with same IP then they can conclude the IP real location, however this is not perfect as well, because those user can be connected to a dynamic IP, or there is not GPS signal (indoor).

My recommendation is try to combine the Javascript Geolocation API with an IP geolocation service.

You can find some information about how to use the Geolocation API in: http://html5doctor.com/finding-your-position-with-geolocation/

Juan Lago
  • 960
  • 1
  • 10
  • 20
  • effectively, i use to combine the Javascript Geolocation API with an IP geolocation service/API. I just try to find if there is a better and optimal way. – tnga Mar 29 '16 at 12:19