Select to view content in your preferred language

Create New Feature Layer Collection and Select Layers to Add -- ArcGIS API for Python

03-07-2017 09:18 AM
New Contributor III

I think that when an item is created from an existing feature layer:

# Create a new empty comment layer from the already existing base comment layer

'description':'This is a comment layer that is being used for testing purposes only',
'tags':'Test, Python, Comment Layer',
'type':'Feature Service',
'url':'URL HERE'

base_comment_layer = gis.content.add(item_properties=layer_properties, data="URL HERE", folder=pf_name)

that we should be able to choose which layers we would like to add from that Hosted Feature Layer (or Feature Layer Collection):

1) Create feature layer from existing layer:

2) Specify layers to include:

The above code will create a Hosted Feature Layer with all layers included.

Correct me if I'm wrong... but I would assume that this could be specified in the item_properties described in the content manager section ArcGIS API for Python guide:

arcgis.gis module — arcgis 1.0.1 documentation 

It seems simple to delete features of a layer, or to delete the feature layer collection itself, but to delete a layer that is a part of a feature layer collection (or specify which layers to include) is not an easy task.