I want to retrieve the latitude and longitude of a golf course using the address in my database. I have researched and tried this but all the sample code seems to require a user intervention. Does anyone have C# code that performs this task without an outside
user having to intervene?
This seems to require the user to point. I probably did not make my questiion clear. I have a WebMatrix web site and the user enters an address. I want to lookup the latitude and longitude in C# code to add to the database along with the address.
This seems to require the user to point. I probably did not make my questiion clear. I have a WebMatrix web site and the user enters an address. I want to lookup the latitude and longitude in C# code to add to the database along with the address.
It doesn't require the user to point. A basic scenario could be that, when user entered the address and clicked on Submit, the code-behind calls a web service (for example, the one from Google) and retrieves the response. If address is known, you will get
the coordinates that could be saved along with the entered address. Please see given examples above.
apokon
Member
22 Points
15 Posts
latitude and longitude
Feb 26, 2012 12:01 AM|LINK
I want to retrieve the latitude and longitude of a golf course using the address in my database. I have researched and tried this but all the sample code seems to require a user intervention. Does anyone have C# code that performs this task without an outside user having to intervene?
smirnov
All-Star
23668 Points
4050 Posts
Re: latitude and longitude
Feb 26, 2012 02:56 AM|LINK
Google provides a Geocoding Web Service API which you can call from your application. You need to call the service url
http://maps.google.com/maps/geo?q=address (JSON)
or
http://maps.google.com/maps/api/geocode/xml?sensor=false&address=address (XML)
and parse an output.
See here an example. (API key is not required any more).
ramiramilu
All-Star
95463 Points
14106 Posts
Re: latitude and longitude
Feb 26, 2012 12:10 PM|LINK
Bing maps, get latitude and longitude - http://www.tacticaltechnique.com/how-to/longitude-latitude-bing-maps/
Thanks,
JumpStart
srinanthuram
Contributor
6800 Points
1549 Posts
Re: latitude and longitude
Feb 26, 2012 12:18 PM|LINK
hi
http://itouchmap.com/latlong.html
http://www.worldatlas.com/aatlas/imageg.htm
thank u
apokon
Member
22 Points
15 Posts
Re: latitude and longitude
Feb 28, 2012 05:30 PM|LINK
This seems to require the user to point. I probably did not make my questiion clear. I have a WebMatrix web site and the user enters an address. I want to lookup the latitude and longitude in C# code to add to the database along with the address.
apokon
Member
22 Points
15 Posts
Re: latitude and longitude
Feb 28, 2012 05:32 PM|LINK
Thank for the link. I've seen this when researching but the example is way beyond my ability to understand. I guess I'm stuck.
smirnov
All-Star
23668 Points
4050 Posts
Re: latitude and longitude
Feb 29, 2012 12:52 AM|LINK
It doesn't require the user to point. A basic scenario could be that, when user entered the address and clicked on Submit, the code-behind calls a web service (for example, the one from Google) and retrieves the response. If address is known, you will get the coordinates that could be saved along with the entered address. Please see given examples above.
apokon
Member
22 Points
15 Posts
Re: latitude and longitude
Feb 29, 2012 02:43 PM|LINK
OK, I get it. Thanks for the extra help on this.