So I created a new feature service (Feature Layer Collection) into a folder. It is an empty feature service with layers and table relationships. Each layer has a geometry type. I only want points. How can I delete the line and polygon layers and tables using the ArcGIS API for python? I will continue to read documentation and if I figure it out I will post back here.
Solved! Go to Solution.
This makes sense for deleting the feature service completely, but as for deleting its layers or tables it doesn't make sense to me. I can access the object (see comment below this one) but if I use the delete method on the object I get
AttributeError: 'FeatureLayer' object has no attribute 'delete'
If I ask for the object's id I get 1, which is local to the feature service itself.
from arcgis.features import FeatureLayerCollection
fs_url = 'URL HERE'
comments = FeatureLayerCollection(fs_url, gis=gis)
layers = comments.layers
tables = comments.tables
for layer in layers:
for table in tables:
Output will return each layer and table object.
but object does not support item deletion.