2

I have managed to publish multiple raster (tiff) under one mosaic dataset as Image Service.

I also manage to use ArcGISImageServiceLayer to load the ImageServer above.

but how do I retrieve a single raster image based on their name?

I tried to set the ImageServiceLayer initialExtent and fullExtent, but ImageServiceLayer always use the Map Extent which always return all the rasters.

I also used "setDefinitionExpression" method in ImageServiceLayer but there is nothing being drawn on the map.

The closest that I manage to do was: 1. use query on ImageServer with Name = '' 2. Get the Extent of the return record 3. Create ImageServiceParameters with Extent in #2 above as value 4. use exportMapImage and pass in ImageServiceParameters in #3 above.

When I check Chrome debugging console, #4 above return the correct image that I want to load.

How do i load the MapImage returned by the method callback into current ImageServiceLayer?

3

There can be multiple approaches for this.

how do I retrieve a single raster image based on their name?

  1. Add time to your data (If possible). In this way you can send the time with your query to get a specific data.

    a. Add a Column of type date in your footprint layer of mosaic dataset.

    b. Add time based on your ease (to differentiate between rasters)

    c. Enable time on image service layer.

    i. Open mosaic dataset properties in ArcCatalog.
    
    ii. Open Defaults tab and set "Use Time" to yes.
    
    iii. Set start time field to your time column
    
    iv. Set Interval value and interval units.
    
    v. Publish your service.
    

    d. You can use time slider with time extent or you can set time extent directly in imageservice layer params.

  2. User Rendering rule and only apply rule to the raster which you want to show. You can set the rendering rule in image service parameters using raster function.

How do i load the MapImage returned by the method callback into current ImageServiceLayer?

You do not have to do this by yourself. API is designed to do this for you. You just follow the above approach and you will get the required image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.