解析位置字符串
我正在尝试猜测位置(非美国;可能是街道、邮政编码、社区或城市)
用户在搜索框中输入内容,我想知道你们是否可以给我一些关于如何进行此操作的提示。
我的数据库中目前有 5 个表:
地址(地址和邮政编码字段)
社区(社区字段)
城市(城市字段)
州(缩写和州字段)
国家(目前只有一行,所以我会忽略它)
我知道格式的唯一字段是州缩写(两个字符)和邮政编码(00000-000 或 00000000)。
我将如何处理重复的邮政编码、地址、社区和城市名称?
我知道我可以走 Gmaps 路线,但我想它在我的数据库集上不会很好地发挥作用。
你们有什么建议?
I'm trying to guess the location (non US; could be street, postal code, neighborhood or city)
The user typed in a search box and I was wondering if you guys could give me some tips on how to go about this.
I currently have a 5 tables in my database:
Address (address and postal code fields)
Neighborhoods (neighborhood field)
Cities (city field)
States (abbreviation and state fields)
Countries (only one row at the moment, so I'd just ignore it)
The only fields I know the format would be state abbreviations which would be two chars and postal codes that would be 00000-000 or 00000000.
How would I deal with duplicate postal codes, addresses, neighborhoods and city names?
I know I could go the Gmaps route but I'm thinking it wouldn't play very nice with my database set..
What do you guys suggest?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你会遇到重新发明轮子的麻烦。
我将使用地理编码器实现来解决这个问题,请参阅本教程
http://www.phpriot.com/articles/google-maps-geocoding/6
You will get into troubles reinventing the wheel.
I would use Geocoder implementation for this problem, see this tutorial
http://www.phpriot.com/articles/google-maps-geocoding/6