Select to view content in your preferred language

Raster identify (pixel value) with viewer for flex

6963
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
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   This is what I have working for 10.1 Raster:

        <layer>
            <name>Soils</name>
            <id>0</id>
            <url>http://gislap183/arcgis/rest/services/RasterIdentify/MapServer</url>
            <fields>
                <field name="MUSYM" />
            </fields>
            <links>
                <link includeinresults="false" field="" alias=""
                    tooltip="">
                    <linkprefix />
                    <linksuffix />
                    <iconfield />
                    <iconprefix />
                    <iconsuffix />
                </link>
            </links>
            <zoomscale>15000</zoomscale>
            <forcescale>true</forcescale>
        </layer>

Where if I look in my mxd that has the raster and go to it's layer properties and then to the fields tab it lists:
[TABLE="class: grid"]Name
Type
Length
Percision
Scale
Value
Long
4
0
0
Count
Double
8
0
0
MUSYM
String
8
0
0

[/TABLE]
0 Kudos
RhettZufelt
MVP Notable Contributor
Well, that could be my issue then, as my raster data is floating point, so has no attribute table and thus no Fields tab.

Weird that it works with the 10.0 service, but not 10.1....

However, both services report the same thing if I identify with ArcMap.

[ATTACH=CONFIG]22853[/ATTACH]

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Catch the http traffic in Fiddler and see what server 10.1 is returning for the raster field name when you identify that raster with the only these as false.
0 Kudos
RhettZufelt
MVP Notable Contributor
{"results":[{"layerId":0,"layerName":"Elevation","value":"152.869995","displayFieldName":"","attributes":{"Class value":"1","Pixel Value":"152.869995"},"geometryType":"esriGeometryPoint","geometry":{"x":574551.584524985,"y":147006.98256411,"spatialReference":{"wkid":32149}}}]}

Is this the string you were looking for?

I've tried value, and Pixel Value, and pixel value so far with no luck.

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
Sorry Robert,

Brain fart on my end. 

Turns out I had identifylayeroption=visible, but was fogetting to change the elevation layer in my main config to the 10.1 version.

Now that it is actually "visible" in my map, it appears to be honoring it, even with onlythese=true and is accepting "Pixel Value" as the field.

R_

Also, this version plays nicely with the ElevationProfileWidget.  Still have to close it to get the draw tool back to Identify, but no longer get the null value errors if I try to use identify after running the profile widget.

Funny how it works the way you tell it to 🙂
0 Kudos
LeonardoAraújo
Deactivated User
This was also my mistake. Initially I had only one image service published and was trying to identify the pixels of this service. Then I saw that I had to publish a map service for the raster files, but had left the service image in main config file and was using the map service only in Identify widget. Now set up the map service in the main config file and it worked perfectly.

Thanks a lot.
0 Kudos