Unable to list data sources using the workspace factory object if the layer contains a join.
上次发布: February 3, 2020ArcGIS Pro
漏洞 ID 编号
BUG-000126288
已提交
October 25, 2019
上次修改时间
February 14, 2025
适用范围
ArcGIS Pro
找到的版本
N/A
操作系统
Windows OS
操作系统版本
10.0
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
When joins are present on a layer, the connection properties dictionary includes the join information. The dictionary is different for layers with joins vs layers without joins. The difference in dictionary structure needs to be accounted for in the script. Layers can have zero, one or many joins. Use a recursive function to accomplish this:
```import arcpydef ConPropsWithJoins(cp): if 'source' in cp: return ConPropsWithJoins(cp['source'])
else:
print(' ', '- database:', cp['connection_info']['database'])
print(' ', '- dataset:', cp['dataset'])
print(' ', '- workspace_factory:', cp['workspace_factory'])aprx = arcpy.mp.ArcGISProject(r"C:\temp\fgdb_012joins.aprx")m = aprx.listMaps()[0]for lyr in m.listLayers(): print(f"LAYER: {lyr.name}")
if lyr.supports("dataSource"): cp = lyr.connectionProperties
if cp is not None: ConPropsWithJoins(cp)```