从用户输入解析城市代码 [英] Resolve city code from user input

查看:100
本文介绍了从用户输入解析城市代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有很多地理编码服务(如 http ://geo-autocomplete.googlecode.com/svn/trunk/demo/ui.demo.html )例如,用户可以编写一个位置(或其中的一部分),并将其解析为真实的现有位置。

搜索结果中还提供了很多信息(如国家ISO代码,坐标等),但没有一项服务似乎提供了国家和地区城市代码。



我的意思是一个用来打电话的代码。例如,德国的国家代码为49,杜塞尔多夫市的国家代码为211.



是否有任何服务,我可以从用户输入中获得此信息。或者有什么办法可以将两者结合起来。例如,我从Google地理编码服务获取城市名称,并在某些城市代码数据库上试用它。如果是,任何人都可以给我提供链接。 /developer.yahoo.com/geo/geoplanet/rel =nofollow noreferrer> GeoPlanet 。欲了解更详细的服务来解决您的问题,您可能需要查看 gis.stackexchange.com 上回答,这似乎涵盖了您所需的服务。

There are a lot of geocode services out there (like http://geo-autocomplete.googlecode.com/svn/trunk/demo/ui.demo.html for example) where user can write a location (or part of it) and it will be resolved to real existing location.

There is also a lot of info provided with the search result (like country ISO code, coordinates, etc..), but none of the services seem to provide country and city code.

What I mean is a code used to phone to certain are. For example Country code for Germany will be 49 and for city of Dusseldorf will be 211.

Is there any service, where I can get this info from the user input. Or is there any way to combine the two. For example I get city name from google geocode service and the try it on some city codes database. If yes, can anyone please provide me with links.

解决方案

You can use for instance Yahoo's GeoPlanet. For more elaboration on services to solve your problem you might want to check out this answer on gis.stackexchange.com, which seems to cover the kind of service you need.

这篇关于从用户输入解析城市代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆