mrking Posted February 9, 2007 Share Posted February 9, 2007 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 https://forums.phpfreaks.com/topic/37729-converting-latlong-degrees-minutes-to-google-decimal-format/ Share on other sites More sharing options...
shocker-z Posted February 9, 2007 Share Posted February 9, 2007 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 lol http://support.microsoft.com/kb/213449 Regards Liam Link to comment https://forums.phpfreaks.com/topic/37729-converting-latlong-degrees-minutes-to-google-decimal-format/#findComment-180523 Share on other sites More sharing options...
paul2463 Posted February 9, 2007 Share Posted February 9, 2007 have a look here, this is a javascript version of what you want, when you view source you get a warning sayin you can use the function, you can then pull it apart and make it a php script here is the link <a href="http://www.uky.edu/KGS/gis/converter.htm">Lat-Long Converter</a> Link to comment https://forums.phpfreaks.com/topic/37729-converting-latlong-degrees-minutes-to-google-decimal-format/#findComment-180581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.