不具合 ID 番号 |
BUG-000153589 |
送信されました | November 9, 2022 |
最終更新日 | October 14, 2025 |
適用対象 | ArcGIS Pro |
見つかったバージョン | 3.0.2 |
オペレーティング システム | Windows OS |
オペレーティング システムのバージョン | 10.0 64 Bit |
ステータス | As Designed
開発チームによる確認後に、この動作が設計どおりであると判断されました。 詳細については、「参考情報」セクションをご参照ください。
|
参考情報
Using the dataset instead of a layer as an input to the SelectBy tools is for convenience reasons. But it incurs some performance problems, as captured and explained in this issue. If performance is a concern, see the workaround.
When a dataset is passed as an input to the SelectBy tools, the first step is to generate a unique layer name. The heuristic is to create a layer based on the input name and if the layer exists, add an incrementing numeric value.
So if the input dataset is 'city.shp', the tool generates 'cityLayer' in the first loop. The second loop also generates 'cityLayer' but as this returns 'True' to the existence check, the name of the layer is renamed to 'cityLayer1'. The third loop hits two name collisions before settling on 'cityLayer2', and so on.
By the 100th iteration, we have 99 existence checks returning 'True', allowing to settle on 'cityLayer99'. The slowdown in the later parts of the iteration is due to this.
対処法
Use arcpy.management.MakeFeatureLayer to create a feature layer to be used as an input for arcpy.management.SelectLayerByAttribute. Refer to the following ArcMap documentation for more information: https://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/select-layer-by-attribute.htm
再現の手順