AnsweredAssumed Answered

Overwriting a Feature Layer from SpatialDataFrame Data Source

Question asked by natevatt_2n on Nov 27, 2018
Latest reply on Dec 6, 2018 by natevatt_2n

I am trying to update / overwrite a Feature Layer using the ArcGIS API for Python. 

I am currently loading and manipulating the data in a SpatialDataFrame and I have published the data using `sdf.spatial.to_featurelayer()`.  This function creates a shapefile and the resulting Feature Layer.  However, the data is going to be updating and changing on maybe a weekly basis.  I could delete the layer and simply recreate it, but there is a good chance that the layer will be part of a StoryMap or some other AGOL web map, so that is not an option.

 

There is a good tutorial on how to overwrite a Feature Layer using pandas and a CSV here: overwriting_feature_layers | ArcGIS for Developers , but this depends on having the data in CSV format and utilizes the pandas `read_csv()` method, which does not have read_shapefile() equivalent.  

 

The `manager.overwrite()` method does not accept SDF format (though that would be super cool), so I think the best way to do it is probably updating the underlying shapefile and then overwriting from there.  Any ideas on how to do that or any other ideas?

Outcomes