<configuration> ... <fields> ... <field name="SHAPE.area" visible="true"/> ... </fields> ... </configuration>
Hi i dont think you can access shape fields in with a feature service, i have had to add the same services as a maps services, make the polygons have no symbology and then label the polygons with the area filed, users can then see the area of the polygon they just made as a label
Hi,
I am also having the same issue. I was going to display SHAPE.STArea field in Rest API to convert it into Acreage unit dynamically in web map but code works for other numerical field but not just this field. I didn't see this field displayed in REST API even though I made field checked-on visible in map document. Any help is highly appreciated.
I realize this an old conversation, but was a solution to this need ever found?
Hi Ahna,
Sorry for late reply. Yeah I got help from geonet. I used geometry engine object to solve this in my arcgis javascript application. You can find the API reference here. esri/geometry/geometryEngine | API Reference | ArcGIS API for JavaScript 3.21
Here is the snippet:
function calculateAcreage(value) {
var NameString = "<p><b>Field Name:</b> " + value.attributes.Field_Name + '</p>';
var sqft = geometryEngine.geodesicArea(value.geometry, "square-feet");
var squarefeet = number.format(sqft, {places: 1});
var acres = number.format(sqft / 43560, {places: 2});
returnString = NameString + "<p><b>Acres:</b> " + acres + '</p>';
return returnString;
};
This result the polygon field shape.area() that is in sq.ft to Acreage value. Hope this helps. Thanks
Kush