ArcPy not detecting colorizer when layer set to stretched symbology

649
1
04-12-2021 08:00 AM
KennethEggering1
New Contributor II

ArcPy is not detecting a raster layer's "colorizer" type when the layer is set to "Stretch" symbology. The ESRI documentation suggests this should be possible. Am I missing something?

Here is the Python snippet shown in the screenshot:

import arcpy
p = arcpy.mp.ArcGISProject('current')
for mp in p.listMaps('*'):
  print(f"Check '{mp.name}' map for raster layers, and their symbology")
  for l in mp.listLayers():
     if l.isRasterLayer:
         sym = l.symbology
         if hasattr(sym, 'colorizer'):
             print(f"\t {l.name} has a colorizer type of {sym.colorizer.type}")
         else:
             print(f"\t Unknown symbology for '{l.name}'")

RasterSymbologyWithPythonSnippet.jpg

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

There are 12 bugs, but non mention using the mp module

Esri Support Search-Results

you might want to fire this off to Tech Support if none seem relevant

 


... sort of retired...