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.