Hello,
Pretty new to Arcade. I need to take the geometry of my point feature and populate the field "Latitude" with the y geometry. Then run through that again but take the x geometry and populate the field "Longitude". My point feature was created in ArcPro, the map was in WGS84 for the creation, I verified again that my point feature is WGS84. I'm looking for decimal degrees but I'm not sure what this 5307669.5296 value is. Looking at other posts, sounds like its in meters? There's other posts about converting to what I'm looking for but I'm not sure where in the conversion code to plug in my '$feature'. Any help would be greatly appreciated.
I'm aware of this code here. I'm just not sure where in the expression to plug in my data (the $feature)?
function MetersToLatLon(x, y) {
// Converts XY point from Spherical Mercator EPSG:900913 to lat/lon in WGS84 Datum
// Fuente: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (x / originShift) * 180.0;
var lat = (y / originShift) * 180.0;
lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);
return [lat, lon];
}
Here's the page I'm referring to: Lat/Long unit conversion
Playing around with this code, its not failing but its also not producing any 'results' - and I think I just don't know where to plug in my $feature