I have a feature layer collection with 3 layers, and I only want to perform analysis on one of the 3 layers. What is the method for assigning only that one layer of interest to a variable that I can perform analysis on? Thanks
Solved! Go to Solution.
Hello Konrad,
Something like this would work.....
import arcgis
from arcgis.gis import GIS
gis = GIS()
# Grab the feature layer item by id
featureLayerItem = gis.content.get('c7c2420dfa884f34890da0a78b6a0533')
#Print out layer 0 from the layer list
print(featureLayerItem.layers[0])
Essentially, you can call the "layers" property which gives you back a list. Then you can access an item from that list by using the square bracket notation.
Hello Konrad,
Something like this would work.....
import arcgis
from arcgis.gis import GIS
gis = GIS()
# Grab the feature layer item by id
featureLayerItem = gis.content.get('c7c2420dfa884f34890da0a78b6a0533')
#Print out layer 0 from the layer list
print(featureLayerItem.layers[0])
Essentially, you can call the "layers" property which gives you back a list. Then you can access an item from that list by using the square bracket notation.