Select to view content in your preferred language

ArcGIS 10- addFeatures- Invalid graphic features

2472
2
11-04-2010 05:31 PM
AshleyMort
Deactivated User
Can someone help me construct polygon JSON that will work via the REST API addFeatures test web page?  I can get a point to work but not polyline or polygon.

For example, I can't get the following to work.  Can anyone give me an example of a polygon JSON string that would work given this test page URL?  Thank you!

http://servicesbeta.esri.com/ArcGIS/rest/services/Fire/IncidentAssessment/FeatureServer/1/addFeature...

{
"geometry":{"rings":[[[59.974935376045,42.304312935237],[66.994430083565,49.825200121866],[63.860727089136,41.614898276462],[59.974935376045,42.304312935237]]]
,
"attributes":{"OWNER":"Polygon6"}
}
0 Kudos
2 Replies
RicoLelina
Emerging Contributor
Ashley, try replacing the 1 in FeatureServer/1/addFeatures with a 3. I think 1 is for adding a point, 0 for multipoint, 2 for line, and 3 for polygon.

Rico

Can someone help me construct polygon JSON that will work via the REST API addFeatures test web page?  I can get a point to work but not polyline or polygon.

For example, I can't get the following to work.  Can anyone give me an example of a polygon JSON string that would work given this test page URL?  Thank you!

http://servicesbeta.esri.com/ArcGIS/rest/services/Fire/IncidentAssessment/FeatureServer/1/addFeature...

{
"geometry":{"rings":[[[59.974935376045,42.304312935237],[66.994430083565,49.825200121866],[63.860727089136,41.614898276462],[59.974935376045,42.304312935237]]]
,
"attributes":{"OWNER":"Polygon6"}
}
0 Kudos
AshleyMort
Deactivated User
Thanks.  I tried that but I also needed to wrap my object in brackets like this:

[{
"geometry":{"rings":[[[59.974935376045,42.304312935237],[66.994430083565,49.825200121866],[63.860727089136,41.614898276462],[59.974935376045,42.304312935237]]]
,
"attributes":{"OWNER":"Polygon6"}
}]
0 Kudos