Skip to main content

TIFF files for different regions contain different number of bands

  • April 17, 2024
  • 4 replies
  • 0 views

I have an instance configured in the SentinelHub dashboard for requesting Sentinel-2 bands, each layer is one band. I request these as TIFF files using the WcsRequest object in the sentinelhub-py Python package. I have used it for various regions and it has always previously returned TIFF files containing a single band, where the values are the reflectance values.

Here is an example request:

req = WcsRequest(
  instance_id=INSTANCE_ID,
  layer='B04',
  bbox=BBox(bbox=[73.187, 34.390, 73.208, 34.415], crs=CRS.WGS84),
  data_folder='sentinelhubtest',
  resx='10m',
  resy='10m',
  data_source=DataSource.SENTINEL2_L1C,
  image_format=MimeType.TIFF_d32f,
  time='2018-12-27',
  time_difference=datetime.timedelta(hours=2)
)

Here is the corresponding URL that the request is being made to, according to the file written by the Python package (when I use version 3 of the Python package):
https://services.sentinel-hub.com/ogc/wcs/INSTANCE_ID?SERVICE=wcs&MAXCC=100.0&BBOX=34.39%2C73.187%2C34.415%2C73.208&FORMAT=image%2Ftiff%3Bdepth%3D32f&CRS=EPSG%3A4326&TIME=2018-12-27T03%3A59%3A20%2F2018-12-27T07%3A59%3A20&RESX=10m&RESY=10m&COVERAGE=B04&REQUEST=GetCoverage&VERSION=1.1.2
(I have replaced my instance ID with “INSTANCE_ID”.)

However, I just tried to download an image for a different region, and the TIFF files for this region each contain 3 bands instead of 1. The parameters I’m passing to the WcsRequest are exactly the same except for the bounding box (the new bounding box is BBox(bbox=[-78.2, 35.4, -77.7, 35.9], crs=CRS.WGS84)), and the URL parameters that it produces are exactly the same except for the bounding box and the image timestamp.

This difference in the TIFF file format happens when I use sentinelhub-py version 3.0.0 as well as when I use version 2.6.1.

What might be causing this?

4 replies

Hi @akenney,

I managed to reproduce your issue. We’ll look at it and let you know more shortly.


In the newly released version sentinelhub-py 3.0.2 we added an additional parameter that is being sent to the service. Therefore in 3.0.2 you will get back an error informing you about a request size instead of a 3-channel image.


Ohh, okay. Thank you for figuring it out and explaining!


It turns out your second bounding box was too large. The returned image would have size 4519 x 5561, which is more than service limit 5000x5000.

In the next release of sentinelhub-py we will make sure that a response of such request will be an error message instead of a 3-channel image. For now you can achieve the same thing by turning “Show warnings” flags off for your configuration in Sentinel Hub Configurator.