Select to view content in your preferred language

Lat/Long unit conversion with Arcade

20969
21
Jump to solution
10-11-2018 01:10 PM
AhjungKim4
Frequent Contributor

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? 

21 Replies
AbiDhakal
Frequent Contributor

@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
Frequent Contributor

@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.

Reeti_05
New Contributor

@Hi @AbiDhakal , did you get any solution for this? If yes it would be great if you could shed some light how to achieve the situation you mentioned above. 

AbiDhakal
Frequent Contributor

@Reeti_05 Not yet, Reeti. If I'm able to obtain it, I will certainly post it here. Thank you for your inquiry.

0 Kudos
MarceloCatalão
Occasional Contributor

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
Emerging 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
Occasional Contributor

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

 

0 Kudos
LayerItOn
Frequent Contributor

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
Occasional Contributor

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

0 Kudos