Lat/Long unit conversion with Arcade

17597
17
Jump to solution
10-11-2018 01:10 PM
AhjungKim4
Occasional Contributor II

I am adding geometry fields using Arcade Geometry($feature).x and Geometry($feature).y.  Since my target feature layer is in Web Mercator projection, my custom lat & long fields are displaying the values in meter.  Is there a way to convert this to decimal degrees with arcade function? 

17 Replies
AbiDhakal
Occasional Contributor III

@XanderBakker 

Hey Xander,

I have a point feature federated service in UTM NAD83 Zone16. And, I have an x and a y column that I want to populate in decimal degrees using arcade. Is it possible? What do I need to do? Here is my email address, Xander: abi.dhakal@forestry.alabama.gov

Thank you,
Abi

0 Kudos
BrittanyBurson
Occasional Contributor III

@XanderBakker also looking to convert from CA State plane zone 6 NAD83 into decimal degrees... all the examples I'm finding online seem to be converting from the default Web Mercator. Not sure it is possible.

MarceloCatalão
New Contributor II

hello, I tried to use this function, but it gave an error when testing, I wanted the fields of the layer to automatically have the coordinates

thanks

0 Kudos
JoseSernaUDC
New Contributor

@XanderBakker how are you determining the value "6378137.0"?

I am trying to use this NICE! Function you created but I think I am missing this portion. 

Im trying to convert x/y NAD83 New Jersey State Plane(EPSG:3424) coordinates to WGS84(EPSG:4326)

here is an example of the x/y coordinates:

x = 570384, y= 475445

I should get the following in lat/lon

-74.2201199 (long), 40.13836 (lat)

0 Kudos
AislinnCampbell
New Contributor II

Did you get a response to this or find a solution? I need the same. 

 

0 Kudos
LayerItOn
New Contributor III

Is there any way to make this into an attribute rule?

MarielaDel_Rio1
New Contributor

I am not entirely clear on the formula. 

I imagine the constant (6378137.0) is the semimajor axis, but why multiply by 2 and divide by 2? Doesn't that produce the same? could it be power instead of multiplication?

 

0 Kudos
TylerDeBruin
New Contributor III

Is there an arcade code similar to this to show easting/westing?

0 Kudos