laptop and a wrench

Bug

The overwrite parameter in the plan_route function does not work in ArcGIS Notebooks for ArcGIS Online.

ArcGIS Online
Bug-ID-Nummer BUG-000152935
EingereichtOctober 12, 2022
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS Online
Gefunden in VersionN/A
BetriebssystemWindows OS
Betriebssystemversion10.0 64 Bit
StatusAs Designed

Zusätzliche Informationen

It does not seem like a bug, but there may be a specific way to use this functionality that may not be clear based on Esri documentation. If the feature service already exists, the output_name argument when using context={"overwrite":True} must reference a layer in the feature service, not the feature service itself. It would be a good to idea to check whether the service already exists before using overwrite.

Workaround

Use the following code:

from arcgis.gis import GIS from arcgis import features import datetime gis = GIS("https://notebooks.mapsdevext.arcgis.com", "ann_notebook", "testforann123") #Get Point Feature Layer for starting point: search_results = gis.content.search('title: Layer_start', 'Feature Layer') start = search_results[0] #Get Point Feature Layer for stops: search_results2 = gis.content.search('title: Layer_end', 'Feature Layer') stops = search_results2[0] if gis.content.is_service_name_available("test_plan_route", "feature service"): result = features.use_proximity.plan_routes(stops_layer=stops, route_count=1, max_stops_per_route=40, route_start_time=datetime.datetime(2022, 10, 12, 9, 0), start_layer = start, start_layer_route_id_field= "OBJECTID", return_to_start=True, include_route_layers=True, context= {"outSR": {"wkid": 3857}}, output_name = "test_plan_route", travel_mode="Trucking Time", stop_service_time = 5, gis=gis) else: target_plan_route = gis.content.search(f"test_plan_route AND owner:{gis.users.me.username}", "Feature Layer")[0] result = features.use_proximity.plan_routes(stops_layer=stops, route_count=1, max_stops_per_route=40, route_start_time=datetime.datetime(2022, 10, 12, 9, 0), start_layer = start, start_layer_route_id_field= "OBJECTID", return_to_start=True, include_route_layers=True, context= {"outSR": {"wkid": 3857},"overwrite": True}, output_name = target_plan_route.layers[0], travel_mode="Trucking Time", stop_service_time = 5, gis=gis)

Schritte zur Reproduzierung

Bug-ID: BUG-000152935

Software:

  • ArcGIS Online

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln