AnsweredAssumed Answered

Issue with geometry not being created with /addFeatures

Question asked by leftieant76 on Jun 19, 2018
Latest reply on Feb 4, 2019 by mcin8130



I'm a ArcGIS REST API learner driver at the moment, so please be gentle!


Using the REST API, I'm attempting to create features in a feature service using the /addFeatures option. The POST request is being made via Python, using the requests library.


The code I am using is executing successfully, and I am getting a Success = True response from the call, but the geometry is not being created in the feature service - rather, a record is being created with the correct attributes, but null geometry.


An example of the payload being sent to the feature service is below:


{'geometry': u'{"rings":[[[2821343.5468000025,2494844.3574000001],[2822216.6736000031,2489208.7210999988],[2822216.6736000031,2489169.0335000008],[2814914.1589000002,2489314.5546999983],[2814821.5546000004,2494831.1281999983],[2821343.5468000025,2494844.3574000001]]],"spatialReference":{"wkid":102171,"latestWkid":3111}}', 'attributes': {'GLOBALID_TEXT': '{4986E78C-60AD-44DD-A36F-58E5B8630948}', 'FIRE_OBS_TYPE_PY': u'CurrBurntArea', 'INCIDENT_NAME': u'21 WALKER ST', 'OBS_CREATEDATE': 1504788222000L}}


The success message being returned is:




The JSON geometry object being used in the payload is being sourced from an fGDB feature class, using a SearchCursor and the 'SHAPE@JSON' field name. 


Having checked some of the help documentation, I note that the geometry JSON doesn't explicitly reference hasM or hasZ, which is included in the docs, but given that the success message gets returned I am unsure if this is the issue.


Can anyone with a better understanding of REST and JSON than me tell me why I am having the issue I am?

Many thanks!