ArcGIS Pro 2.9:
I have a Arcade calculation attribute rule that checks if the geometry of a feature was changed during an edit:
if (Equals(Geometry($feature), Geometry($originalfeature))) { console("geometry changed = no"); return {"result": {"attributes": {"geometry_changed": 'no' }}} } else { console("geometry changed = yes") return {"result": {"attributes": {"geometry_changed": 'yes' }}} }
The intent is: If the geometry was changed, then it sets a geometry_changed field to "yes". If not, it sets the field to "no".
The attribute rule works as expected in most cases. For example, in the Edit Vertices window, if I manually change an X or Y coordinate using the keyboard, the field will be flagged as "yes", as expected.
However, if I manually change the M-value in the Edit Vertices window using the keyboard, the field will be flagged as "no", which is not expected.
The same thing happens when I use the Drop Measures tool:
Question:
Why don't M-value edits get flagged as a change to the geometry?
Thanks.
I wonder if the Equals() function is the culprit.
After some testing, I found the following works (I removed the Equals() function and added the Text() function):
if ( Text(Geometry($feature)) == Text(Geometry($originalfeature)) ) {
I also tried doing it without the Text() function:
if ( Geometry($feature) == Geometry($originalfeature) ) {
Interesting find, the API for Equals() says
Indicates if two geometries are equal, or geographically equivalent given the spatial reference and tolerance of the data.
This in my mind agrees with your findings that the Equals() function does not take into account M values.
I'm happy with that as M could represent anything: distance, time, number of donuts...
Using the Text() function I guess is converting the geometry object into a string representation and that includes the M value so making your string comparison approach work.