I have created a simple featureservice. It has 1 property (CreatedDate) and the Esri Objectid and Shape field.
When I try to add a polygon to the database, the featureservice says:
{"addResults": [{
"objectId": 421,
"success": true
}]}
But when I look into the database, the value in the Shape column for the added record is NULL.
Down below my request, can anybody tell me what I'm doing wrong? (Probably not adding the polygon on the right way).
[{'attributes' : { 'CREATEDDATE' : 1436184185219 },'Polygon' : [ [-15541078.5927309, 6646598.13857541] , [-15540816.6594851, 6646419.36433993] , [-15540863.4932682, 6646428.53844409] , [-15540899.4300938, 6646438.23803815] , [-15540929.7262393, 6646448.56531881] , [-15540956.4176793, 6646459.66064806] , [-15540980.5485856, 6646471.7261012] , [-15541002.7392441, 6646485.0718212] , [-15541023.3938054, 6646500.21989394] , [-15541042.7929935, 6646518.18830678] , [-15541061.1412019, 6646541.60519831] , [-15541078.5927309, 6646598.13857541] ],'SpatialReference' : {'wkid' :28992}}]
Solved! Go to Solution.
There was an error in my json call.
The call down here works:
[{'attributes' : { 'CREATEDDATE' : 1436187370959 },'geometry' : { 'rings' : [[[137164.796043877, 455702.896752285] , [137240.64953067, 455589.829998068] , [137219.994969344, 455604.97807081] , [137200.595781227, 455622.946483652] , [137182.247572909, 455646.363375177] , [137164.796043877, 455702.896752285] ]],'SpatialReference' : {'wkid' :28992}}]
Hi Edwin,
How are you adding the polygon to the feature service?
By calling the Post Method on de AddFeatures url. It works for the point feature service but not for the polygon feature service.
Also using the service interface on http://server:6080/arcgis/rest/services/Test/Test/FeatureServer/0/addFeatures gives the same output as my call in C#.
There was an error in my json call.
The call down here works:
[{'attributes' : { 'CREATEDDATE' : 1436187370959 },'geometry' : { 'rings' : [[[137164.796043877, 455702.896752285] , [137240.64953067, 455589.829998068] , [137219.994969344, 455604.97807081] , [137200.595781227, 455622.946483652] , [137182.247572909, 455646.363375177] , [137164.796043877, 455702.896752285] ]],'SpatialReference' : {'wkid' :28992}}]