In ArcMap I'm trying to display specific raster layers using data driven pages and I got stuck. I have around fifty raster layers and corresponding pages in data driven pages. I only want specific layers on specific pages (one layer per one page is also acceptable). Normaly when I want to achive this with shp's or FC's I use page dafinition but here it's not possible. Any ideas how to do this?
I would use a combination of data driven pages and arcpy. If the names of the pages correspond somehow with the names of the raster layers, you could use something like this. In this example all raster layers are turned on, but you would want to compare the name to something that matches the page name or some other attribute of the index layer.
mxd = arcpy.mapping.MapDocument(strPath + strMXD + ".mxd") for i in range(1, mxd.dataDrivenPages.pageCount): for df in arcpy.mapping.ListDataFrames(mxd, "*"): for lyr in arcpy.mapping.ListLayers(mxd, "*", df): if lyr.isRasterLayer: print lyr.name lyr.visible = True
Solution: Create Raster Catalogue -> Add field corresponding to data driven page -> use page definition query to match raster with DDP.
johns, Matthew thanks for repllies.