Jump to content

Converting lat/long Degrees minutes to google decimal format


mrking

Recommended Posts

I have a form where you can enter coordinates (values that get written to my MySQL database) in the format of N49 26.222 W122 35.222. We use that format for our group as it is a standard for marking waypoints.

 

Now I am coding some php to plot the MySQL data into a google map API. Everything works great with my test database as I have the coordinate values of 49.437033, -122.587033

 

Now before I set up the database for that style of coords I tested it with writing data to it using my two variable $latitude and $longitude. All worked well.

 

But, I now need an intermediate php function that will take the input form data coords of  N49 26.222 W122 35.222 convert them to decimal format, 49.437033, -122.587033 and then upload the converted coords to the database.

 

I have no idea where to start. Can anyone give me a hand?

 

Cheers,

 

mike

Link to comment
Share on other sites

not sure on this one i have done a fasir bit of work with maps an so on and created a system to create postcode into longlat in a way that i could have a database full of postcodes and just convert to decimal (lon and lat) but or a less you can find a way of enter your info into multimap then you can't really parse it.. possibly look for another site that can do it?

 

http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html

 

Looks like that site does it.. you may possibly be able to automate the process via there site or read up further on how to convert yourself.

 

possible helpful links:

http://geography.about.com/library/howto/htdegrees.htm

AND

EVEN a Microsoft article on it :o lol

 

http://support.microsoft.com/kb/213449

 

 

 

Regards

Liam

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.