Arcade area function discrepancies

811
2
04-21-2021 09:38 PM
Labels (1)
ChrisDeuchars
New Contributor

After noticing some calculated areas using the Area function didn't look correct,  I did some testing. I calculated acreage in three ways with arcade, using the 'Shape_Area/43560' method, The Area function, and the AreaGeodetic function. I also included pre-processed acreage for comparison. 

Does anyone why the "Area" function returns a value so far from the others?

I appreciate any insight.  Expressions and screenshot below.

Thank you 

Chris 

 

ChrisDeuchars_0-1619065263506.png

 

//Acreage (Shape Area/43560) (Pop-up)
$feature["Shape_Area"]/43560

//Acreage (Arcade Area Function) (Pop-up)
Area($feature, 'acres')

//Acreage (AreaGeodetic Function) (Pop-up)
AreaGeodetic($feature, 'acre')

//MHPA Acres (AreaFunction) (Pop-up)

var mhpas = Intersects(FeatureSetByName($map,"Multi Habitat Planning Area"), $feature);
var cnt = Count(mhpas);

var intersectArea = 0;
if (cnt > 0) {
for (var mhpa in mhpas) {
intersectArea += Area(Intersection($feature, mhpa),"acres")
}
}

return Round(intersectArea, 2);

//MHPA Acres (AreaGeodetic function) (Pop-up)

var mhpas = Intersects(FeatureSetByName($map,"Multi Habitat Planning Area"), $feature);
var cnt = Count(mhpas);

var intersectArea = 0;
if (cnt > 0) {
for (var mhpa in mhpas) {
intersectArea += AreaGeodetic(Intersection($feature, mhpa),"acres")
}
}

return Round(intersectArea, 2);

 

Tags (3)
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

What is the coordinate system?  If it is Web Mercator, don't use it...it is notorious for poor area and length calculations.

Do all the functions project to a planar coordinate system prior to doing calculations?  If not they may be calculated in native units


... sort of retired...
0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi @ChrisDeuchars ,

If you look at the Arcade help for Area: https://developers.arcgis.com/arcade/function-reference/geometry_functions/#area and AreaGeodetic https://developers.arcgis.com/arcade/function-reference/geometry_functions/#areageodetic you will notice that the AreaGeodetic function is more precise than the Area function.

Returns the geodetic area of the input geometry or FeatureSet in the given units. This is more reliable measurement of area than Area() because it takes into account the Earth's curvature.

I will be better to use the AreaGeodetic function. However, there is another important note in the help:

Be aware that using $feature as input to this function will yield results only as precise as the view's scale resolution. Therefore values returned from expressions using this function may change after zooming between scales.

Since in your example you mention that you have access to the "Shape_Area", this would be the prefered source of truth. Use Area and AreGeodetic in case you intersect o merge (union) features or when you don't have access to the system maintained area (Shape_Area).  

0 Kudos