<?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 Re: How to Filter ImageryTileLayer Pixel Values Client-side in ArcGIS JavaScript API in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1044215#M72370</link>
    <description>&lt;P&gt;A &lt;A href="https://codepen.io/ryansutc/pen/eYBZOpq" target="_self"&gt;simplified CodePen&lt;/A&gt; showing how filtering a ClassBreaksRenderer for a raster at 4.18 fails &lt;A href="https://codepen.io/ryansutc/pen/YzNxvKR" target="_self"&gt;now works&lt;/A&gt; using "next" (4.19).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Apr 2021 16:42:07 GMT</pubDate>
    <dc:creator>RyanSutcliffe</dc:creator>
    <dc:date>2021-04-06T16:42:07Z</dc:date>
    <item>
      <title>How to Filter ImageryTileLayer Pixel Values Client-side in ArcGIS JavaScript API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/99938#M9142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;EM&gt;[updated 2020-09-06: added some CodePen examples with what I've tried]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I have a use case for an app where I would like to enable users to filter pixels based on value from an &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html"&gt;ImageryTileLayer &lt;/A&gt;(formerly TileImageryLayer) in a map by adjusting a UI widget. Looking through the API however I cannot see any way to do this. Is there a recommended approach for a situation like this?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;If I switched&amp;nbsp;to a regular ImageryLayer I believe I could accomplish this via a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter"&gt;PixelFilter &lt;/A&gt;(although I haven't implemented yet).&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Update:&lt;/DIV&gt;&lt;DIV&gt;Here is a &lt;A href="https://codepen.io/ryansutc/pen/QWyKONv"&gt;CodePen example&lt;/A&gt; showing how I've created a dynamically rendered raster layer clientside with a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-RasterStretchRenderer.html"&gt;RasterStretchRenderer&lt;/A&gt;. Unfortunately, from what I've read the RasterStretchRenderer does not seem to support filtering of values (this is consistent with other platforms like Desktop). Not sure why this is.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Here is a s&lt;A href="https://codepen.io/ryansutc/pen/mdPyWmq"&gt;econd CodePen example &lt;/A&gt;showing an approach where I tried using a ClassBreaksRenderer, creating my own breaks to mimic a stretchRenderer and then enabling filtering by setting specific breaks to be transparent. It accomplishes what I am after although the performance when a user adjusts the color scheme is much worse. It could be something with my code-- note that I run functions to dynamically recalculate colors and stops-- but looking at tests these seem to be running under 2-3ms.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;@ESRI&amp;nbsp;Is there a better way of doing this? An ESRI support person&amp;nbsp;indicated that perhaps&amp;nbsp;the RasterStretchRenderer has some optimization for dynamic display but the API documentation only says,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN&gt;The RasterStretchRenderer works well when you have a large range of values to display, such as in imagery, aerial photographs, or elevation models.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;DIV&gt;I'm wondering why dynamically adjusting a ClassBreaksRenderer would be so much worse.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any advice, guidance, is welcome.&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2020 18:11:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/99938#M9142</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2020-07-22T18:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter ImageryTileLayer Pixel Values Client-side in ArcGIS JavaScript API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/99939#M9143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ESRI Canada Technical support got back to me with this regarding performance differences between ClassBreaks and the StretchRenderer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;..the primary difference between the two is that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A data-saferedirecturl="https://www.google.com/url?q=https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html&amp;amp;source=gmail&amp;amp;ust=1598652497755000&amp;amp;usg=AFQjCNH4wGUSF8tQMFcZOixc8jEe34rTCw" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html" style="color: #1155cc; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;" target="_blank"&gt;Class Breaks Renderer&lt;/A&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;consumes more resources because it must query the attribute information on the layer first before determining how best to categorize each pixel in each class. So there is a lot of computation and logic involved behind the scenes when this renderer does its work to put each pixel value into each group. This is passed to the client, and explains the performance decrease when you dynamically change this renderer.&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;BR style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;The documentation notes this: '&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;EM&gt;ClassBreaksRenderer defines the symbol of each feature in a&amp;nbsp;&lt;A data-saferedirecturl="https://www.google.com/url?q=https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html&amp;amp;source=gmail&amp;amp;ust=1598652497755000&amp;amp;usg=AFQjCNH-_uSHUS2VKzDZwia0mznxc2s4fA" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html" style="color: #1155cc;" target="_blank"&gt;Layer&lt;/A&gt;&amp;nbsp;based on the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;value of a numeric attribute&lt;/STRONG&gt;. Symbols are assigned based on classes or ranges of data.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Each feature is assigned a symbol based on the class break in which the value of the attribute falls&lt;/STRONG&gt;.&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;'&lt;/SPAN&gt;&lt;BR style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;BR style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A data-saferedirecturl="https://www.google.com/url?q=https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-RasterStretchRenderer.html&amp;amp;source=gmail&amp;amp;ust=1598652497755000&amp;amp;usg=AFQjCNG_W3bi1biN5aN2cq0SXvLpFrI6uQ" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-RasterStretchRenderer.html" style="color: #1155cc; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;" target="_blank"&gt;Stretch Renderer&lt;/A&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is working less hard as it does not have to consider all attribute values and how they may be placed into groups of categories. It is simply just changing the values on pixels. This has less impact on the client, as is seen in your sample.&lt;/SPAN&gt;&lt;BR style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;BR style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;The documentation on this renderer notes: '&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;EM&gt;RasterStretchRenderer defines the symbology with a gradual ramp of colors for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;STRONG&gt;&lt;EM&gt;each pixel in a&amp;nbsp;&lt;A data-saferedirecturl="https://www.google.com/url?q=https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html&amp;amp;source=gmail&amp;amp;ust=1598652497755000&amp;amp;usg=AFQjCNEmD2TOw-1bumxnNak9Lp_cHMA5PQ" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html" style="color: #1155cc;" target="_blank"&gt;ImageryLayer&lt;/A&gt;&amp;nbsp;based on the pixel value&lt;/EM&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Makes sense. There was also confirmation that there isn't much in the way of other options for a client-side renderer on an ImageryTileLayer. So sounds like for now we'll opt for this approach despite it's limitations and hope that the RasterStretchRenderer will be extended to filter values at some later point by ESRI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone comes up with better solutions or workarounds would love to hear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2020 22:15:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/99939#M9143</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2020-08-27T22:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter ImageryTileLayer Pixel Values Client-side in ArcGIS JavaScript API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1003650#M70868</link>
      <description>&lt;P&gt;Update: this no longer seems to work at ArcGIS JavaScript API 4.17. Reached out to ESRI support for advice.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 21:35:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1003650#M70868</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2020-11-20T21:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter ImageryTileLayer Pixel Values Client-side in ArcGIS JavaScript API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1029198#M71834</link>
      <description>&lt;P&gt;ESRI Canada notified me that a bug (&lt;SPAN&gt;BUG-000137572) has been logged by Redlands that causes this not to work at versions 4.17+ .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 17:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1029198#M71834</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2021-02-22T17:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter ImageryTileLayer Pixel Values Client-side in ArcGIS JavaScript API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1044215#M72370</link>
      <description>&lt;P&gt;A &lt;A href="https://codepen.io/ryansutc/pen/eYBZOpq" target="_self"&gt;simplified CodePen&lt;/A&gt; showing how filtering a ClassBreaksRenderer for a raster at 4.18 fails &lt;A href="https://codepen.io/ryansutc/pen/YzNxvKR" target="_self"&gt;now works&lt;/A&gt; using "next" (4.19).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 16:42:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-imagerytilelayer-pixel-values-client/m-p/1044215#M72370</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2021-04-06T16:42:07Z</dc:date>
    </item>
  </channel>
</rss>

