<?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 Different default symbology in arcmap when loading rasters in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/different-default-symbology-in-arcmap-when-loading/m-p/207126#M2192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote some script tools to extract several rasters from a dem and load, order and draw them in a group layer. Extractions happens with RasterCalculator_sa and SetNull, so all Rasters have one constant value=1. When loading these rasters back into an empty document, I get different results in terms of symbology types on different machines (all 10.6.1).&lt;/P&gt;&lt;P&gt;Machine A loads with symbology type "Stretched", while Machine B with Symbology "UniqueValues". Because I need to set the same symbology to these layers with arcpy, this causes trouble when i use ApplySymbologyFromLayer_management to do that (You can't aply a symbology layer with a different symbolgy type).&lt;/P&gt;&lt;P&gt;Rasters are stored with unsigned integer in a file geodatabase with raster.save:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rastemp = arcpy.gp.RasterCalculator_sa('("%s"&amp;nbsp; %s)*%s'%(raster_layer, queryTuple[1], queryTuple[0]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raster1 = arcpy.sa.SetNull(rastemp,1,"Value=0")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raster1.save(outputname)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and later loadeds into a group layer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.MakeRasterLayer_management(raster_workspace + "\\%s"%inputname, shortname)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ApplySymbologyFromLayer_management(layer, symb_layer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayerToGroup (df, group_lyr, layer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are only code snippets, but I think, it's not a problem with scripting, but with a different environment or something like that. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jan 2019 14:17:58 GMT</pubDate>
    <dc:creator>Andreas</dc:creator>
    <dc:date>2019-01-08T14:17:58Z</dc:date>
    <item>
      <title>Different default symbology in arcmap when loading rasters</title>
      <link>https://community.esri.com/t5/mapping-questions/different-default-symbology-in-arcmap-when-loading/m-p/207126#M2192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote some script tools to extract several rasters from a dem and load, order and draw them in a group layer. Extractions happens with RasterCalculator_sa and SetNull, so all Rasters have one constant value=1. When loading these rasters back into an empty document, I get different results in terms of symbology types on different machines (all 10.6.1).&lt;/P&gt;&lt;P&gt;Machine A loads with symbology type "Stretched", while Machine B with Symbology "UniqueValues". Because I need to set the same symbology to these layers with arcpy, this causes trouble when i use ApplySymbologyFromLayer_management to do that (You can't aply a symbology layer with a different symbolgy type).&lt;/P&gt;&lt;P&gt;Rasters are stored with unsigned integer in a file geodatabase with raster.save:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rastemp = arcpy.gp.RasterCalculator_sa('("%s"&amp;nbsp; %s)*%s'%(raster_layer, queryTuple[1], queryTuple[0]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raster1 = arcpy.sa.SetNull(rastemp,1,"Value=0")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raster1.save(outputname)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and later loadeds into a group layer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.MakeRasterLayer_management(raster_workspace + "\\%s"%inputname, shortname)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ApplySymbologyFromLayer_management(layer, symb_layer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayerToGroup (df, group_lyr, layer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are only code snippets, but I think, it's not a problem with scripting, but with a different environment or something like that. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2019 14:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/different-default-symbology-in-arcmap-when-loading/m-p/207126#M2192</guid>
      <dc:creator>Andreas</dc:creator>
      <dc:date>2019-01-08T14:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Different default symbology in arcmap when loading rasters</title>
      <link>https://community.esri.com/t5/mapping-questions/different-default-symbology-in-arcmap-when-loading/m-p/207127#M2193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swapping the lines like this seems to solve the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayerToGroup (df, group_lyr, layer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ApplySymbologyFromLayer_management(layer, symb_layer)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 16:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/different-default-symbology-in-arcmap-when-loading/m-p/207127#M2193</guid>
      <dc:creator>Andreas</dc:creator>
      <dc:date>2019-01-09T16:25:06Z</dc:date>
    </item>
  </channel>
</rss>

