virtualdynamo
New member
- Joined
- Jan 16, 2022
- Messages
- 14
- Reaction score
- 0
- Points
- 0
- Location
- Kansas City, MO
- Excel Version(s)
- Microsoft 365 MSO
I have 4 fields in Garmin GPS coordinates that I need to convert to degree decimal by multiplying by 2^32/360 à la:
https://gis.stackexchange.com/questions/371656/garmin-fit-coodinate-system
As this kind of thing is going to happen a lot, the generic question is: How does one do unit conversions in PQ? In this specific case, I've brute forced it as follows, but I can't believe this is the most efficient or elegant solution:
https://gis.stackexchange.com/questions/371656/garmin-fit-coodinate-system
As this kind of thing is going to happen a lot, the generic question is: How does one do unit conversions in PQ? In this specific case, I've brute forced it as follows, but I can't believe this is the most efficient or elegant solution:
Code:
let
Source = #"GPS-lap-staging",
#"Inserted lap.start_lat" = Table.AddColumn(Source, "lap.start_lat", each [GPS.lap.start_lat] * 360 / Number.Power(2, 32), type number),
#"Inserted lap.start_long" = Table.AddColumn(#"Inserted lap.start_lat", "lap.start_long", each [GPS.lap.start_long] * 360 / Number.Power(2, 32), type number),
#"Inserted lap.end_lat" = Table.AddColumn(#"Inserted lap.start_long", "lap.end_lat", each [GPS.lap.end_lat] * 360 / Number.Power(2, 32), type number),
#"Inserted lap.end_long" = Table.AddColumn(#"Inserted lap.end_lat", "lap.end_long", each [GPS.lap.end_long] * 360 / Number.Power(2, 32), type number)
in
#"Inserted lap.end_long"