Friday 29 September 2017

arcgis 10.1 - Adding raster catalog to MXD using arcpy.mapping?


Using the bit of code below adds the raster catalog footprint polygon layer.


mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
addOrtho2011 = arcpy.mapping.Layer(r"P:\Mapping\Data\Orthos.gdb\Orthos_2011")
arcpy.mapping.AddLayer(df, addOrtho2011, "TOP")


enter image description here


I can't figure out what else I have to do to add the actual ortho part of the raster catalog. Any suggestions?



Answer



Your raster catalog is displaying as a wireframe due to a setting on the layer properties which is described here.


This setting does not appear to be accessible to ArcPy so as a workaround you could change the scale after adding it so that it is under the threshold set.


However, I think a better solution is to check the box on the layer properties so that wireframes do not show at all (which will be unwise if too many) and then Save As layer File so that you can add the layer from a layer file as per the code example here.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...