Publishing Image service and raster function

3734
13
07-05-2016 05:46 AM
AndžejMiloš
New Contributor II


I have published a raster as Image service and want to display it on the map using Arcgis api 4.0. Color of pixel should depend on raster cell value, exactly as in this example: ImageryLayer - Set a client side pixel filter | ArcGIS API for JavaScript 4.0

Image service is published here: AISData/CONTAINER_2013_04_test (ImageServer) and it has

Min Values: 0

Max Values: 421

But when I replace Image service with mine in example's source code I get values between 0 and 255. And I get 3 bands when expected to get 1 with pixel values.

I guess this issue regards this example description: "Setting the rendering rule to the None raster function gives the user the ability to get the actual value of the pixel (the sea temperature) without it being altered by another raster function or rendering rule."

I also guess that None raster function is not available in my Image service, because I receive javascript Error:

ImageLayerView2D.js:6 Error: {"error":{"code":400,"message":"Unable to complete operation.","details":["Do not allow execution of client function."]}}

    at Error (native)

    at .<anonymous> (http://js.arcgis.com/4.0/esri/layers/support/Raster.js:6:218)

    at f (https://js.arcgis.com/4.0/init.js:150:21)

    at p (https://js.arcgis.com/4.0/init.js:149:331)

    at resolve.callback (https://js.arcgis.com/4.0/init.js:151:151)

    at https://js.arcgis.com/4.0/init.js:325:198

    at e (https://js.arcgis.com/4.0/init.js:153:423)

    at f (https://js.arcgis.com/4.0/init.js:153:349)

    at b.resolve (https://js.arcgis.com/4.0/init.js:155:406)

    at c (https://js.arcgis.com/4.0/init.js:154:287)

How can I solve this issue?

Tags (1)
0 Kudos
13 Replies
FC_Basson
MVP Regular Contributor

Yes in that case a mosaic published as an Image Service is the only option if you want to apply raster functions.

0 Kudos
AndžejMiloš
New Contributor II

Thank you for your help.

Then I skip requirement 3 and try to implement 1 and 2 with Mapservice as you suggested.

With version of JSAPI 3 I used ArcGISDynamicMapServiceLayer to display Mapservice. Should I use MapImageLayer to use Identify task in version 4?

0 Kudos
FC_Basson
MVP Regular Contributor

Yes that should work for 4.0.  The pixel value is returned as field "Pixel Value".

0 Kudos
AndžejMiloš
New Contributor II

Pixel Identification on MapImageLayer works. Thank you.

0 Kudos