Esri / Esri/arcgis-python-api

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

Offen
#2,482 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
2.2k
Forks
1.2k
Ø Merge
2 Std. 40 Min.
Gemergte PRs (30 T.)
2

Beschreibung

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.")

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.