Database geolocation which one is better - geolocation

I am looking into getting a geolocation database. I am trying to understand the difference between a paid and a free service besides how accurate the results are.
I want to display data on the page based on the user's location. Should I user server side or client side to check the location and display the data accordingly? I can imagine how to do it server side, but not client side.
If I want to get the user's ip, country, region, city, and show the cities within x km around that city, I would also need the Latitude and Longitude correct?
I was looking at
http://freegeoip.net/
and
http://www.ip2location.com/databases#comparison
option: DB5

I suggest maxmind database for Geo location, I have used maxmind database for my
website
the link of maxmind data base is-http://maxmind.com/geoip/legacy/geolite/

freegeoip uses maxmind GeoLite2 database. You could as well download it yourself (~25mb) and lookup on your server which would be faster.

Related

IP address with different country

We are using IP geolocation vendor in our application. And vendor will update their database in monthly basis.
But IP address is getting assigned to different country over time. Any proper reference or standard for this changes?
You can publish a geofeed file and host it in your website. The format is based on RFC 8805.
However, it is still up to the geolocation vendor to trust your feed and take into records. IP geolocation is under heavily manipulation due to many reasons.

How do I add default (Default to browser country) country code before the mobile number in MVC ASP.NET?

I have got a Textbox accepting mobile number. How do I add default (Default to browser country) country code before the mobile number?
I am using MVC ASP.NET
You can use the service, http://ipinfo.io, to detect the country by user's IP (The location will generally be less accurate than the native geolocation details, but it doesn't require any user permission). It will give you the client IP, hostname, geolocation information (city, region, country, area code, zip code etc) and network owner.
$.get("https://ipinfo.io", function(response) {
console.log(response.city, response.country);
}, "jsonp");
Here's a more detailed JSFiddle example that also prints out the full response information, so you can see all of the available details: http://jsfiddle.net/zK5FN/2/

Service which will return client timezone on http request

I would like to set automatically timezone on my Arduino with ethernet card. So I'd like to know if there is the service which can return client timezone on http request.
Since you have nothing but the IP address, then the only possibility is to guess at the location via IP geolocation. For example, you could use ipinfo.io, or freegeoip.net, or any number of other sources. (A Google search for "IP Geolocation" will show many results).
Of course, IP Geolocation isn't all that accurate, and you may have many incorrect results. If your device has GPS or some other source of location data, that would be much more accurate than IP Geolocation.
Once you have a latitude and longitude, you can call one of the API's listed here to return the time zone.

Geolocation - How Does it Work?

I am using a script bought from Code Canyon (a weather script) and the script uses MaxMind GeoIP Javascript Web Service to determine my users current location. The question I have is how does MaxMind (or other geolocation services) determine the location?
When it determines my location it is on average about 30 miles away from my actual city. Why and how does it determine the location being there and not closer? I assume this has to do with my ISP and my ISP routing. Is this correct?
The location it is showing you is the location of your internet server.
If you are using the geolocation code which uses your ip address to get the current location then it will show the location of your host server.
Your ISP assigns you an IP when connecting. Obviously, the ISP bought that IP at one point, and the geolocation service you are using has an entry for it, in this case, a data center of your ISP.

Save and process HTML5 geolocation in Rails

How can I store the geolocation (longitude and latitude) of a website user in Rails? (Ruby 1.9.2 + Rails 3)
Ideally I'd like to hook into the HTML5 geolocation feature instead of using an IP based lookup as I'd like to give the user control over sharing their location using the built in prompt/notifcation. But as this runs on the browser client side I am not sure how I can connect/process the data on the server side in Rails. Any idea/best-practice for getting and saving the geolocation in Rails?
Convert the lat and long decimal degrees to JSON and send to server via AJAX (or you could start by just using hidden fields), and store them in a latitude and a longitude column in the database.
If you want to do more than just store the data, use a spatially-enabled database such as Postgres with PostGIS to store geolocations allowing complex spatial functions and queries on the gathered data. To facilitate doing this in rails look at the GeoRuby and spatial_adapter gems.

Resources