Page 1 of 1

problem with showing map to my page....how to read these val

Posted: Mon Jun 06, 2011 5:11 am
by krsm1980
Hello Guys!

I have come across with one issue. I am developing one website IN PHP. and i have to display map as well for each business advertisement.

I was able to retrieve the Latitude, Longitude from JPG image with the help of PICASA 3.0, in such a form:


GPS Latitude: 28 58\'28.8" N
GPS Longitude: 77 41\'28.1" E

Now i want to pass it to one URL
http://maps.google.com/?q=[Lat],[Log]
So that i display the map.

But the issue here, how to convert these values GPS Latitude: 28 58\'28.8" N in proper values, sothat i can pass it to Google API, and show the map to my PHP Page.

I really dont understand these values.
GPS Latitude: 28 58\'28.8" N
GPS Longitude: 77 41\'28.1" E

any further help would be highly appreciated.

many thanks.

Re: problem with showing map to my page....how to read these

Posted: Mon Jun 06, 2011 11:38 am
by flying_circus
Hi Krsm,

It looks like you are dealing with DMS coordinates. For example: 28 58'28.8" N is pronounced 28 degrees, 58 minutes, and 28.8 Seconds North.

I believe the google API uses (or atleast as I have used it in the past) a decimal. To get from DMS to decimal, you can do a little math.

Degrees + (((min*60) + seconds) /3600). The cardinal direction will tell you if it's a positive or negative number.

N = +
S = -
E = +
W = -

28 58'28.8"N = 28.97466666
77 41'28.1" E = 77.69113888

I hope this helps. Here is a little more information about GPS coordinates:
http://en.wikipedia.org/wiki/Geographic ... conversion