<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ArcPy not detecting colorizer when layer set to stretched symbology in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-not-detecting-colorizer-when-layer-set-to/m-p/1045936#M39585</link>
    <description>&lt;P&gt;ArcPy is not detecting a raster layer's "colorizer" type when the layer is set to "Stretch" symbology. The ESRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/rasterstretchcolorizer-class.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;documentation&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;suggests this should be possible. Am I missing something?&lt;/P&gt;&lt;P&gt;Here is the Python snippet shown in the screenshot:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;import&lt;/SPAN&gt; arcpy
p = arcpy.mp.ArcGISProject(&lt;SPAN class="hljs-string"&gt;'current'&lt;/SPAN&gt;)
&lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; mp &lt;SPAN class="hljs-keyword"&gt;in&lt;/SPAN&gt; p.listMaps(&lt;SPAN class="hljs-string"&gt;'*'&lt;/SPAN&gt;):
  print(&lt;SPAN class="hljs-string"&gt;f"Check '&lt;SPAN class="hljs-subst"&gt;{mp.name}&lt;/SPAN&gt;' map for raster layers, and their symbology"&lt;/SPAN&gt;)
  &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; l &lt;SPAN class="hljs-keyword"&gt;in&lt;/SPAN&gt; mp.listLayers():
     &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; l.isRasterLayer:
         sym = l.symbology
         &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="hljs-built_in"&gt;hasattr&lt;/SPAN&gt;(sym, &lt;SPAN class="hljs-string"&gt;'colorizer'&lt;/SPAN&gt;):
             print(&lt;SPAN class="hljs-string"&gt;f"\t &lt;SPAN class="hljs-subst"&gt;{l.name}&lt;/SPAN&gt; has a colorizer type of &lt;SPAN class="hljs-subst"&gt;{sym.colorizer.&lt;SPAN class="hljs-built_in"&gt;type&lt;/SPAN&gt;}&lt;/SPAN&gt;"&lt;/SPAN&gt;)
         &lt;SPAN class="hljs-keyword"&gt;else&lt;/SPAN&gt;:
             print(&lt;SPAN class="hljs-string"&gt;f"\t Unknown symbology for '&lt;SPAN class="hljs-subst"&gt;{l.name}&lt;/SPAN&gt;'"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="RasterSymbologyWithPythonSnippet.jpg" style="width: 797px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10607iA9283C6FD42436A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="RasterSymbologyWithPythonSnippet.jpg" alt="RasterSymbologyWithPythonSnippet.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Apr 2021 15:00:56 GMT</pubDate>
    <dc:creator>KennethEggering1</dc:creator>
    <dc:date>2021-04-12T15:00:56Z</dc:date>
    <item>
      <title>ArcPy not detecting colorizer when layer set to stretched symbology</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-not-detecting-colorizer-when-layer-set-to/m-p/1045936#M39585</link>
      <description>&lt;P&gt;ArcPy is not detecting a raster layer's "colorizer" type when the layer is set to "Stretch" symbology. The ESRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/rasterstretchcolorizer-class.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;documentation&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;suggests this should be possible. Am I missing something?&lt;/P&gt;&lt;P&gt;Here is the Python snippet shown in the screenshot:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;import&lt;/SPAN&gt; arcpy
p = arcpy.mp.ArcGISProject(&lt;SPAN class="hljs-string"&gt;'current'&lt;/SPAN&gt;)
&lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; mp &lt;SPAN class="hljs-keyword"&gt;in&lt;/SPAN&gt; p.listMaps(&lt;SPAN class="hljs-string"&gt;'*'&lt;/SPAN&gt;):
  print(&lt;SPAN class="hljs-string"&gt;f"Check '&lt;SPAN class="hljs-subst"&gt;{mp.name}&lt;/SPAN&gt;' map for raster layers, and their symbology"&lt;/SPAN&gt;)
  &lt;SPAN class="hljs-keyword"&gt;for&lt;/SPAN&gt; l &lt;SPAN class="hljs-keyword"&gt;in&lt;/SPAN&gt; mp.listLayers():
     &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; l.isRasterLayer:
         sym = l.symbology
         &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="hljs-built_in"&gt;hasattr&lt;/SPAN&gt;(sym, &lt;SPAN class="hljs-string"&gt;'colorizer'&lt;/SPAN&gt;):
             print(&lt;SPAN class="hljs-string"&gt;f"\t &lt;SPAN class="hljs-subst"&gt;{l.name}&lt;/SPAN&gt; has a colorizer type of &lt;SPAN class="hljs-subst"&gt;{sym.colorizer.&lt;SPAN class="hljs-built_in"&gt;type&lt;/SPAN&gt;}&lt;/SPAN&gt;"&lt;/SPAN&gt;)
         &lt;SPAN class="hljs-keyword"&gt;else&lt;/SPAN&gt;:
             print(&lt;SPAN class="hljs-string"&gt;f"\t Unknown symbology for '&lt;SPAN class="hljs-subst"&gt;{l.name}&lt;/SPAN&gt;'"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="RasterSymbologyWithPythonSnippet.jpg" style="width: 797px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10607iA9283C6FD42436A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="RasterSymbologyWithPythonSnippet.jpg" alt="RasterSymbologyWithPythonSnippet.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 15:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-not-detecting-colorizer-when-layer-set-to/m-p/1045936#M39585</guid>
      <dc:creator>KennethEggering1</dc:creator>
      <dc:date>2021-04-12T15:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy not detecting colorizer when layer set to stretched symbology</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-not-detecting-colorizer-when-layer-set-to/m-p/1046000#M39590</link>
      <description>&lt;P&gt;There are 12 bugs, but non mention using the mp module&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/Search-Results#search?q=Raster%20Stretch%20Colorizer&amp;amp;content-type=Bugs" target="_blank"&gt;Esri Support Search-Results&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you might want to fire this off to Tech Support if none seem relevant&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 17:00:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-not-detecting-colorizer-when-layer-set-to/m-p/1046000#M39590</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-12T17:00:30Z</dc:date>
    </item>
  </channel>
</rss>

