Attribute Rule: Latitude and Longitude

3065
7
Jump to solution
03-18-2021 02:23 PM
by Anonymous User
Not applicable

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
XanderBakker
Esri Esteemed Contributor

Hi @Anonymous User  and @DanPatterson ,

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. 

View solution in original post

7 Replies
DanPatterson
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...
0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
DanPatterson
MVP Esteemed Contributor

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


... sort of retired...
0 Kudos
DanPatterson
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 

@XanderBakker ... your domain. 

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


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

Hi @Anonymous User  and @DanPatterson ,

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. 

by Anonymous User
Not applicable

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

0 Kudos