问题描述
我有困难的架构和网络问题。我试图做一个网页有关在世界登山每一个城市
I have a difficult architectural and web problem. I am trying to make a page about hiking for every city in the world for http://www.comehike.com
我必须以某种方式导入所有的世界城市和状态,这是又被国家结构构造它们。
I have to somehow import all the cities in the world and structure them by state, which is in turn structured by country.
我已经有我加的手到DB国家的名单,然后加入加利福尼亚州的所有城市(有300多个,如果你认为小地方),并实现了会有没有办法,我要做到这一点通过与精度在世界上所有城市的手。
I already have a list of countries which I added by hand into the db, then added all the cities of California (there are 300+ if you consider small places), and realized there will be no way for me to do this by hand with accuracy for all the cities in the world.
有没有办法在一个自动化的方式来做到这一点?我在哪里可以从中获取可靠的数据?理想我想有自己的纬度/经度为好。
Is there a way to do this in an automated fashion? Where do I get the reliable data from? Ideally I would have their lat/lng as well.
推荐答案
您可以从 GeoNames的免费地理数据> - 这来自于从该相关信息可以很容易地进行解析的文本文件。如果免费的数据不适合你的需求不够可靠,他们还提供经过验证的数据与收费更高质量的控制。
You can download free geographical data from GeoNames -- this comes in a text file from which the pertinent information can easily be parsed. If the free data is not reliable enough for your needs, they also offer verified data with higher quality control for a fee.
这篇关于如何把世界上所有国家/城市/州到我的数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!