Inspecting and replacing layer sources
The first and most important arcpy.mapping
module use is to identify and fix the broken links between layers in a map document and their data sources. Layer symbology and GIS data storage are separated, meaning that layer data sources are often moved. Arcpy.mapping
offers a quick solution, though imperfect.
This solution depends on a number of methods included in the arcpy.mapping
module. First, we will need to identify the broken links, and then we will fix them. To identify the broken links we will use the ListBrokenDataSources()
method included in arcpy.mapping
.
The ListBrokenDataSources()
method requires an MXD path to be passed to the MapDocument()
method of arcpy.mapping
. Once the map document object ...
Get ArcPy and ArcGIS – Geospatial Analysis with Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.