从地名数据获取州/省?
我从 GeoNames 下载了美国和加拿大的这些数据库。日期如下所示:
5881639 100 Mile House 100 Mile House 51.64982 -121.28594 P PPL CA 02 0 917 America/Vancouver 2006-01-18
5881640 101 Mile Lake 101 Mile Lake 51.66652 -121.30264 H LK CA 02 0 917 America/Vancouver 2006-01-18
5881641 101 Ponds 101 Ponds 47.811 -53.97733 H PNDS CA 05 0 18 America/St_Johns 2006-01-18
我想将此数据用于城市选择器,但我想显示到其旁边的省或州。该数据似乎不包含该信息。有什么方法可以找回它吗?或者有更好的数据库包含它吗?
I downloaded these databases for US and CA from GeoNames. The date looks like this:
5881639 100 Mile House 100 Mile House 51.64982 -121.28594 P PPL CA 02 0 917 America/Vancouver 2006-01-18
5881640 101 Mile Lake 101 Mile Lake 51.66652 -121.30264 H LK CA 02 0 917 America/Vancouver 2006-01-18
5881641 101 Ponds 101 Ponds 47.811 -53.97733 H PNDS CA 05 0 18 America/St_Johns 2006-01-18
I want to use this data for a city-picker, but I want to display to province or state beside it. Doesn't look like this data contains that information. Is there some way to retrieve that? Or is there a better DB that includes that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用管理代码列中的数据,这些实际上是链接到管理代码表的 ID(管理代码有单独的数据集),非常简单。
查看 Geonames 论坛以获取更多信息。
http://forum.geonames.org/
You use the data in the columns for the admin codes these are actually ids that link to the admin codes table (there are separate data sets available for the admin codes) it is very straightforward.
Check the Geonames forums for more info.
http://forum.geonames.org/
使用此处的数据集:geocoder.ca,其中包括城市名称和州名/ 省份名称在同一文件中。
如果您想保留数据,可以使用 Google 的地理编码 API,如第一个答案所示:
Google 地图:如何获取给定纬度/经度值的国家/地区、州/省/地区、城市?
获取信息基于纬度和经度。不过,这将是一项繁重的工作,尤其是对于城市选择者来说。
Use the datasets here: geocoder.ca which include city name and state / province name in the same file.
If you want to stick with your data, you can use Google's Geocoding API, as in the first answer here:
Google Maps: how to get country, state/province/region, city given a lat/long value?
to get information based on latitude and longitude. This will be a lot of work, though, especially for a city-picker.