Click here to Skip to main content
15,794,850 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have list of link and this

Is there any way to get the latitude and longitude from this link above

What I have tried:

I tried to enter the link but it doesn't give me latitude and longitude in the URL
Updated 3-May-21 5:00am

1 solution

Have you tried pasting those URLs into your browser, whilst inspecting the network traffic? You'll see that Google responds with an HTTP 302 redirect, with the full URL in the response header. That URL includes latitude and longitude (e.g.'46.0%22N+35%C2%B049'07.8%22E/@33.7961111,35.8166446,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d33.796112!4d35.818821 which actually includes the lat/lng in both decimal degrees, and degrees/minutes/seconds (DMS) notation. So you can simply parse the redirect URL. Use an HttpWebRequest and just do a GET on the input URL.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900