Select to view content in your preferred language

Feature Layer Collection insert_layer not working

234
2
Jump to solution
07-01-2024 09:35 AM
abrown8
New Contributor III

Hello,

I am wondering what I am doing wrong in regards to trying to add another layer to an already published Feature Layer Collection (flc). The FLC that is already published contains a point layer and a related table. I want to add another point layer with a related table to it.

I am trying to use the FeatureLayerCollectionManager.insert_layer() but I receive this error: 'FeatureLayerCollectionManager' object has no attribute 'insert_layer'

My code so far:

item = gis.content.search(query='title:asc')[0]
type(item)
## arcgis.gis.Item

flc = FeatureLayerCollection.fromitem(item)
type(flc)
## arcgis.features.layer.FeatureLayerCollection

flc.manager.insert_layer(r"local path to shapefile.zip")
## AttributeError: 'FeatureLayerCollectionManager' object has no attribute 'insert_layer'

 

1 Solution

Accepted Solutions
EarlMedina
Esri Regular Contributor

It seems you may be on a version of the API that does not have that function. I am on Version 2.3.0 and do have access to the function.

View solution in original post

2 Replies
EarlMedina
Esri Regular Contributor

It seems you may be on a version of the API that does not have that function. I am on Version 2.3.0 and do have access to the function.

abrown8
New Contributor III

You are right - I am currently working with v2.1.0.4 and updating to the latest has solved it. Thanks.

Unfortunately, my production environment is stuck on v2.1.0.4 so will have to use the old-fashioned route of editing the definition...

0 Kudos