I am working with a TIFF file that I add as a raster layer in ArcGIS Pro. I apply symbology from an existing layer file, where the Primary Symbology is "Classify", and the classification method is Natural Breaks (Jenks).
However, I want the first class to have no color (transparent), and I’m facing issues with different methods of applying symbology.
My Current Workflow (Python)
Here is the code:
# Apply symbology from an existing layer file
if symbology_layer and os.path.isfile(symbology_layer):
arcpy.management.ApplySymbologyFromLayer(raster_layer, symbology_layer, "#", "MAINTAIN")
print(f"Applied symbology from {symbology_layer}")
else:
print(f"Warning: Symbology layer not found at {symbology_layer}. Using default colors.")
# Modify raster symbology if applicable
sym = raster_layer.symbology
What is the best way to ensure that the first class is transparent while correctly applying symbology?
Should I modify the raster_layer.symbology directly after applying the .lyrx file?
Is there a better approach using arcpy or another method in ArcGIS Pro?
Any insights or best practices would be greatly appreciated!