开发者

geoLongitude and geoLatitude of address

In form on asp.net (C#) page I have text fields 开发者_如何学PythontxtCity and txtStreet, I need to save in database city, street and geoLongitude and geoLatitude of that address. How to get geoLongitude and geoLatitude of that address when I have city and street ? Is there any webservice for that ?


What you are trying to do is called "geocoding".

Google has a handy Geocoding API that you can use. For example:

http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false

That URL will dump geocoding info for "1600 Amphitheatre Pkwy, Mountain View, CA" in JSON format. Also note that the TOS says that you can only geocode addresses if you are displaying results on a Google map. Geocoding without displaying them violates the TOS.

There are also many other services out there... just search for geocoding if Google's service doesn't meet your needs.


Geocoding is the process you are looking for. You could use a desktop system, or (more likely as you are working in ASP.NET) you will want a web service. There are dozens of web services around; but as you are in the C# / ASP.Net world, your should look at the Bing Maps family of services:

http://msdn.microsoft.com/en-us/library/dd877180.aspx

("MapPoint Web Service" is the older service, the new "Bing Maps" branded services will eventually replace MapPoint Web Service, so develop against these)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜