SHAPE.Area field in a feature service

9082
6
06-21-2012 12:49 PM
MarkSmith1
Occasional Contributor
Hello,

I'm wondering if it's possible to see the SHAPE.Area field in the pop-up window for a layer published in a feature service. I'd like users to be able to edit the layer, add their own polygons and then see the area of that polygon. When I check the REST service the SHAPE.Area field isn't visible. Is there some other work around?

Thanks,

Mark
Tags (2)
6 Replies
FengZhang2
Occasional Contributor
Did you check the visibility of certain key fields (e.g., ObjectID, Shape, Shape.Area, and Shape.Length) in the TOC layers before publishing the service. You can check them in ArcMap > Properties > Fields > Checkbox.

Then, in the pop up config, you can do the following:

<configuration>
...
<fields>
...
<field name="SHAPE.area" visible="true"/>
...
</fields>
...
</configuration>
0 Kudos
AHay
by
New Contributor III
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
MarkSmith1
Occasional Contributor
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


Thanks for the reply. Yeah, I was just thinking that this was going to be the work around. I wonder why you can't see them in a feature service. I can understand not making that field editable but read-only would be helpful.
0 Kudos
KushendraShah1
New Contributor III

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.

0 Kudos
AhnaMiller2
Occasional Contributor

I realize this an old conversation, but was a solution to this need ever found?

0 Kudos
KushendraShah1
New Contributor III

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

0 Kudos