I am in the process of completing development of a website that is currently set up to utilize Yahoo! Maps API for retrieving geographic location data based upon city/state or zip code criteria within the US or city/country criteria outside the US. For the sake of scalability, I am seeking a solution that does not require constant requests to a third party, instead loading all geolocation data directly into my database for a local search. I came across MaxMind GeoLite City, which at first looked like a viable solution. However, after digging deeper, I realized that it's more for IP lookups, and as a result, not all US zipcodes are in there (since some IP ranges fall into multiple zipcodes). IP lookup is not something I really need; I want to be able to search through my database for info like city/state/zip/country, returning matching records. It's vital that the result includes latitude/longitude location, as my goal is to perform distance calculations between two points. Essentially, I want to return the same type of data I'd get from doing a search via Yahoo! Geocoding API. e.g.: when I pass in location "bear, de" or "bear, de 19701" or "19701" or "bear, usa", I get this response: <ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"> <Result precision="zip"> <Latitude>39.626032</Latitude> <Longitude>-75.661145</Longitude> <Address/> <City>Bear</City> <State>DE</State> <Zip>19701</Zip> <Country>US</Country> </Result> </ResultSet> Code (markup): One last thing is, I'm looking for something relatively inexpensive (or free preferably, though probably not likely). Thanks to anyone who can offer a potential solution!
I've needed something like this a year ago. I've just search google and I find some mysql database with state,city,zip,long,lat with 42000 inseration but I didn't find some cities. the database was created in 2002 but i think it was incomplete
Well, I came across the data provided by the USGS and NGA: NGA Foreign Geocode Data USGS Domestic Geocode Data The only problem is that the USGS domestic geocode data doesn't include zip codes, unless I'm missing something. Well, that and I'll have to design the database tables and import the data manually, creating my own API if I can't find one.
I understand that you do not want to rely on a third party for data but the problem you may run into getting a database is that not all information may be in there and more importantly, as new zip codes are added, changed or deleted, as new towns are created you will have to keep up with those changes. The USPS web site usually announces these changes well in advance but it would still mean you keeping up with them. Something to think about.
USC has developed a new site for geocoding address data which is free, secure, accurate, and located at https://webgis.usc.edu - The site can process databases of addresses or single ones and can do address parsing and normalization too.