In ArcGIS Pro, unknown alphanumeric characters are added to the Network Analysis data name.
上次发布: September 8, 2020ArcGIS Pro
漏洞 ID 编号
BUG-000133359
已提交
August 26, 2020
上次修改时间
March 26, 2021
适用范围
ArcGIS Pro
找到的版本
2.6
服务器平台
Windows
客户端平台
10.0 64 Bit
状态
Known Limit
经开发团队审核,已确定此问题与不受 Esri 控制的软件的已知限制有关。 问题的“其他信息”部分可能包含进一步说明。
附加信息
This behavior is as designed. The feature datasets and feature classes for network analysis layers use automatically-generated unique names. In previous releases, this was done using a numbering scheme, but this was changed later on to a string of alphanumeric characters.
When writing scripts, you should not try to access the network analysis layer’s sublayers directly by their data paths, as this is not a supported workflow and the naming convention is not static or guaranteed. Instead, here are two ways to directly access the results of a network analysis:
Method 1
Use this method if you have a layer-based workflow in a python script. Retrieve the output sublayer’s layer object and grab the data source from this or just use the layer object itself as input into further tools.
Here is an example for a Closest Facility layer. You can retrieve the Routes sublayer object from the parent Closest Facility layer object like this:
routes_sublayer = layer_object.listLayers("Routes"])[0]
You can then do routes_sublayer.dataSource if you want to see the actual catalog path to the data source. You can use that catalog path or the routes_sublayer object itself as input into other geoprocessing tools.
To see a full workflow example similar to this, see the “MakeODCostMatrixAnalysisLayer example 4” code sample here: https://pro.arcgis.com/en/pro-app/tool-reference/network-analyst/make-od-cost-matrix-analysis-layer.htm (This uses OD Cost Matrix instead of Closest Facility, but it’s the same idea.)
Method 2
This is an entirely different way of solving a network analysis problem in python, one that does not involve layers at all.
In ArcGIS Pro, we introduced a new python module, arcpy.nax, that provides a new python interface for doing network analysis. The new interface is more pythonic and easier to use in many ways.
You can learn the basics of how it works here: https://pro.arcgis.com/en/pro-app/arcpy/network-analyst/performing-network-analysis.htm
To summarize, you create a network analysis object for the solver you want, load the desired inputs, solve, and then retrieve the results in one of several ways. You can use the export() method on the solver result object to save the outputs to a feature class. You can also retrieve the outputs using a cursor, so it’s possible to retrieve only the fields you care about and write them directly into another table that already has your desired schema.