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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.