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

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
krsm1980
Forum Commoner
Posts: 25
Joined: Sat Jan 09, 2010 12:33 am
Location: IN
Contact:

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

Post 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.
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

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

Post 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
Post Reply