maptastik
9/25/2018 - 1:49 PM

Use Arcade to derive WGS84 Decimal Degrees from a layer

Arcade expressions for deriving WGS84 decimal degree coordinates

// Arcade expressions to convert point coordinates from Web Mercator to WGS84 Decimal Degrees
// Based on the LibreCalc expressions found at https://wiki.openstreetmap.org/wiki/Mercator

// Latitude
(2 * Atan(Exp(Geometry($feature).y / 6378137)) - PI / 2) / (PI / 180)

// Longitude
Geometry($feature).x / (PI / 180) / 6378137
// Hacky method to go from an arbitrary CRS to Spherical Mercator
var pnt3857 = Centroid(Buffer(Geometry($feature), 0.000001, 'miles'));

// Then we can just use the formulae for Spherical Mercator to WGS84

// Latitude
(2 * Atan(Exp(pnt3857.y / 6378137)) - PI / 2) / (PI / 180)

// Longitude
pnt3857.x / (PI / 180) / 6378137;