How to know the latitude and longitude of a given address

Hi ,
if I supply the details like
Address:
City:
State:
Country:
Zip Code:
in an asp.net page

How can I get the values of the latitude and longitude of the address using C#
mauneeldAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ramkisan JagtapLead DeveloperCommented:
you can use google maps api.
Refer following link
http://code.google.com/apis/maps/documentation/javascript/v2/overlays.html
0
mauneeldAuthor Commented:
Hi RamKisan,

I am unable to find the code snippet which takes in address as the input from the user and then give the coordinates i.e..., latitude and longitude of that address.

0
Ramkisan JagtapLead DeveloperCommented:
please che following example link. View source for code.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ggeekCommented:
Google Maps geocoding service can be used.
Since the question was about C# you may use this small C# wrapper of the Google Maps geocoding service:
http://code.google.com/p/geocodingapi/






private static readonly List<string> Addresses = new List<string> 
{ 
    "1600 Amphitheatre Parkway, Mountain View, CA 94043",       // Google 
    "1 Microsoft Way, Redmond, WA 98052",                       // Microsoft 
    "1601 S. California Ave., Palo Alto, CA 95304",             // Facebook 
    "701 First Ave, Sunnyvale, CA 94089"                        // Yahoo 
}; 
 
// The API is rate limited.  1 request every 0.5 seconds seems to keep Google happy. 
private static readonly int DelayInMs = 500; 
 
static void Main(string[] args) 
{ 
    foreach (string address in Addresses) 
    { 
        Geocoding.Geocode(address) 
            .ForEach(coordinate => DisplayCoordinate(coordinate, address)); 
 
        Thread.Sleep(DelayInMs); 
    } 
} 
 
 
private static void DisplayCoordinate(GeographicCoordinate coordinate, string address) 
{ 
    Console.WriteLine("Geographic coordinate for '{0}':", address); 
    Console.WriteLine( 
        "\t* Latitude: {0}, Longitude: {1}", 
        coordinate.Latitude, 
        coordinate.Longitude 
        ); 
}

Open in new window

0
mauneeldAuthor Commented:
Hi ggeek,
For the code which you supplied needs to have a key...but I dont have a key since I do not have an URL...
Is there a way to get a key without providing the URL
0
mauneeldAuthor Commented:
Hi Ramkisan,

I am getting the address correctly, but how do I find the latitude and longitude of the specified address?
With the code over the link
http://www.stackoverflow.com/questions/3684765/google-maps-using-geocoder-to-get-long-lat-with-javascript

I am unable to still find the latitude and longitude of a given location.
0
mauneeldAuthor Commented:
Solution was easy to follow
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.