<?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: ImageryLayer : get pixel values in polygon in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1006712#M70981</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46475"&gt;@ClémentLaskar&lt;/a&gt;&amp;nbsp;if your raster data is consumed via an Imagery Layer (&lt;A href="https://developers.arcgis.com/rest/services-reference/image-service.htm" target="_self"&gt;Image Service&lt;/A&gt;) you can use a direct REST call to the service &lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/compute-statistics-and-histograms.htm" target="_self"&gt;computeStatisticsHistograms&lt;/A&gt; endpoint to do what you need.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Dec 2020 18:47:11 GMT</pubDate>
    <dc:creator>JohnGrayson</dc:creator>
    <dc:date>2020-12-03T18:47:11Z</dc:date>
    <item>
      <title>ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1005451#M70938</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to build a raster analysis tool :&lt;/P&gt;&lt;P&gt;- users can view raster on their web browser&lt;/P&gt;&lt;P&gt;- they can draw polygons of interest on the map&lt;/P&gt;&lt;P&gt;- they can query for values of the raster's pixels in the polygons extents and get (for each drawn polygon) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - mean of raster value in the polygon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - histogram of raster value in the polygon&lt;/P&gt;&lt;P&gt;I thought I could use Javascript API to do this but I'm not able to find any method to get ImageryLayer pixel values intersecting a polygon. Is there any ? Furthemore, it seems like if the polygon is not visible on the map, the raster is neither. So accessing pixel value of a polygon which is not visible is impossible. Should I do this another way, using the REST API of the service ?&lt;/P&gt;&lt;P&gt;Thanks for your advices !&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 10:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1005451#M70938</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2020-11-30T10:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1006712#M70981</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46475"&gt;@ClémentLaskar&lt;/a&gt;&amp;nbsp;if your raster data is consumed via an Imagery Layer (&lt;A href="https://developers.arcgis.com/rest/services-reference/image-service.htm" target="_self"&gt;Image Service&lt;/A&gt;) you can use a direct REST call to the service &lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/compute-statistics-and-histograms.htm" target="_self"&gt;computeStatisticsHistograms&lt;/A&gt; endpoint to do what you need.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 18:47:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1006712#M70981</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2020-12-03T18:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1007293#M71030</link>
      <description>&lt;P&gt;Hi John and thanks for your answer. Looking at the doc of Statistics and Histograms in the REST API, I don't understand what exactly contains the "histograms" response attribute and how are they customizable? I don't see any query attributes to specify the classes breaks I want to get, are there any ?&lt;/P&gt;&lt;P&gt;Thanks a lot !&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 09:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1007293#M71030</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2020-12-07T09:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1007572#M71041</link>
      <description>&lt;P&gt;You can use the mosaicRule and renderingRule to control the pixels used in the calculations.&amp;nbsp; For the histogram, applying a proper mosaicRule and renderingRule is vital to make sure your stats reflect the necessary data ranges and values.&amp;nbsp; It will all depend on the type of data and how its configured and published.&amp;nbsp; I normally like to remap the data into simple meaningful groupings to make it simpler for the users of the apps to make sense of the data.&amp;nbsp; Here's a quick &lt;A href="https://codepen.io/john-grayson/pen/dypXzjK" target="_self"&gt;codepen&lt;/A&gt; showing how to make the call and retrieve the results; I hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 23:51:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1007572#M71041</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2020-12-07T23:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1007988#M71071</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thanks a lots for your codepen, i'll try it with my datas and see if it works !&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 09:20:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1007988#M71071</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2020-12-09T09:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1010757#M71131</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46475"&gt;@ClémentLaskar&lt;/a&gt;&amp;nbsp;- just wanted to let you know that this functionality is now (4.18) available as a method directly on the ImageryLayer class; see details &lt;A href="https://developers.arcgis.com/javascript/latest/guide/release-notes/#imagerylayer" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp; I've also updated the &lt;A href="https://codepen.io/john-grayson/pen/dypXzjK" target="_self"&gt;codepen&lt;/A&gt; to show this new coding pattern.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 20:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1010757#M71131</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2020-12-17T20:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1015954#M71366</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/11373"&gt;@JohnGrayson&lt;/a&gt; , thanks for the update, I took a look at the doc and it seems pretty straightforward !&lt;/P&gt;&lt;P&gt;Digging into my problem, I know now where is my issue : once you get the histogram of 0-255 values with number of pixels for each, how do you associate each value (0-255) to a use case value (in your codepen, water temperature) ? With statistics mix and max you get 0 and 255 but what about the values between ?&lt;/P&gt;&lt;P&gt;Thanks a lot !&lt;/P&gt;&lt;P&gt;Clément&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 15:30:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1015954#M71366</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2021-01-12T15:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1015994#M71367</link>
      <description>&lt;P&gt;Correct, as mentioned previously, "...&lt;SPAN&gt;applying a proper mosaicRule and renderingRule is vital to make sure your stats reflect the necessary data ranges and values."&amp;nbsp; There is no single approach that works for all use-cases.&amp;nbsp; I like to remap the pixels into human understandable categories; for the temp data I might use 5 or 10 degree intervals as integers so that I can then more easily associate a specific category with a specific range of values.&amp;nbsp; Other approaches might be to use a linear stretch and then do a simple interpolation.&amp;nbsp; Most times I just want to show a histogram chart so I'm not necessarily worried about the specific range of values in each bin.&amp;nbsp; A couple of RasterFunctions that have helped in the past are &lt;A href="https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm#ESRI_SECTION1_7545363F0B8A4B7B931A54B3C4189D9D" target="_blank" rel="noopener"&gt;Stretch&lt;/A&gt; and&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm#ESRI_SECTION1_B65D5E92E29547DCA80CAEEF6727B7F7" target="_blank" rel="noopener"&gt;Remap,&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 16:40:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1015994#M71367</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-01-12T16:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: ImageryLayer : get pixel values in polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1034935#M71994</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;I looked at your codepen again and there is one last&amp;nbsp; thing I can't figure out :&lt;/P&gt;&lt;P&gt;the data you're&amp;nbsp; using has a symbology (color&amp;nbsp; with three canals I guess), but you still get access to the original service value when you query it.&lt;/P&gt;&lt;P&gt;I was&amp;nbsp; trying to do the&amp;nbsp; same in my app but when the layer service gets the RGB symbology, I get 3 histograms with max value at 255 (indeed, it's each color level for the pixel).&lt;/P&gt;&lt;P&gt;How can I achieve the same thing as the service you're&amp;nbsp; using, and get a colored service that sends back original values when it's called&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;I link this Geonet post that is on the&amp;nbsp; same subject&amp;nbsp; and has gotten no&amp;nbsp; answer&amp;nbsp; till now&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/image-services-and-pixel-values/td-p/417939" target="_blank"&gt;https://community.esri.com/t5/arcgis-enterprise-questions/image-services-and-pixel-values/td-p/417939&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lots for your help !&lt;/P&gt;&lt;P&gt;Clément&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:19:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/imagerylayer-get-pixel-values-in-polygon/m-p/1034935#M71994</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2021-03-10T15:19:40Z</dc:date>
    </item>
  </channel>
</rss>

