<?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 identify pixel value in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509881#M47396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with identify pixel value. I publish&amp;nbsp; a raster in the Server and then, when I clik over the raster in the webmap I want to obtain the pixel value. Is it possible? What code in javascript I have to use? or what function/command? it's very easy to do with a shape file because I have an attribute table, but with raster I don't know how to do that because my raster is a float and I can't build an attribute table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Dec 2013 12:04:00 GMT</pubDate>
    <dc:creator>EulàliaMonfort</dc:creator>
    <dc:date>2013-12-05T12:04:00Z</dc:date>
    <item>
      <title>identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509881#M47396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem with identify pixel value. I publish&amp;nbsp; a raster in the Server and then, when I clik over the raster in the webmap I want to obtain the pixel value. Is it possible? What code in javascript I have to use? or what function/command? it's very easy to do with a shape file because I have an attribute table, but with raster I don't know how to do that because my raster is a float and I can't build an attribute table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 12:04:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509881#M47396</guid>
      <dc:creator>EulàliaMonfort</dc:creator>
      <dc:date>2013-12-05T12:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509882#M47397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I hope someone else can prove me wrong but I believe that this cannot be done using just the API. I really would like to add this to one of my applications but have yet to accomplish this. There might be, however, one way to do this but it's likely to be slow and clunky: publish a geoprocessing (GP) service to perform this task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcToolbox, there is a "Get Cell Value" tool. You can find it under Data Management-&amp;gt;Raster-&amp;gt;Raster Properties. You could publish this tool as a GP and then pass it your coordinates (taken from the onClick event of the raster or more likely the map) and then present the results back to your user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I played briefly with this but wasn't successful but this was because the raster I wanted to query was a geo-registered image which has no projection information (I added it to my map as a MapImageLayer). I got bogged down in a two step process of trying to project the image first and then sending that result (along with my x,y) to the Get Cell Value tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've talked with the devs at the ESRI UC about this and they seemed surprised that raster layers didn't have an identify function. I'm hoping it gets added eventually but for now, I think the GP route may be your only option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 17:04:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509882#M47397</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2013-12-05T17:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509883#M47398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are posting the service to your own ArcGIS Server, you can post the raster as an image service and the JavaScript API IdentifyTask should work to return the pixel value.&amp;nbsp; We have an application in development that is doing that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 21:27:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509883#M47398</guid>
      <dc:creator>MichaelJenkins</dc:creator>
      <dc:date>2013-12-05T21:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509884#M47399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good catch, Michael, thanks. Won't help you with MapImageLayers but I guess there is an option under the right circumstances.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 22:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509884#M47399</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2013-12-05T22:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509885#M47400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should be able to identify a raster simply by publishing it as map service, and identifying with a point. I do it with LiDAR data sets to get spot elevations, and to generate profiles by creating points along a line and using the results with dojox/charting to visualize it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Identify returns pixel value and stretched value (0-255).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 00:22:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509885#M47400</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2013-12-06T00:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509886#M47401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You should be able to identify a raster simply by publishing it as map service, and identifying with a point. I do it with LiDAR data sets to get spot elevations, and to generate profiles by creating points along a line and using the results with dojox/charting to visualize it.&lt;BR /&gt;&lt;BR /&gt;Identify returns pixel value and stretched value (0-255).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks btfou.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry but It's my first time programming in javascript and I'm a little lost. I published my raster as map service as you said. But I don't know how to identify a raster value using Identify Task. First I define Identifyparams, but then I don't know how to show the raster&amp;nbsp; value in a infoWindow. any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 10:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509886#M47401</guid>
      <dc:creator>EulàliaMonfort</dc:creator>
      <dc:date>2013-12-10T10:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509887#M47402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wrote the following code, but the response is an "undefined" instead of the pixel value&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function mapReady(map){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.connect(map,"onClick", executeIdentifyTask);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //create identify tasks and setup parameters 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyTask = new esri.tasks.IdentifyTask("http://.../rest/services/atlantic/Atlantic/MapServer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams = new esri.tasks.IdentifyParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.tolerance = 1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.layerIds = [0];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_TOP;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; //fundio executeIdentifyTask
&amp;nbsp;&amp;nbsp; function executeIdentifyTask(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.geometry = evt.mapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyParams.mapExtent = map.extent; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifyTask.execute(identifyParams,function(idResults) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(idResults[0]['pixel value']);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:19:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509887#M47402</guid>
      <dc:creator>EulàliaMonfort</dc:creator>
      <dc:date>2021-12-11T22:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509888#M47403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you using firebug or some other development tools to debug in the browser? Using such allows you to view the actual request and the response from the server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of using alert(), try using console.log(idResults). Then you'll see the response in the console.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the response from an identify of a raster layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29726[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Notice the raster values are returned in the attributes object just like a vector data identify of query. The reason your alert is undefined is because idResults[0]['pixel value'] is undefined. Try idResults[0].attributes['Pixel Value'].&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll also notice there is a space in the attribute keys. This is unique in attributes returned from AGS. In a shp or gdb feature class attributes you can't have spaces. Normally you would be able to access a specific attribute like results[0].attributes.parcelId, but this is not possible with the space. results[0].attributes.Pixel Value will return an error so you do need to use results[0].attributes['Pixel Value'].&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 15:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509888#M47403</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2013-12-10T15:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509889#M47404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is the layerName empty when you do an identify on a raster layer??&amp;nbsp; The layerId is populated correctly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 19:58:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509889#M47404</guid>
      <dc:creator>JillCress</dc:creator>
      <dc:date>2014-01-09T19:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: identify pixel value</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509890#M47405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Why is the layerName empty when you do an identify on a raster layer??&amp;nbsp; The layerId is populated correctly.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not 100% sure about this, but...I think it's because AGS is generating and returning a point independent of the raster for the result, unlike an identify on a point layer, which is returning an actual point. displayField is empty because it doesn't exist in a raster. layerName is empty because the point doesn't belong to the dataset so to speak. The layerId is populated simply to identify which layer the return point was generated from. The REST API could probably be enhanced to include layerName, but from my standpoint it's unnecessary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 20:02:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-pixel-value/m-p/509890#M47405</guid>
      <dc:creator>BenFousek</dc:creator>
      <dc:date>2014-01-10T20:02:39Z</dc:date>
    </item>
  </channel>
</rss>

