<?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 How do you use the color_ramp raster function on raster's with multiple bands? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-use-the-color-ramp-raster-function-on/m-p/1306716#M11973</link>
    <description>&lt;P&gt;I am attempting to apply color ramps to raster files in my project. The stretch renderer allows for applying color ramps to rasters, but currently only has 3 preset options. Alternatively, I have been applying color ramps to my rasters using raster functions. However, I have only been able to load the symbology of a raster layer in runtime if the symbology is RGB. If I configure the symbology as Stretch, Unique Values, Colormap, or Classify, then the layer is loaded into runtime with no symbology, aka the layer is black/white. Raster layers with RGB symbology have multiple bands and my raster functions won't apply to rasters with more than 1 color band.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am currently using the example color_ramp function format from:&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/layers/add-raster-data/#supported-raster-functions" target="_blank" rel="noopener"&gt;Add raster data | ArcGIS Maps SDK for .NET | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;{
  "raster_function":{"type":"Color_ramp_function"},
  "raster_function_arguments":
  {
    "resizable":{"bool":false,"type":"Raster_function_variable"},
    "color_ramp":
    {
      "color_ramp":
      {
        "ramps":
        [
         {"to_color":[0,255,0],"from_color":[0,191,191],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[255,255,0],"from_color":[0,255,0],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[255,127,0],"from_color":[255,255,0],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[191,127,63],"from_color":[255,127,0],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[20,20,20],"from_color":[191,127,63],"num_colors":3935,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"}
        ],
        "type":"Multipart_color_ramp"
      },
      "type":"Raster_function_variable"
    },
    "raster":{"name":"raster","is_raster":true,"type":"Raster_function_variable"},
    "type":"Raster_function_arguments"
  },
  "type":"Raster_function_template"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;The issue is that if my raster contains multiple bands, then the raster function throws up an error such as "Band Count is 3."&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is there an issue with my raster function?&lt;/LI&gt;&lt;LI&gt;Should I be adding some optional Raster Function Argument to allow for multiband rasters?&lt;/LI&gt;&lt;LI&gt;Are there even other arguments other than "resizable" and "color_ramp"?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My application is &lt;STRONG&gt;&lt;U&gt;offline,&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;so I can't use an image service to handle raster functions.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 21:47:29 GMT</pubDate>
    <dc:creator>JBuchanan</dc:creator>
    <dc:date>2023-07-07T21:47:29Z</dc:date>
    <item>
      <title>How do you use the color_ramp raster function on raster's with multiple bands?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-use-the-color-ramp-raster-function-on/m-p/1306716#M11973</link>
      <description>&lt;P&gt;I am attempting to apply color ramps to raster files in my project. The stretch renderer allows for applying color ramps to rasters, but currently only has 3 preset options. Alternatively, I have been applying color ramps to my rasters using raster functions. However, I have only been able to load the symbology of a raster layer in runtime if the symbology is RGB. If I configure the symbology as Stretch, Unique Values, Colormap, or Classify, then the layer is loaded into runtime with no symbology, aka the layer is black/white. Raster layers with RGB symbology have multiple bands and my raster functions won't apply to rasters with more than 1 color band.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am currently using the example color_ramp function format from:&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/layers/add-raster-data/#supported-raster-functions" target="_blank" rel="noopener"&gt;Add raster data | ArcGIS Maps SDK for .NET | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;{
  "raster_function":{"type":"Color_ramp_function"},
  "raster_function_arguments":
  {
    "resizable":{"bool":false,"type":"Raster_function_variable"},
    "color_ramp":
    {
      "color_ramp":
      {
        "ramps":
        [
         {"to_color":[0,255,0],"from_color":[0,191,191],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[255,255,0],"from_color":[0,255,0],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[255,127,0],"from_color":[255,255,0],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[191,127,63],"from_color":[255,127,0],"num_colors":3932,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"},
         {"to_color":[20,20,20],"from_color":[191,127,63],"num_colors":3935,"type":"Algorithmic_color_ramp","algorithmic_type":"hsv"}
        ],
        "type":"Multipart_color_ramp"
      },
      "type":"Raster_function_variable"
    },
    "raster":{"name":"raster","is_raster":true,"type":"Raster_function_variable"},
    "type":"Raster_function_arguments"
  },
  "type":"Raster_function_template"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;The issue is that if my raster contains multiple bands, then the raster function throws up an error such as "Band Count is 3."&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is there an issue with my raster function?&lt;/LI&gt;&lt;LI&gt;Should I be adding some optional Raster Function Argument to allow for multiband rasters?&lt;/LI&gt;&lt;LI&gt;Are there even other arguments other than "resizable" and "color_ramp"?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My application is &lt;STRONG&gt;&lt;U&gt;offline,&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;so I can't use an image service to handle raster functions.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 21:47:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-use-the-color-ramp-raster-function-on/m-p/1306716#M11973</guid>
      <dc:creator>JBuchanan</dc:creator>
      <dc:date>2023-07-07T21:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the color_ramp raster function on raster's with multiple bands?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-use-the-color-ramp-raster-function-on/m-p/1307015#M11981</link>
      <description>&lt;P&gt;One approach would be to combine a bunch of raster functions to accomplish this - Extract Band + Color Ramp + Composite Band&lt;BR /&gt;&lt;BR /&gt;Use Extract Band function to create a single raster for each band in your source data&lt;BR /&gt;Use Color Ramp function to colorize each single-band raster created above&lt;BR /&gt;Use Composite Band function to combine all single-band rasters into a multi-band raster.&lt;BR /&gt;&lt;BR /&gt;See&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/layers/add-raster-data/#supported-raster-functions" target="_blank"&gt;https://developers.arcgis.com/net/layers/add-raster-data/#supported-raster-functions&lt;/A&gt;&amp;nbsp;for function syntax&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 18:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-use-the-color-ramp-raster-function-on/m-p/1307015#M11981</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2023-07-10T18:12:17Z</dc:date>
    </item>
  </channel>
</rss>

