I am essentially wanting to create a similar function to what ArcGIS Pro and ArcMap can do which is the 'Import XY Data'. I have a CSV file with lat,long and some other fields, and want to be able to turn this into a FeatureLayer/Table/Collection and then build graphics from that.
I know I could parse the CSV file myself, and build each graphic manually but after looking into the Feature API's it looks like something like Import CSV may be possible? Any help would be appreciated.
Thanks
Solved! Go to Solution.
There is a service endpoint that offers this capability (/generate: Generate—ArcGIS REST APIs | ArcGIS Developers) but client-side you'll need to parse the CSV and create the features or graphics yourself. Note features and graphics are similar, but feature collections are within the operational layers collection of the map (and can be saved in a webmap or as a portal item) whereas graphics existing only in the graphics overlay and cannot be saved/persisted (other than saving to JSON for example).
Note it should be more efficient to use the method that takes a collection of features: Method AddFeaturesAsync (arcgis.com)
There is a service endpoint that offers this capability (/generate: Generate—ArcGIS REST APIs | ArcGIS Developers) but client-side you'll need to parse the CSV and create the features or graphics yourself. Note features and graphics are similar, but feature collections are within the operational layers collection of the map (and can be saved in a webmap or as a portal item) whereas graphics existing only in the graphics overlay and cannot be saved/persisted (other than saving to JSON for example).
Note it should be more efficient to use the method that takes a collection of features: Method AddFeaturesAsync (arcgis.com)
Thanks Michael
You can also parse the CSV and insert it into a local geodatabase, so you only have to convert it once. Here's an example of creating an entire map using a programmatically created geodatabase: