Web服务上的城市名称自动提示/邮政codeS包括长经纬度坐标? [英] webservice for autosuggest on city names / postal codes including long-lat coordinates?

查看:170
本文介绍了Web服务上的城市名称自动提示/邮政codeS包括长经纬度坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在找一个Web服务,用于自动完成场,
在这里人们可以填写无论是邮政code /城市名或两者

i'm looking for a webservice, to be used for an autocomplete field, where people can fill in either a postal code / city name or both

这个服务将需要所有欧洲的城市,所以我们可以将它用于所有国家的网站。
在后面的体育场,我们希望保持世界开放亚洲和美洲所以这将是一个加号。

this service will need all cities in Europe, so we can use it for all country websites. and in a later stadium we want to keep the world open for asia and america so this would be a plus.

preferably它也将返回已久的经纬度坐标的位置,

现在它是一个免费的文本框,在离开后场,我们打谷歌的地理编码服务,
找到坐标... preferably我会配合这两个在一起。
所以我们不必一件事查询2的服务。

Now it is a free textfield, after leaving the field, we hit the google geocoding service, to find coordinates... preferably i would tie these two together. so we don't have to query 2 services for one thing.

没有人知道这样的服务是否存在等的某个地方?
或者你会建议用城市/邮政codeS /坐标来建立我们自己的数据库?
如果是的话,我们就需要从什么地方得获取内容,而我试图避免这个问题:)

does anyone know of the existance of such a service online somewhere? or would you suggest to build our own database with cities / postal codes / coordinates? if so we would need to get the content from somewhere too, and i was trying to avoid that issue :)

推荐答案

最近,我搜索了类似的服务,是徒劳的。

I recently searched for a similar service, in vain.

我希望我的用户能够自动完成上输入城市名称,一旦一个城市选择我需要通过名称和经纬度/长到谷歌API。最后,我这样做: -

I wanted my users to have auto-complete on entering a city name, and once a city is chosen I needed to pass the name and lat/long onto the Google API. In the end I did this: -


  1. 下载GEONAMES allcountries.zip,充分提取物:

  2. 通过SSIS导入到一个SQL数据库(约7.5万条记录!)

  3. 写了一个简单的查询只提取城市(只有PPLC,PPLA和PPLA2记录)。

这给我留下的9112记录管理表(与纬度/经度和国家code),涵盖了世界上所有的城市。然后,我写我自己的code来查询数据。

This left me with a manageable table of 9112 records (with lat / long and country code) which covers all the cities in the world. I then wrote my own code to query the data.

不理想,但我需要一个解决方案。

Not ideal, but I needed a solution.

这篇关于Web服务上的城市名称自动提示/邮政codeS包括长经纬度坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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