Hello,
I am currently opening my web maps in ArcGIS Pro in order to auto calculate Acreage.
This is my current work flow:
However, when polygons are added via AGOL or Field maps the field does not auto calculate. Is there a way to set this up so that when a new polygon is made there is a field that automatically shows the acreage. I would also like to do this with a line layer to calculate length.
Thank you, I would greatly appreciate any insight!
Solved! Go to Solution.
Hi @MarcyC,
If you are using field maps in agol then you would simply need to do a calculated expression for that field. Which would look like the steps below:
Create the new arcade expression to look like the one below
var edit = $editcontext.editType
var ShapeArea = $feature.Shape__Area
var CalcArea = 0
if( edit == 'INSERT'){
//if area is in sq ft
CalcArea = ShapeArea*0.0000229569
//if area is in sq meters
CalcArea = ShapeArea*0.00024711
}
return CalcArea
For line lengths you can use the same approach.
Thanks RPGIS! If anyone looks at this in the future here was my work flow:
1. Create a field named “Acres”
2. In Field Maps Designer
a. Select layer
b. Select “Acres” Field > scroll to the bottom of the Properties pane
c. Select “ New Expression” > add Arcade expression:
// Calculate the area using the geometry
var geom = Geometry($feature)
if (IsEmpty(geom)) {
return null
} else {
return Round(AreaGeodetic($feature, 'acres'), 3)
}
d. Click the drop down arrow next to the save icon to “Save to layer” this will save the expression and apply to all the maps this layer is in
I also like this blog post where I got the arcade expression: https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/common-calculated-expressions-fo...
Hi @MarcyC,
If you are using field maps in agol then you would simply need to do a calculated expression for that field. Which would look like the steps below:
Create the new arcade expression to look like the one below
var edit = $editcontext.editType
var ShapeArea = $feature.Shape__Area
var CalcArea = 0
if( edit == 'INSERT'){
//if area is in sq ft
CalcArea = ShapeArea*0.0000229569
//if area is in sq meters
CalcArea = ShapeArea*0.00024711
}
return CalcArea
For line lengths you can use the same approach.
Thanks RPGIS! If anyone looks at this in the future here was my work flow:
1. Create a field named “Acres”
2. In Field Maps Designer
a. Select layer
b. Select “Acres” Field > scroll to the bottom of the Properties pane
c. Select “ New Expression” > add Arcade expression:
// Calculate the area using the geometry
var geom = Geometry($feature)
if (IsEmpty(geom)) {
return null
} else {
return Round(AreaGeodetic($feature, 'acres'), 3)
}
d. Click the drop down arrow next to the save icon to “Save to layer” this will save the expression and apply to all the maps this layer is in
I also like this blog post where I got the arcade expression: https://www.esri.com/arcgis-blog/products/field-maps/field-mobility/common-calculated-expressions-fo...