-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the bug
If you have none, one, or multiple feature layers present in a feature service with no table(s) then the insert_layer() method works just fine (although the name parameter is not honored). However, if you have a single table (or more) in your feature service the insert_layer() method will fail.
To Reproduce
Have a feature service with a table(s)
agol = GIS("home")
item = agol.content.get("FS_ITEM_ID")
shp_path = r"C:\Path\to\Zipped_Shapefiles\Shapefile.zip"
flc = FeatureLayerCollection.fromitem(
item = item
)
#use the flc object insert_layer() method to create a feature layer
status = flc.manager.insert_layer(
data_path=shp_path,
name="County Boundaries Layer" # does not honour
)
print(status)error:
Traceback (most recent call last):
File "C:\ArcGISAFP_02\Python_Scripts_Completed\06_Add_Layers_and_Tables\insert_layer.py", line 36, in <module>
status = flc.manager.insert_layer(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\glenb\Documents\ArcGIS\Clones\arcgispro-clone\Lib\site-packages\arcgis\features\managers.py", line 2527, in insert_layer
raise e
File "C:\Users\glenb\Documents\ArcGIS\Clones\arcgispro-clone\Lib\site-packages\arcgis\features\managers.py", line 2497, in insert_layer
not in orig_item.layers[index].properties["supportedAppendFormats"]
~~~~~~~~~~~~~~~~^^^^^^^
IndexError: list index out of rangeScreenshots
If applicable, add screenshots to help explain your problem.
Expected behavior
The layer should be inserted whether tables exist or not in the Feature Service
Platform (please complete the following information):
- OS: Windows 11 Hopme
- Browser Chrome
- Python API Version 2.4.1.1
Additional context
Add any other context about the problem here, attachments etc.