I'm trying to add a feature layer via REST API, but its not working. I only have 4 corners coordinates. Below is my code.
'geometry' => [
'hasZ' => false,
'hasM' => false,
'rings' => [[[121.458756,15.807697],[121.458784,15.807773],[121.459115,15.807692],[121.459088,15.807596],[121.458756,15.807697]]],
'spatialReference' => [
"wkid" => 4326
]
]
Any idea?
which api is this? I don't get the syntax =>
Shouldn't rings be closed off with a repeat of the initial vertex? Do you have a reference to where you've got this from?
Hi thank you for the response, I'm very new to ArcGIS. It was close, first and last is same coordinates.. Did I do it wrong?
This is my reference:
Add Feature API:
https://developers.arcgis.com/rest/services-reference/enterprise/add-features.htm
Geometry Polygon:
https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm
You need to create a properly formatted JSON feature object.
It would look something like:
[{
"geometry": {
"rings": [
[
[121.458756, 15.807697],
[121.458784, 15.807773],
[121.459115, 15.807692],
[121.459088, 15.807596],
[121.458756, 15.807697]
]
],
"spatialReference": {
"wkid": 4326
}
}
}]