Definition of nodata-value in WCS-Request


#1

Hi Sinergise,

while using your WCS-request via Python to produce NDVI images, I got an image at an orbit boundary, as you can see in the images I attached. However, the nodata-value is 1, which is similar to the maximum possible NDVI.

I was wondering, if it is possible to define the nodata values either in the JS-code of the layer (within the WMS-Configurator) or within the Python-WCS-Request as a parameter.

Greetings,
Johannes

image%20(1) image


#2

Could you share URL of this request (without instance ID) so that we could “debug” it better.
Generally no data values are 0, e.g. B01=0, B02=0,… So you could catch this in the script e.g.
if (B04==0) return [0,0,0]; (or similar)
I am guessing (but not sure) that you get 1 due to division with 0.


#3

Hi @gmilcinski ,
thank you for the fast answer!
The request is the following:

https://services.sentinel-hub.com/ogc/wcs/INSTANCE_ID?SERVICE=wcs&REQUEST=GetCoverage&VERSION=1.3.0&COVERAGE=NDVI&BBOX=614641.6993672735%2C5752378.298124972%2C618093.1355100481%2C5756542.893842303&CRS=EPSG%3A32631&MAXCC=100.0&RESY=10m&TIME=2018-04-18T10%3A45%3A12%2F2018-04-18T10%3A45%3A12&RESX=10m&FORMAT=image%2Ftiff%3Bdepth%3D32f

By the way, if I download a single band, the nodata value seems to be 1 as well.

Kind regards,
Johannes


#4

I see. This is a consequence of a (not really best) default of OGC standard, which states, that if no TRANSPARENT parameter is provided, no-data pixels are provided as white, therefore resulting in 1.
So to fix this issue, you should set TRANSPARENT=true in the WCS call.
@maleksandrov - it might be good to consider to implement this behaviour in sentinelhub-py by default?

A side note - we are now working on a proprietary API, which will expose satellite data without all these OGC constraints. This will probably solve most of these issues…


#5

is this related to the EO-Learn Library? :slight_smile:


#6

No, this is a parallel development of our core services. We are developing a POST based API, which will act as an interface for advanced users. It will not have any OGC-specific defaults and it will make it possible to query geometry of any size (current API is limited to number of chars in the URL).

eo-learn and sentinelhub-py libraries will be then upgraded to work with this API rather than going through OGC.


#7

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?


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

This is not possible. The script needs to return some value.