Generate tool error - 414 URI Too Long

327
1
01-05-2024 07:06 AM
ranico
by
New Contributor II

I am trying to create an app that allows a user to upload a csv file and uses the Analyze and Generate tool from the REST API to get a feature collection which can be displayed on the map.

- Analyze: https://developers.arcgis.com/rest/users-groups-and-items/generate.htm

- Generate: https://developers.arcgis.com/rest/users-groups-and-items/generate.htm

This sample code already shows how it is done for shapefiles, but I need to be able to do it for CSVs too: https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-shapefile/. The Generate documentation says it works for CSVs but when I analyze the CSV first and append the publish parameters to the query (to be used in the generate tool), I get a 414 error saying the URI is too long.

I understand I might not need to use all of the publish parameters from the analysis, but the documentation doesn't really say what all should be passed through and not so I just assumed pass the whole thing. If someone could further clarify what needs to be passed in or a solution to the URI being too long that would be appreciated.

The results from the analyze function are attached.

0 Kudos
1 Reply
ranico
by
New Contributor II

It looks like someone else was having the exact same issue with the URI being too long. Someone responded with an alternative solution (provided in original post): https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problem-with-creating-a-point-lay.... This will do for me, however, I think this post is worth leaving open until the original problem is resolved (explaining why the URI is not working).

0 Kudos