Jump to content

GeoIP determine UK region via latitude/longitude


biggieuk

Recommended Posts

Hi all,

 

Bit of an odd question. 

 

I am using Maxmind GeoIP (http://www.maxmind.com/app/ip-location) to locate the approx location of users.

 

The api returns an object containing longitude and latitude.  I now need to use these longitude/latitude values to determine if the user is:

 

England

Scotland

Wales

Republic Ireland

Northern Ireland

Rest of World

 

An option is to gather the lon/lat of these areas and test if the user is within this range.

 

What would be the best way to go about this? Anyone done anything similar?

 

Thanks for help with this!

You are actually better off not converting the IP address to a geolocation, and instead checking if the ip address is in the areas you mentioned. In order to calculate from the geolocation, you'd have to have a plot of points for the borders you specified, and then do some complicated calculations to figure out if you are within those borders. With the IP address, you can check the address against a range for the given countries and determine that way.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.