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?
You can access the lat/long individually by adding ".X" or ".Y" to the end of Geometry($feature), so your attribute rule would be:
<SPAN class="keyword token">return</SPAN> <SPAN class="token function">Geometry</SPAN><SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>Y<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
for Latitude, and
<SPAN class="keyword token">return</SPAN> <SPAN class="token function">Geometry</SPAN><SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>X<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
for Longitude.
return Geometry($feature).Y
will only work on point features. Try this instead:
return Centroid(Geometry($feature)).Y
Hello Kelly,
I'm trying to use this expression in ArcPro 2.9.1 and I get an error. See attached. What am I doing wrong? Any help would be greatly appreciated.
Has anyone been able to figure out if it is possible to populate an x,y or for that matter any geometry field (extents for example) in a coordinate system other than the one the feature class is project in?
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.
Totally agree. They're like magic!
Attribute rules are so cool.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.