Select to view content in your preferred language

Identify Pixel Value on Time Based Image Service?

780
3
01-06-2011 03:23 PM
RyanCoodey
Frequent Contributor
I have an Image Service (Mosaic Dataset being served) that shows changes over time.  I got the time slider working but I am not able to use the ImageServiceIdentifyTask to get the pixel value of only the currently visible raster in the dataset (the one that is visible at that point in time).  I currently get values returned for ALL of the rasters in the catalog and don't know which is from the visible one.

args.Results.CatalogItemVisibilities has only one raster set to 1.0, the others all 0.0... but it is always the one at index 0, so that doesn???t help me find the right value in args.Results.Properties["Values"].

I see a few things I could do but not sure exactly how:
1) Set a MosaicRule in the ImageServiceIdentifyParameters and set the FIDs list to only contain the FID of the currently visible raster... but how might I get this FID?
2) Set a MosaicRule in the ImageServiceIdentifyParameters and set the Where property to something like: "start_date_field >= map.TimeExtent.Start and end_date_field <= map.TimeExtent.End"... but how to I dynamically get the fields that are used for "x_date_field"?

I like number 1 best, but not sure how to get info (namely FID) about what raster is currently visible based on the current time.

Any ideas would be great!

Thanks a lot!!!
0 Kudos
3 Replies
ChristopherHill
Deactivated User
Hello,

Thanks for your post. I was looking into this and found that currently ArcGIS Server 10 REST service does not have support for a time parameter for the Identify method and that they are aware of this and it is on the road map for a future release. A possible workaround would be to pass the the time as a where clause. You mentioned that you are using the time slider. you could on map click grab the the current start and end dates from the time slider and pass them in the where clause. if you need to dynamically find the date fields, i would display all date fields to the user and allow them to select the filed on the UI since there is no way to do this in the code behind.

Thanks,

.Chris
0 Kudos
RyanCoodey
Frequent Contributor
Chris,

Thanks a lot for the reply and confirming there is no TimeExtent parameter.  I might just have to hold off on this functionality until the upgrade comes or actually, what I will probably just do is hard-code what the date fields should be (for now).  Presenting all the date fields to some of our users might be quite confusing.

Thanks a lot!  I look forward to this feature!
0 Kudos
RyanCoodey
Frequent Contributor
I ended up just doing a QueryTask on the image service and that does support a TimeExtent, so then I get back the features and their attribute collection has the ObjectIDs...

                QueryTask queryTask = new QueryTask(AsyncIdentifyItems[0].Url);
                Query query = new Query();
                query.TimeExtent = IdentifiedMap.TimeExtent;
                query.OutFields.Add("*");
                FeatureSet featureSet = queryTask.Execute(query);
                MosaicRule mosaicRule = new MosaicRule();
                if (featureSet != null && featureSet.Features.Count > 0)
                {
                    List<Int32> fids = new List<Int32>();
                    foreach (Graphic graphic in featureSet.Features)
                    {
                        fids.Add(Convert.ToInt32(graphic.Attributes[featureSet.ObjectIdFieldName]));
                    }
                    mosaicRule.FIDs = fids.ToArray();
                }
                ImageServiceIdentifyParameters.MosaicRule = mosaicRule;


Hope that helps someone else until the identify supports the TimeExtent.

Unfortunatly now I have a new problem in that the identify operation does not seem to support the mosaics transformations, i made a new post in the REST forum: http://forums.arcgis.com/threads/20948-Image-Service-Identify-Not-Obeying-Transformations

Thanks again for the help!
0 Kudos