Filter returned images from SentinelHub using JS-code in layer configuration


I have fetched some images from SentinelHub which contains no-data values (e.g.[INSTANCE_ID]?SERVICE=wms&BBOX=509485.0%2C6091690.0%2C509765.0%2C6092090.0&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32632&WIDTH=56&HEIGHT=80&LAYERS=TRUE-COLOR&REQUEST=GetMap&TIME=2017-02-22T08%3A40%3A30%2F2017-02-22T12%3A40%3A30&MAXCC=5.0&Downsampling=BILINEAR&Upsampling=BILINEAR&Transparent=False&ShowLogo=False), and I want to configure my SentinelHub layer to not return such images.

Is it possible to define in the JS-code that - if any of the bands contains no-data (i.e. if any pixel contain the value zero) then the data of this date should not be returned?

See the related question 472.

Regard Peter

Additionally, I found that no-data values are stored differently on the Sentinel2 bands. The no-data values are stored as 1 in band 1 to 3 and as 0 (zero) in band 4 to 12, see for example this image[INSTANCE_ID]?SERVICE=wms&BBOX=509485.0%2C6091690.0%2C509765.0%2C6092090.0&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A32632&WIDTH=56&HEIGHT=80&LAYERS=S2-L2A&REQUEST=GetMap&TIME=2017-02-22T08%3A40%3A30%2F2017-02-22T12%3A40%3A30&MAXCC=5.0&Downsampling=BILINEAR&Upsampling=BILINEAR&Transparent=False&ShowLogo=False.

For different no-data values for different bands - are you sure this is not a result of interpolation? You should observe data on natural resolution (depending on each band).

It is currently not possible to “skip” the scenes with nodata values.
You can however do a pre-fetch call using Statistical API as discussed here: