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 Number BUG-000152935
SubmittedOctober 12, 2022
Last ModifiedJune 5, 2024
Applies toArcGIS Online
Version foundN/A
Operating SystemWindows OS
Operating System Version10.0 64 Bit
StatusAs Designed

Additional Information

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)

Steps to Reproduce

Bug ID: BUG-000152935

Software:

  • ArcGIS Online

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options