Pro Calculate Geometry vs Arcade Geometry Functions results way off??

912
8
Jump to solution
11-21-2022 01:44 PM
Labels (2)
luckachi
Occasional Contributor III

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 

luckachi_1-1669066784034.png

 

luckachi_0-1669066765101.png

 

but when I use an Arcade expression Length($feature, 'meters') to automatically calculate the length... it comes back as 1,104.07! 

luckachi_2-1669066894095.png

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.

 

0 Kudos
1 Solution

Accepted Solutions
AlfredBaldenweck
MVP Regular Contributor

In your pictures, your calculate geometry is using the Geodesic Length, but your Arcade is using planar length.

Perhaps try LengthGeodetic() instead?

View solution in original post

8 Replies
ClayDonaldsonSWCA
Occasional Contributor II

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.

0 Kudos
luckachi
Occasional Contributor III

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.

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

In your pictures, your calculate geometry is using the Geodesic Length, but your Arcade is using planar length.

Perhaps try LengthGeodetic() instead?

luckachi
Occasional Contributor III

Thank you @AlfredBaldenweck ! That corrected the mis-match. 

0 Kudos
luckachi
Occasional Contributor III

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?

0 Kudos
KenBuja
MVP Esteemed Contributor

If polygons are showing negative areas, that usually means it was constructed in a clock-wise direction.

Problem: Polygons converted from lines have a negative area

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

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.

0 Kudos
luckachi
Occasional Contributor III

Thank you @KenBuja & @AlfredBaldenweck - I appreciate your time and responses!

0 Kudos