mo Posted September 21, 2010 Share Posted September 21, 2010 I need some input on my design. I am creating a site similar to foursquare and I am working on my geo-location classes and logic. Option 1: I was going to use the ipinfodb website's API to gather location data for a visitor's IP address and save the returned data in a database table. This way I could always check the table first (to avoid the API overhead) than use the API if no result was found. I figure eventually my database table will be almost 100% and the API will barely be used. Option 2: My other option is the same only I start with a huge table of IP address and location data that I downloaded for free from various data gathering sites and use the API as needed to update the table with missing entries. I guess both options are the same and will work the same. My main issue is that when a visitor performs a search for locations, I do not just want o show locations in their city (which I obtain from their IP). I want to show searches from nearby cities, this is where the idea to initially start off with a huge database table came from. Since I would need to have a table which contained all US cities and their nearby cities within a specific radius. This is the design that I am having trouble with. I could use the API at ws.geonames.org to get the nearby cities and build a database table as I go just like option 1. I guess I'm just looking on some feedback on if this is the way that this is normally done or should I go another route. Link to comment https://forums.phpfreaks.com/topic/214038-geolocation-database-and-api-mixture/ Share on other sites More sharing options...
ignace Posted September 22, 2010 Share Posted September 22, 2010 IP-based geo-location is only a best estimate and for some (read dynamic ip-address) will be completely inaccurate. Link to comment https://forums.phpfreaks.com/topic/214038-geolocation-database-and-api-mixture/#findComment-1114022 Share on other sites More sharing options...
mo Posted September 22, 2010 Author Share Posted September 22, 2010 So what is the best method for determining a visitors location in your opinion? Link to comment https://forums.phpfreaks.com/topic/214038-geolocation-database-and-api-mixture/#findComment-1114103 Share on other sites More sharing options...
ignace Posted September 22, 2010 Share Posted September 22, 2010 So what is the best method for determining a visitors location in your opinion? None. Unless they are browsing with a geo-enabled device like an iPhone and allow you access to their location. Link to comment https://forums.phpfreaks.com/topic/214038-geolocation-database-and-api-mixture/#findComment-1114123 Share on other sites More sharing options...
mo Posted September 22, 2010 Author Share Posted September 22, 2010 Ok. Well this is a minor issue and the visitor will be able to manually change their location. In regard to my initial question and I guess based on your feed back. It would be a good idea to start with a master database of IP addresses by location and maintain the database when the site encounters a new IP. I think I answered my own question. I will review the various free IP geolocation databases out there and build my master tables. Link to comment https://forums.phpfreaks.com/topic/214038-geolocation-database-and-api-mixture/#findComment-1114136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.