Esri / Esri/arcgis-python-api

cloning a public story map with the 2.4.2 Python API, issues

Aperta
#2,482 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
2.2k
Fork
1.2k
Merge medio
2h 40m
PR unite (30g)
2

Descrizione

So,

I'm attempting to clone a public story map to my ArcGIS Online org using clone_items.

I'm giving this a test on a public story map owned by Esri. Running this from a standard Notebook in ArcGIS Online using the 13.0 runtime (which has the 2.4.1 ArcGIS for Python API)

This is the public Story Map: https://storymaps.arcgis.com/stories/0f6f051fba32481cba12e8565e8681a0

Code seems to hang. I've tried to just clone the webmap that's within the Story Map, but that seems to hang too.

https://www.arcgis.com/apps/mapviewer/index.html?webmap=b5cebe00555444c08b13d15a00100b16

I thought clone items would copy what it needed, and Living Atlas layers and such would still be referenced?

Is there an issue with my code?

from arcgis.gis import GIS
# -------------------------------------------------------------------
# CONFIGURE THESE VALUES
# -------------------------------------------------------------------
public_storymap_item_id = "0f6f051fba32481cba12e8565e8681a0" # replace with the public StoryMap item ID

target_folder = "test" # optional; set to None if you do not want a folder
# -------------------------------------------------------------------

# Connect anonymously to access the public source item
source_gis = GIS()

# Connect to your ArcGIS Online organization
target_gis = GIS("home")

# Get the public StoryMap item
source_item = source_gis.content.get(public_storymap_item_id)

if source_item is None:
raise ValueError("Could not find the public StoryMap item. Check the item ID.")
print(f"Source item found: {source_item.title} ({source_item.type})")

# Clone the item into your organization
cloned_items = target_gis.content.clone_items(
items=[source_item],
folder=target_folder,
search_existing_items=True
)

# Report results
if cloned_items:
cloned_item = cloned_items[0]
print("Clone completed.")
print(f"New item title: {cloned_item.title}")
print(f"New item ID: {cloned_item.id}")
print(f"New item URL: {cloned_item.homepage}")
else:
print("No cloned items were returned.")

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at the clone_items call in the provided notebook code and reproduce it with the public Story Map and web map item IDs. Trace where cloning stops, including handling of referenced Living Atlas layers, and verify whether the operation completes or reports a clear failure instead of hanging.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.