I need help to try and understand why the Arcade Geometry function for, in this example, length in meters is so off?
I created a feature that I knew was about 0.5 mile (~804.6 meters) - I also calculated it out in Google Maps. I have a field in my data where I use the calculate geometry. Calculate geometry in pro comes out to 812.06
but when I use an Arcade expression Length($feature, 'meters') to automatically calculate the length... it comes back as 1,104.07!
Can someone please explain to me what is going on? This is happening with all of our line and polygon features. I will probably remove the arcade expression because it is providing our users with completely inaccurate numbers.
Solved! Go to Solution.
In your pictures, your calculate geometry is using the Geodesic Length, but your Arcade is using planar length.
Perhaps try LengthGeodetic() instead?
You can read about the discrepancy you are experiencing here:
Geometry functions | ArcGIS Arcade | ArcGIS Developers
Feature geometries in the visualization and labeling profiles are generalized according to the view's scale resolution to improve drawing performance. Therefore, using a feature's geometry (i.e. $feature) as input to any geometry function in these contexts will return different results at each scale level. Other profiles, such as popup, provide the full resolution geometry.
Hi @ClayDonaldsonSWCA - I did read that but the results do not change when the scale is changed. The arcade function is in a popup, not a label and not related to visualization.
In your pictures, your calculate geometry is using the Geodesic Length, but your Arcade is using planar length.
Perhaps try LengthGeodetic() instead?
Thank you @AlfredBaldenweck ! That corrected the mis-match.
Question for both of you - for some features, negative numbers are being returned? Is there a way to fix that so it shows the correct area / length?
If polygons are showing negative areas, that usually means it was constructed in a clock-wise direction.
Adding this article for more documentation along the same idea. FAQ: Why does the Calculate Geometry tool return negative values? (esri.com)
There doesn't appear to be any documentation about polyline features.
Thank you @KenBuja & @AlfredBaldenweck - I appreciate your time and responses!