JF LeRoch on 04 Apr 2017 15:16:27
Possibility to use UTM format for coordinates instead of Lat/Long on maps
- Comments (4)
RE: Use UTM Coodinates
While this function is not implemented, I am solving this issue with an algorithm that I developed that can be used within Power Query through the M language.
The solution is available in the community at this link:
https://community.powerbi.com/t5/Desktop/maps-with-UTM-coordinates-instead-of-Latitude-and-Longitude/m-p/1320973#M571832
RE: Use UTM Coodinates
'I created a formula to convert utm -> lat long
Note that this works for south america (I only tested with uruguay) but should be a good starting point as you only need to change a few constants to make it work in different places.
utm_to_Lat =
// Constantes
var huso = 21 // C
var hemisferio = "S" // D
var semieje_mayor = 6378137 //E
var semieje_menor = 6356752.31424518 // F
var excentricidad = 0.0818191908426203 // G
var segunda_excentricidad = 0.0820944379496945 // H
var e_prima = 0.00673949674227624 // I
var radio_polar_curvatura = 6399593.62575849 // J
var Alfa = (DIVIDE(3,4)*e_prima) //S
var Beta = (5/3) * (Alfa^2) // T
var Gamma = (35/27) * (Alfa^3) // U
//Calculos
var al_sur_ecuador = IF(hemisferio = "S", Sensores[Coordena Y] - 10000000, Sensores[Coordena Y]) // AE
var Fi = al_sur_ecuador / (6366197.724*0.9996) // K
var Ni = DIVIDE(radio_polar_curvatura, (1+ e_prima * (COS((Fi))^2))^(1/2))*0.9996 // L
var a = DIVIDE((Sensores[Coordena X] - 500000),Ni) // M
var A1 = SIN(2*Fi) // N - no se usa
var A2 = A1 * ((COS(Fi)) * (COS(Fi))) // O
var J2 = Fi + (DIVIDE(A1,2)) // P
var J4 = DIVIDE(((3 * J2) + A2),4) // Q
var aux_J6 = 5 * J4 + A2 * ((COS(Fi))*(COS(Fi)))
var J6 = DIVIDE(aux_J6,3) // R
var B_fi = 0.9996 * radio_polar_curvatura * (Fi-(Alfa*J2)+(Beta * J4) - (Gamma * J6)) // V
//VAR DEBUG = "Radio Polar c:" & radio_polar_curvatura & " /FI:"&Fi & " /Alfa:"&Alfa & " /J2:" & J2 & " /Beta:" &Beta & " /J4:" & J4 & " /Gamma:" & Gamma & " /J6:" &J6
var b = DIVIDE((al_sur_ecuador - B_fi),Ni) // W
var Zeta = DIVIDE((e_prima * (a^2)),2) * (COS(Fi))^2 // X
var Xi = a * (1 - DIVIDE(Zeta,3)) // Y
var Eta = (b * (1-Zeta)) + Fi // Z
var Sen_h_Xi = DIVIDE((EXP(Xi) - EXP(-Xi)),2) // AA
var delta_lambda = ATAN(DIVIDE(Sen_h_Xi,(COS(Eta)))) // AB
var tau = ATAN((COS(delta_lambda) * TAN(Eta))) // AC
var meridiano_central = (6 * huso) - 183 // AD
var oldradianes = Fi + (1 + (e_prima * (COS(Fi)^2)) - (DIVIDE(3,2) * e_prima * SIN(Fi) * COS(Fi) * (tau - Fi)) * (tau - Fi))
var rad
RE: Use UTM Coodinates
We also see a challenge because, as environmental engineers, often included with the initial data are Northing and Easting coordinates. For Power BI reporting we currently instruct data owner to manually converting the values. It would be handy to know a formula that converts these UTC Northing and Easting Values to Latitude and Longitude. Please reply to this thread if you know one. Our goal to create calculated columns so we can transform the UTM source data into a format that can be used by the map visuals. Native support for UTM could help many customers who, for example, may need to gather data using GPS devices.
RE: Use UTM Coodinates
...to clarify what I meant by "manually" there are online tools that can be used to convert UTM values to longitude and latitude.