Select to view content in your preferred language

Arcade Area expression trouble

578
4
12-28-2022 10:02 AM
Labels (2)
LexiPassaro
Emerging Contributor

I am new to Arcade. I've read everything I can find, but still can't quite get the AreaGeodetic function to work on this one. I am trying to measure the area in acres of the polygons on an ArcGIS online map, and add that to the pop up. 

Here is what I'm working with:

LexiPassaro_0-1672250128861.png

When I use the AreaGeodetic Function as ($feature, 'acre'), it returns a result of 0. I'm certain I'm missing something silly. I tried it in other maps and it works.

This is what the Configure pop ups looks like for the polygons:

LexiPassaro_1-1672250377769.png

Thank you.

0 Kudos
4 Replies
MarkBockenhauer
Esri Regular Contributor

Adding an expression like this one should work.

return round(areaGeodetic($feature, 'acres'),2)+' '+ 'acres'
 
MarkBockenhauer_0-1672253662556.png

 

0 Kudos
LexiPassaro
Emerging Contributor

Thank you, however it still returns 0. Here is a screen shot of the test:

LexiPassaro_0-1672274898263.png

 

0 Kudos
MarkBockenhauer
Esri Regular Contributor

Try it with a polygon feature in your map, that you know has an area.   The  %feature test result is for the feature with OBJECTID 1 (or lowest), is there a chance your OBJECTID 1 polygon feature is not a good one?

0 Kudos
LexiPassaro
Emerging Contributor

Hello - Thank you. That must be it. It does work with other polygon features, but not this one. Is there a way to fix that?  I'm happy to read/watch a tutorial if you know of one.

It's only four polygons, so I guess it's an option to manually "trace" what's there using sketch layer... 

0 Kudos