如何找到最近的位置 [英] how to find nearest location

查看:87
本文介绍了如何找到最近的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们将在asp.net中开发一个网站,该网站将存储(SQL Server数据库)餐馆列表.每个餐厅都将具有名称,地址,邮政编码和电话属性.当用户要搜索距离他10英里范围内最近的餐馆时,系统会找出距离他10英里以内的餐馆列表,并显示升序.
问题:
1.如何通过IP地址查找用户位置?
2.除了姓名,地址,邮政编码和电话以外,我们是否还需要存储其他信息?
3.如何计算用户到百货公司的距离?
4.我们可以使用哪种技术(谷歌地图等)?
问候,
Shamim

Hi,
We are going to develop a web site in asp.net where we will store (sql server database) list of restaurants. Each restaurant will have name, address, zip code and telephone property. While a user wants to search nearest restaurant within 10 miles radius from him, System will find out list of restaurants within 10 miles from him and show ascending order.
Question:
1. How to find user location by IP address?
2. May we need to store extra information except the name, address, zip code and telephone?
3. How to calculate distance from user to departmental store?
4. Which technology we can use (google map etc)?
Regards,
Shamim

推荐答案

1.您可以为此使用geo-IP数据库,您可以在线找到许多数据库,有些是免费的,有些是商业的.但这是非常不可靠的,特别是如果用户在移动网络上.
2.您将需要餐厅的地理坐标或从邮政编码中获取坐标的方法.
3.很少有这样做的方法: http://en.wikipedia.org/wiki/Geographical_distance [ ^ ]
1. You can use geo-IP database for this, you can find many of them online, some are free, some are commercial. But this is very unreliable, especially if user is on a mobile network.
2. You''ll need geo-coordinates of restaurants or a way to get coordinates from zip code.
3. There are few methods to do this:http://en.wikipedia.org/wiki/Geographical_distance[^]


基于IP地址的工作不可靠,因为某些ISP可能会在其他城市实际显示给定IP地址的情况下显示另一个城市.







使用以下链接,您可能会获得有用的信息.......

使用GPS和C#进行映射
http://www.developerfusion.com/article/4634/writing -gps-applications-in-net-part-1/
http://stackoverflow.com/questions/1062725/c-gps-tracking-system

祝你好运........
Ip address based work is not reliable as some ISP may show another city for a given IP address when it is physically in other city .







use the following links u may get useful info..........

Mapping with a GPS and C#
http://www.developerfusion.com/article/4634/writing-gps-applications-in-net-part-1/
http://stackoverflow.com/questions/1062725/c-gps-tracking-system

Best of luck........


这篇关于如何找到最近的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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