Select to view content in your preferred language

Raster identify (pixel value) with viewer for flex

6709
25
11-22-2011 09:39 AM
MartynSmith
Emerging Contributor
I'm trying to create a simple flex viewer app that will display a popup or hovertip containing a raster pixel value.  I have searched the forums and haven't found any way to do this with the ArcGIS viewer for Flex.  I was thinking perhaps it would be possible using the geoprocessing widget and a geoprocessing service (ie. extract values from points).

If it can't be done with the viewer, is this possible using the ArcGIS API for flex?  I am running ArcGIS Server 9.3.

Any help would be appreciated.
Tags (2)
0 Kudos
25 Replies
RhettZufelt
MVP Notable Contributor
Was wondering if you ever found a solution for this?

Piece of cake using the Web ADF maps with the identify tool, but have not figured out a way with Flex/Flash.

Of course, need to figure this out for a Mapservice, as I don't have ImageServer.

Thanks,

R_

Professional ESRI beta tester (aka paying customer)
0 Kudos
MartynSmith
Emerging Contributor
I actually did manage to get a raster pixel value with Robert Scheitlin's identify widget (see attachment).  This isn't a documented feature of the widget but it does in fact work getting a pixel value from a raster.  Its not perfect, and doesn't allow for too much customization of the Identify widget window, however.

What I'd like to get working is the new for Viewer for Flex PopUp widget to get a raster pixel value.  Since it works with the identify widget, I'm assuming its possible with a 9.3 Map Service REST endpoint. 

Can anyone help me get this set up?
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks Martyn,

I got the identity tool to give me the values.  However, I noticed that you have it saying "Depth", wheras I just get "Pixel value".  Was wondering how you got the "Depth" to show instead.

Thanks,

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Martyn,

   No that is definitely a bad assumption. The identify widget is capable of because it sends the request to the server and works server side with the identify request. A popup is usually working client side with the featurelayers graphics or a query and or select request (which does go back to the server, but is not going to return a pixel value).
0 Kudos
MartynSmith
Emerging Contributor
Thanks Martyn,

I got the identity tool to give me the values.  However, I noticed that you have it saying "Depth", wheras I just get "Pixel value".  Was wondering how you got the "Depth" to show instead.

Thanks,

R_


In my map document, I did a "build raster attribute table" for the raster, then created a new field called "DEPTH" to which I then just copied the raster default "VALUE" field into.  Hope that helps.
0 Kudos
RhettZufelt
MVP Notable Contributor
Was afraid you were going to say that.

can't build attribute table for 32 bit float.  can't lose my decimals here, so guess I'm going to see Pixel value.

Thanks for the update,

R_
0 Kudos
MartynSmith
Emerging Contributor
Martyn,

   No that is definitely a bad assumption. The identify widget is capable of because it sends the request to the server and works server side with the identify request. A popup is usually working client side with the featurelayers graphics or a query and or select request (which does go back to the server, but is not going to return a pixel value).


Thanks Robert, I'm a flex and AGS newb.  Just stumbling around for now.  Your widget is definitely doing the job for me.  If you can answer a couple more questions from me regarding your widget that would be great: 

(1) Is it possible to remove the line, rectangle and area selection options as choices since only the "Identify by point" applies for a raster?  (2) Is it possible to add a suffix to a field after the identify result, such as a "feet"? (3) Is there any way to use aliases for fields? That would really help to clean up the identify results window

Thanks again
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Martyn,

1) Currently No, not without changing the code.
2) Currently No, not without changing the code.
3) Aliases are pulled from the featureclass or map document automatically when using the Identify task.

If you have the ability to change the code and recompile then just let me know and I will point you to where changes need to be made.
0 Kudos
MartynSmith
Emerging Contributor
Martyn,

1) Currently No, not without changing the code.
2) Currently No, not without changing the code.
3) Aliases are pulled from the featureclass or map document automatically when using the Identify task.

If you have the ability to change the code and recompile then just let me know and I will point you to where changes need to be made.


Robert I do have the ability, have flash builder 4.5.. have the viewer source, and have your widget source.  Not an expert, but I worked with the viewer source to some degree.  Any help you could give me would be great.
0 Kudos