laptop and a wrench

漏洞

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

ArcGIS Online
漏洞 ID 编号 BUG-000152935
已提交October 12, 2022
上次修改时间June 5, 2024
适用范围ArcGIS Online
找到的版本N/A
操作系统Windows OS
操作系统版本10.0 64 Bit
状态As Designed

附加信息

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.

解决办法

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)

重现步骤

漏洞 ID: BUG-000152935

软件:

  • ArcGIS Online

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项