Esri / arcgis-rest-js

compact, modular JavaScript wrappers for the ArcGIS REST API
https://developers.arcgis.com/arcgis-rest-js/
Apache License 2.0
347 stars 120 forks source link

Creating a new feature with a point failing #1113

Closed pranspach closed 1 year ago

pranspach commented 1 year ago

Describe the bug

I'm trying to add a point to a feature by following the Typescript definitions, but every different permutation fails.

"err": { "message": "400: Cannot perform operation. Invalid operation parameters.", "name": "ArcGISRequestError", "stack": "ArcGISRequestError: 400: Cannot perform operation. Invalid operation parameters.\n at checkForErrors ([/var/task/node_modules/@esri/arcgis-rest-request/dist/cjs/request.js:148:15)\n](mailto:/var/task/node_modules/@esri/arcgis-rest-request/dist/cjs/request.js:148:15)\n) at [/var/task/node_modules/@esri/arcgis-rest-request/dist/cjs/request.js:345:30\n](mailto:/var/task/node_modules/@esri/arcgis-rest-request/dist/cjs/request.js:345:30\n) ...

What's the best way to debug "Invalid operation parameters"? Is there a sandbox to validate specific parameters?

To resolve this issue, I have tried several geometry formats all resulting in the API error seen above. Some of the formats attempted:

“geometry”: { “x”: -88.1, “y”: 41.7 }

“geometry”: { “x”: -88.1, “y”: 41.7 }

“geometry”: { “x”: -88.1, “y”: 41.7, “z”:0 }

“geometry”: { “x”: -88.1, “y”: 41.7, “latitude”: -88.1, “longitude”: 41.7, }

“geometry”: { “x”: -88.1, “y”: 41.7, “spatialReference”: { “wkid”: 4326 }, }

“geometry”: { “x”: -88.1, “y”: 41.7, “type”: “Point” }

“geometry”: { “coordinates”: [ -88.1, 41.7 ], “type”: “Point” }

Any assistance that can be provided to successfully add point geometry to a feature would be greatly appreciated.

System Info

"@esri/arcgis-rest-feature-service": "^4.0.3",
"@esri/arcgis-rest-portal": "^4.1.0",
"@esri/arcgis-rest-request": "^4.1.0"

Additional Information

No response

gavinr-maps commented 1 year ago

Hi @pranspach, thank you for the question. Can you please provide an example replication code script that is causing this issue? Preferably on a public ArcGIS Feature Service endpoint.

pranspach commented 1 year ago

Closing issue. The error was very generic, but I was trying to create a point on an unsupported layer type (linestring).