Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Convert GPS Coordinates for GoogleMaps

I'm getting coordinates from GPS tracker as "Lat:40 54.1434" "Lon:29 13.0226", i would like to convert this coordinates for google maps javascript api as "lat : 40.90239, lon : 29.21704". I've searched on google and found formulas+convert tool websites, i tried to understand how they converted using JavaScript but i didn't understand. Is it possible to convert using Delphi XE7 ?

Thanks for advance.

like image 365
BMF Avatar asked Feb 26 '26 03:02

BMF


1 Answers

Your GPS tracker is giving you coordinates in degrees + decimal minutes.

These are quite easy to convert to plain decimal degrees, as your Google Maps API requires, by taking the first part of the coordinate and adding on the second part divided by 60.

For example, to convert 40 54.1434 to plain decimal degrees, you split up the string into degrees = 40 and minutes = 54.1434, and then decimalDegrees = degrees + minutes / 60, which is 40 + 54.1434 / 60 = 40.90239.

like image 153
Candy Gumdrop Avatar answered Mar 01 '26 05:03

Candy Gumdrop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!