The formula for converted from DMS (degrees,minutes,seconds) to DD (decimal degrees) is: DD = D + M/60 + S/3600
Note that in your example, you are specifying degrees=47 and minutes=4.624 (using two fields to hold integer and decimal portions of the minutes value).
Thus, for D=47, M=4.624, we calculate: DD = 47 + 4.624/60 = 47 + 0.077067
To get this value using TW Math Filter operators, we can write:
{{{ [{!!field2}] [{!!field3}divide[60]] [{!!field4}divide[1000]divide[60]] +[sum[]multiply[1000000]round[]divide[1000000]] }}}
* get the value from field2
* get the value from field3 and then divide by 60
* get the value from field4 and then divide by 1000 to shift the decimal point to the left and then divide by 60
* add these values
* then, to round to 6 decimal places, multiply by 1000000, round to the nearest integer and then divide by 1000000
Thus, to get the latitude and longitude as variables, we would write:
<$vars latitude={{{ [{!!field2}] [{!!field3}divide[60]] [{!!field4}divide[1000]divide[60]] +[sum[]multiply[1000000]round[]divide[1000000]] }}}>
<$vars longitude={{{ [{!!field6}] [{!!field7}divide[60]] [{!!field8}divide[1000]divide[60]] +[sum[]multiply[1000000]round[]divide[1000000]] }}}>
and to construct the desired URL, we can use the title[] and addsuffix[] filters, like this:
Then, we can display the link this way:
<a href=<<url>> target="_blank"> [img[in Google Maps anzeigen|GoogleMaps_Logo_36.gif]] </a>
Putting it all together:
<$vars latitude={{{ [{!!field2}] [{!!field3}divide[60]] [{!!field4}divide[1000]divide[60]] +[sum[]multiply[1000000]round[]divide[1000000]] }}}>
<$vars longitude={{{ [{!!field6}] [{!!field7}divide[60]] [{!!field8}divide[1000]divide[60]] +[sum[]multiply[1000000]round[]divide[1000000]] }}}>
<$vars url={{{ [title[http://maps.google.at/maps?q=]addsuffix<latitude>addsuffix[+]addsuffix<longitude>] }}}>
<a href=<<url>> target="_blank"> [img[in Google Maps anzeigen|GoogleMaps_Logo_36.gif]] </a>
</$vars>
</$vars>
</$vars>
enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)