Problem: Arranging the field position causes duplication of the Shape field when publishing a layer as an ArcGIS Server map service
When a field is placed after the Shape, Shape.STArea(), and Shape.STLength() fields in the attribute table of a layer in an enterprise geodatabase, publishing the map as an ArcGIS Server map service results in the duplication of the Shape field and the Shape.STArea() field is removed.
The Shape, Shape.STArea(), and Shape.STLength() fields are appended at the end of the attribute table by default in an enterprise geodatabase. The behavior occurs when a field is moved (or added) to the end of the attribute table, causing the position of the fields to change. Another Shape field is created at the REST endpoint when the map is published as a map service in ArcGIS Server, which replaces the Shape.STArea() field and thus, results in the Shape.STArea() field disappearing from the map service. This is a known issue and is logged as a bug.
Solution or Workaround
Warning: It is highly recommended not to move the Shape, Shape.STArea(), and Shape.STLength() fields or to move any other fields to the end of the attribute table before publishing.Reposition the order of the fields in the attribute table before republishing the map. To do so, follow the steps provided:
Note: Newly created fields, which are appended at the end of the table by default, must also be repositioned.
- In ArcMap, right-click the layer in the Table Of Contents, and select Properties.
- In the Layer Properties dialog box, go to the Fields tab.
- Arrange the fields using the up and down arrows. The correct ordering of fields in the attribute table is as follows: user-created fields, the Shape field, the Shape.STArea() field, and the Shape.STLength() field, and click OK.
- Republish the map.
Note: Alternatively, the position of fields can also be arranged by dragging the fields to the desired position in the attribute table.
- ArcGIS Desktop Help: Rearranging the columns in a table
- ArcGIS GIS Server Help: Publish a map service from ArcMap