laptop and a wrench

漏洞

The query_domains method from the FeatureLayerCollection class returns an error message, "The requested layer (layerId: queryDomains) was not found. (Error Code: 400)".

上次发布: November 13, 2020 ArcGIS API for Python
漏洞 ID 编号 BUG-000134934
已提交October 27, 2020
上次修改时间June 27, 2025
适用范围ArcGIS API for Python
找到的版本1.8.2
操作系统Windows OS
操作系统版本10.0 64 Bit
修正版本2.0
状态Fixed

解决办法

Use the following script suggested in GitHub, refer to the following link, https://github.com/Esri/arcgis-python-api/issues/485#issuecomment-568037339

from arcgis.gis import GIS

gis = GIS("home")

def process_layers_or_tables(layer_or_table):

  print(f'{layer_or_table.properties.name}: {layer_or_table.url}')

  for field in layer_or_table.properties.fields:

    print(f'\t{field.name} - {field.alias} - {field.type}')

    if 'domain' in field and field.domain is not None:

      print(f'\t\tDomain associated with field')

      if field.domain.type == 'codedValue':

        for coded_value in field.domain.codedValues:

          print(f'\t\t\t{coded_value.name}')

      else:

        print(f'Not coded value domain: {field.domain}')

feature_layer = gis.content.get("7791c2d03a214eb8a767c9e58d2275a2")

for layer in feature_layer.layers:

  process_layers_or_tables(layer)

for table in feature_layer.tables:

  process_layers_or_tables(table)

重现步骤

漏洞 ID: BUG-000134934

软件:

  • ArcGIS API for Python

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项