Can Centroid($feature) be used to populate lat/lon with attribute rule?

131
4
Jump to solution
01-16-2020 12:06 PM
Highlighted
MVP Frequent Contributor

I see Geometry Functions | ArcGIS for Developers  exists but how would one call that to populate separate lat and lon fields with an attribute rule? 

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
New Contributor III

You can access the lat/long individually by adding ".X" or ".Y" to the end of Geometry($feature), so your attribute rule would be:

return Geometry($feature).Y

for Latitude, and 

return Geometry($feature).X

for Longitude. 

Arcade expression for Latitude

View solution in original post

4 Replies
Highlighted
New Contributor III

You can access the lat/long individually by adding ".X" or ".Y" to the end of Geometry($feature), so your attribute rule would be:

return Geometry($feature).Y

for Latitude, and 

return Geometry($feature).X

for Longitude. 

Arcade expression for Latitude

View solution in original post

Highlighted
MVP Frequent Contributor

Attribute rules are so cool.

Highlighted
New Contributor III

Totally agree. They're like magic!

Highlighted
New Contributor II

Is there a way to return the geometry in a different coordinate system? For example, my layer is in NAD83 but I would like for the WGS 84 coordinates to auto-populate in the attribute table.

Reply
0 Kudos