Python for ArcGIS Pro by Silas Toms Bill Parker

Python for ArcGIS Pro by Silas Toms Bill Parker

Author:Silas Toms, Bill Parker
Language: eng
Format: epub
Tags: COM043000 - COMPUTERS / Networking / General, COM051360 - COMPUTERS / Programming Languages / Python, COM005000 - COMPUTERS / Enterprise Applications / General
Publisher: Packt
Published: 2022-04-22T04:20:42+00:00


In the next cell, you will loop through the layers and use a conditional to test whether the layer isBroken. If a layer isBroken, you will print out the name and connectionProperties property for that layer. connectionProperties is a read-only property, so you cannot update it by writing new values to it; you have to use the updateConnectionProperties method for this.

Type in the following:

for layer in layers: if layer.isBroken is True: print(layer.name) print(layer.connectionProperties)

Run the cell. The results of the print statement are the name of the layer as a string and the connection properties as a dictionary:

UniqueStops_Summer21 {'dataset': 'UniqueStops_Summer21', 'workspace_factory': 'File Geodatabase', 'connection_info': {'database': 'C:\PythonBook\Chapter7_old\Chapter7\TransitData.gdb'}} Summer21RouteShape {'dataset': 'Summer21RouteShape', 'workspace_factory': 'File Geodatabase', 'connection_info': {'database': 'C:\PythonBook\Chapter7_old\Chapter7\TransitData.gdb'}}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.