# Attribute Rule: Latitude and Longitude

1099
7
03-18-2021 02:23 PM
Labels (3)
New Contributor III

I'm trying to write an attribute rule that would write that writes the Latitude coordinates to a field.  However, the feature class I'm writing the rule on is projected in State Plane (Florida) in feet.

I have found some examples of Attribute Rules that can take data in UTM(meters) and "translates" that into Lat/Long.  But that won't help here.

I need some concrete direction on 1) if this is even possible in Attribute Rules and 2) if so, what would that expression look like?

1 Solution

Accepted Solutions
Esri Esteemed Contributor

Unfortunately, Arcade does not yet provide the possibility to project a geometry to a different coordinate system. There are some examples that allow calculating the corresponding latitude and longitude coordinates when you have the standard Web Mercator Auxiliary Sphere as input coordinate system.

The case mentioned above uses a mathematical formula to calculate the corresponding WGS 1984 coordinates. In case you have the formula you can implement it in Arcade. However, this might be complex and sometimes not very precise.

7 Replies
MVP Esteemed Contributor

What is the example?

If a rule can take coordinates from one system to another system, it most likely uses the "Project" tool/functionality under the hood.

Check your example again and see if all it requires is the existing coordinate system and the desired coordinate system.

... sort of retired...
New Contributor III

There is no example.  Looking for what the expression would use or look like at all.

Also since Attribute Rules are in Arcade, we're limited to those available functions.  It cannot run GP tools like Project, as we could do in Python, for example.

New Contributor III

Ah - on re-read I think you mean the example that can go from meters to lat-long.  It's here:

https://community.esri.com/t5/arcgis-collector-questions/collector-aurora-custom-expressions-in-cust...

You can see it's basically only recalculating using basic arithmetic.  No fancy reprojecting.

MVP Esteemed Contributor

It appears to be suited for one spheroid, I would be concerned about accuracy

... sort of retired...
MVP Esteemed Contributor

I have found some examples of Attribute Rules that can take data in UTM(meters) and "translates" that into Lat/Long.

This is what I was referring to.  I will flag

FYI .... Project geometry must be implemented? or is if for featureclasses only and not useful for attribute domains

... sort of retired...
Esri Esteemed Contributor

Unfortunately, Arcade does not yet provide the possibility to project a geometry to a different coordinate system. There are some examples that allow calculating the corresponding latitude and longitude coordinates when you have the standard Web Mercator Auxiliary Sphere as input coordinate system.

The case mentioned above uses a mathematical formula to calculate the corresponding WGS 1984 coordinates. In case you have the formula you can implement it in Arcade. However, this might be complex and sometimes not very precise.

New Contributor III

Thank you, Xander.  This is what I was starting to assume - it helps to have ESRI confirmation!