laptop and a wrench

Error

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

ArcGIS Online
Número de ID del error BUG-000152935
EnviadoOctober 12, 2022
Última modificaciónJune 5, 2024
Relacionado conArcGIS Online
Versión encontradaN/A
Sistema operativoWindows OS
Versión de sistema operativo10.0 64 Bit
EstadoAs Designed

Información adicional

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.

Solución alternativa

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)

Pasos para reproducir

ID del error: BUG-000152935

Software:

  • ArcGIS Online

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga