Seeking geocoding database solution (latitude/longitude data)

Discussion in 'MySQL' started by mhuggins, Jun 19, 2008.

  1. #1
    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!
     
    mhuggins, Jun 19, 2008 IP
  2. catapop

    catapop Peon

    Messages:
    79
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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
     
    catapop, Jun 19, 2008 IP
  3. mhuggins

    mhuggins Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    mhuggins, Jun 19, 2008 IP
  4. nyxano

    nyxano Peon

    Messages:
    417
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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.
     
    nyxano, Jun 19, 2008 IP
  5. catapop

    catapop Peon

    Messages:
    79
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yapp. I think third party is the best choice. any db you can find is not up to date.
     
    catapop, Jun 20, 2008 IP
  6. mhuggins

    mhuggins Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    www.geonames.org turned out to be a viable (and free) solution for anyone who is interested.
     
    mhuggins, Jul 23, 2008 IP
  7. lv211

    lv211 Peon

    Messages:
    168
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    lv211, Jul 23, 2008 IP
  8. mhuggins

    mhuggins Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Looks like this options costs money:

     
    mhuggins, Jul 27, 2008 IP
  9. dwgold

    dwgold Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    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.
     
    dwgold, Aug 27, 2008 IP
  10. catapop

    catapop Peon

    Messages:
    79
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    that db seems to be very good. thanks for the info
     
    catapop, Sep 8, 2008 IP