Select to view content in your preferred language

Create Feature Layer from csv from cloud

513
2
09-18-2023 08:05 AM
kapalczynski
Frequent Contributor

I have a csv file that I a can read from a specific URL.

https://stadlspoceastus.blob.core.windows.net/curated/CrashAnalysisData/v2/real_time_prediction............. Snip ........ 

The data refreshes every 30 minutes or so.  I am trying to find the best workflow to display this data in AGOL. 

  1. Not sure if I should stage in SDE (take csv and create Feature Class and spin up to a Service) and create a python script to read the csv and truncate/append the data in SDE, if I spin this up to a service and reference this in AGOL that should do the trick I think
  2. Is there a way to add this .csv file to AGOL and then create a feature layer off of it?  But how would I automate the truncate and append in AGOL?

Any thoughts would be most appreciated.

0 Kudos
2 Replies
kapalczynski
Frequent Contributor

I forgot to mention that I need to process this data a bit.  I have a route later that I am using arcpy.lr.MakeRouteEventLayer on.  I take the MeasureTo and MeasureFrom in the csv file to create a line feature.  It is this line feature that I am trying to show in AGOL.

My initial thought was to

Step 1

  1. Take the csv file and run the GP tool to create this Feature Class in SDE
  2. Spin this FC up to a service and reference in AGOL

Step 2

  1. Create a python file that will read the .csv file every 30 minutes or so and create a temp Feature Layer in Python using MakeRouteEventLayer
  2. Then use the New Route Event Layer to Truncate and append the data in SDE.  Thus updating the data in AGOL

Does that make sense?  Any other ways to do this?  Im am thinking Local as the processing every 30 minutes would eat credits... 

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Hi @kapalczynski ,

Your workflow sounds correct.  You can use the following script in the document below to perform the truncate/append, or just use arcpy's Truncate and Append tools.

https://community.esri.com/t5/arcgis-online-documents/update-hosted-feature-service-with-feature-cla...

0 Kudos