Zip Code to City/State and vice-versa in a database?

后端 未结 11 806
无人共我
无人共我 2020-12-28 11:20

I\'m new to SQL and relational databases and I have what I would imagine is a common problem.

I\'m making a website and when each user submits a post they have to pr

相关标签:
11条回答
  • 2020-12-28 11:37

    I got that beat. Here's a free one (zipped, csv):

    Hosted At maphacks.com

    Headers are zip,city,state,latitude,longitude,timezone,dst

    Now, your potential loss is that you aren't paying for updates (which can bite you in the end, but they try to keep it somewhat updated)

    0 讨论(0)
  • 2020-12-28 11:39

    There are many free geo-coding webservices where you can get a zip from a city-state, and vice-versa. Take a look at the GeoNames webservice. You could do something like check your db, and then if what you are looking for is not there, grab it from the webservice and add it.

    0 讨论(0)
  • 2020-12-28 11:42

    Not sure I understand the question. Do you need to allow either and, later, return both?

    You'll have to be careful, even with a zip/city database that can be purchased, since some cities span multiple zips, so you can't always "calculate" in that direction. Similar issue in the opposite direction.

    0 讨论(0)
  • 2020-12-28 11:51

    I would like to add this website.

    http://www.unitedstateszipcodes.org/zip-code-database/

    You can download the data for free if you use for Personal/Educational (as of 2014-03-20).

    0 讨论(0)
  • 2020-12-28 11:52

    My understanding is that the USPS web API is free to use, but requires permission that depends on a number of factors, including the nature of the program that will be using it and the reason you need the data.

    If you qualify to use it, this would presumably be the most accurate source for the information you need.

    0 讨论(0)
提交回复
热议问题