Skip to main content

I am observing that, when trying to download data with a WcsRequest at the following location:


top_left = (23.1570966729984349, 43.6272301263683104)

lower_right = (23.4245862660253366, 43.4903263866232521)


And the following resolution:


resx = ‘2.106364198720723557m’

resy = ‘2.106209045199899155m’


I am receiving nonsensical data. Specifically, the data I receive is a list of 5000x5000x3 arrays of mostly 255 values (all white images with a small number of red pixels). A WmsRequest at the same location does, however, return the correct data. However, the WmsRequest also fails if the width exceeds a certain threshold, with a DownloadExceptionError being raised.


The code for the request is:


target = datetime.datetime.strptime(‘2020-03-31’, ‘%Y-%m-%d’)

start = target - datetime.timedelta(1*365/12)

wcs_request = WcsRequest(

layer=‘BANDS-S2-L2A’,

bbox=bx,

time=(start,target),

resx=‘2.106364198720723557m’,

resy=‘2.106209045199899155m’,

instance_id=INSTANCE_ID,

image_format=MimeType.TIFF_d32f

)


and it provides a URL with instance ID masked of:

‘https://services.sentinel-hub.com/ogc/wcs/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx?SERVICE=wcs&MAXCC=100.0&BBOX=23.157096672998435%2C43.49032638662325%2C23.424586266025337%2C43.62723012636831&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A4326&TIME=2020-03-04T07%3A53%3A10%2F2020-03-04T07%3A53%3A10&RESX=2.106364198720723557m&RESY=2.106209045199899155m&COVERAGE=BANDS-S2-L2A&REQUEST=GetCoverage&VERSION=1.1.2’


Any Advice?

Thanks

Unless you have some particular reason for requesting 2.xx m resolution, could you retry with requesting 10m resolution?


The highest resolution of Sentinel-2 bands is 10m/px. See e.g. this link.


It works with resolutions down to 5m and bellow that the data becomes the garbage data. It works at 2m resolution for other locations. We’re requesting it as that to bring it in line with other imagery for machine learning work rather than us having to do post processing rescaling of the imagery. This question is mostly about figuring out why it breaks down at this point for consistency in pipelines.


Hi James,

just to clarify one issue, not sure if related.

If I convert the WCS call into simple true color, I get almost empty image as well (there is a lot of white space below, so keep reading)


https://services.sentinel-hub.com/ogc/wcs/25491e86-XXXX?SERVICE=wcs&MAXCC=100.0&BBOX=23.157096672998435%2C43.49032638662325%2C23.424586266025337%2C43.62723012636831&FORMAT=image/png&CRS=EPSG%3A4326&TIME=2020-03-04T07%3A53%3A10%2F2020-03-04T07%3A53%3A10&RESX=10m&RESY=10m&COVERAGE=TRUE-COLOR-S2-L2A&REQUEST=GetCoverage&VERSION=1.1.2



This is probably due to TIME parameter being too accurate - you are on the border of two scenes and the one below has different acqusition time. If you change this to date alone, you get:
https://services.sentinel-hub.com/ogc/wcs/25491e86-XXX?SERVICE=wcs&MAXCC=100.0&BBOX=23.157096672998435%2C43.49032638662325%2C23.424586266025337%2C43.62723012636831&FORMAT=image/png&CRS=EPSG%3A4326&TIME=2020-03-04/2020-03-04&RESX=10m&RESY=10m&COVERAGE=TRUE-COLOR-S2-L2A&REQUEST=GetCoverage&VERSION=1.1.2


Now if you add your desired resolution in the call above, you will see this image, which somehow correlates with your initial description of the issue. So you simply need to reduce the size, best under 2000x2000px if you want to avoid issues.


Two more comments on this:

-there is an option to replace such warnings with HTTP error; I think it is already implemented as a default in latest version of sentinelhub-py

-sometimes it is good to have a visual inspection of the data you are trying to use, makes things much clearer


Reply