Select to view content in your preferred language

Identify on Raster Layer

978
2
11-05-2010 06:44 AM
JoshObrecht
Regular Contributor
I am having an issue obtaining attribute data off of a raster layer from my map service.  The attribute data is retrieved but when I call attributes in the code, it claims it is undefined.  If I call idResults[0].value, I get the value of -1842.

This is the code trying to obtain the attributes and returns nothing.  Calling idResults[0].attributes produces undefined:

identifyTask.execute(identifyParams, function(idResults){
   alert(idResults[0].attributes['Pixel Value']);
    });


The identify task returns:

{"results":[{"layerId":0,"layerName":"phm_7605_wma","value":"-1842","displayFieldName":"","attributes":{"Class value":"359","Pixel Value":"-1842","Rowid":"2172","COUNT":"7277"},"geometryType":"esriGeometryPoint","geometry":{"x":-10942189.7542115,"y":4446207.90340335,"spatialReference":{"wkid":102100}}}]}

Any ideas?
0 Kudos
2 Replies
timgogl
Deactivated User
maybe : alert(idResults[0]['Pixel Value']);


i had a similar problem not long ago working with the dojo dataStore object
0 Kudos
AdrianMarsden
Honored Contributor
Hi - old thread revival - I'm trying to get the Id task to get values from a DTM stored as a raster/grid.

The ID task brings back data, but doesn't return layername or field names -

  • displayFieldName: ""
  • feature: Object
    • attributes: Object
      • Pixel Value: "98.396004"
      • Stretched value: "92"
      • __proto__: Object
    • geometry: Object
    • infoTemplate: undefined
    • symbol: null
    • __proto__: Object
  • geometryType: "esriGeometryPoint"
  • layerId: 43
  • layerName: ""


Any ideas how to work round this - have I missed something here?

Cheers

ACM
0 Kudos