Issue with Python request using a SH public collection which is not an existing DataCollection in the SH python package

Hello, I am trying to write a Python request in order to get values from the Global Land Cover public collection.

I tried to adapt an example found in the documentation of the Sentinel Hub Python package which uses digital elevation model data (Example 5: Other Data Collections)

Example 5: Other Data Collections

evalscript_dem = ‘’’
function setup() {
return {
input: [“DEM”],
id: “default”,
bands: 1,
sampleType: SampleType.FLOAT32

function evaluatePixel(sample) {
return [sample.DEM]

dem_request = SentinelHubRequest(
time_interval=(‘2020-06-12’, ‘2020-06-13’),
SentinelHubRequest.output_response(‘default’, MimeType.TIFF)

To adapt the evalscript for, I used an example of custom script which uses Global Land Cover data (Global Land Cover discrete classification map visualisation script).

To adapt the request I have an issue. Global Land Cover is a Sentinel Hub public collection (Sentinel Hub Public Collections) but it is not an existing DataCollection in the Sentinel Hub python package (Data collections — Sentinel Hub 3.3.2 documentation) unlike DataCollection.DEM.

I had a look at creating a BYOC collection (Bring Your Own COG) but I do not understand how to define the Global Land Cover public collection (Global Land Cover - Sentinel Hub Public Collections) to be able to use it in a Python request. I also guess that a Public Collection is different from a personal BYOC collection.

Is there a tutorial for the use of Public Collections which are not existing Datacollections in Python request ? Do you have similar examples of requests on Public Collections ?

Many thanks…


With Sentinel Hub python package you have the option to use exising Datacollections or you can define a new data collection.

In your case, to use Public Collections which are not existing Datacollections, you will need to define a new data collection. See define a new data collection section in the documentation.

Each public collection,for example has Resources details, these are the parameters to define the new data collection , which include a public collection_id, and the access endpoint .

See the example below, how you can define Global Land Cover data collection


Define a new data collection.

    data_collection= DataCollection.define(
        name='Global Land Cover,
        api_id='byoc-f0a97620-0e88-4c1f-a1ac-bb388fabdf2c',  #Type
        catalog_id='f0a97620-0e88-4c1f-a1ac-bb388fabdf2c', # collection_id
        service_url='', # End point

Adapt the request accordingly as you already did. Make sure to specify the data collection you just defined above.

    discrete_classification_evalscript = """

    // This custom script visualises land cover discrete classification map from global land  cover data

    function setup() {
      return {
        input: ["Discrete_Classification_map"],
        output: { 
          bands: 4, 
          sampleType: "AUTO"

    const map = [
      [0, 0x282828],   // No input data available
      [20, 0xffbb22],  // Shrubs
      [30, 0xffff4c],  // Herbaceous vegetation
      [40, 0xf096ff],  // Cultivated and managed vegetation/agriculture (cropland)
      [50, 0xfa0000],  // Urban / built up
      [60, 0xb4b4b4],  //	Bare / sparse vegetation
      [70, 0xf0f0f0],  //	Snow and Ice
      [80, 0x0032c8],  //	Permanent water bodies
      [90, 0x0096a0],  //	Herbaceous wetland
      [100, 0xfae6a0], //	Moss and lichen
      [111, 0x58481f], // Closed forest, evergreen needle leaf
      [112, 0x009900], // Closed forest, evergreen, broad leaf
      [113, 0x70663e], // Closed forest, deciduous needle leaf
      [114, 0x00cc00], //	Closed forest, deciduous broad leaf
      [115, 0x4e751f], // Closed forest, mixed
      [116, 0x007800], // Closed forest, unknown
      [121, 0x666000], //	Open forest, evergreen needle leafs
      [122, 0x8db400], // Open forest, evergreen broad leaf
      [123, 0x8d7400], //	Open forest, deciduous needle leaf
      [124, 0xa0dc00], //	Open forest, deciduous broad leaf
      [125, 0x929900], // Open forest, mixed
      [126, 0x648c00], // Open forest, unknown
      [200, 0x000080]  // Open sea

    const visualizer = new ColorMapVisualizer(map);

    function evaluatePixel(sample) {
      return [visualizer.process(sample.Discrete_Classification_map)[0], visualizer.process(sample.Discrete_Classification_map)[1], visualizer.process(sample.Discrete_Classification_map)[2], sample.Discrete_Classification_map !=255];
    global_land_cover_request = SentinelHubRequest(
    time_interval=(‘2015-01-01’, ‘2015-01-01’),
    SentinelHubRequest.output_response(‘default’, MimeType.TIFF)

This request should now work.

That said, however, we have recently noticed an instability in the CreoDIAS data storage, where the data is stored, which we have reported to their team and is being worked upon. Until it is solved, this sometimes fails, sorry for the inconvenience

but let us know if you encounter any other problems


Hello, I tried to access Discrete_Classification_map data from “Global Land Cover” for 224x224 pixels with 10m resolution around the Paris Orly Airport (FRANCE) with the following parameters :

orly_coords_wgs = [453240.24671832635, 5395766.548067344, 455480.24671832635, 5398006.548067344]
resolution = 10
bbox_coords = BBox(bbox=orly_coords_wgs, crs=“EPSG:32631”)
bbox_size = bbox_to_dimensions(bbox_coords, resolution=resolution)

I ran the request several times and got the following error each time :

500 Server Error: Internal Server Error for url:
Server response: “{“error”:{“status”:500,“reason”:“Internal Server Error”,“message”:“Illegal request to HTTP Status: 403”,“code”:“RENDERER_EXCEPTION”}}”

Then I tried to get CLC and datamask data from “CORINE Land Cover” for the same Orly airport area and using the same method to define this other public collection on the same end point as “Global Land Cover”. The request gave no error message but CLC and datamask are always equal to zero (no data). Finally, I tried with Sentinel-2 L2A 120m Mosaic on the end point instead of Creodias and there is no error message but still no data at all. I do not know if these issues have common origin with the error message above for “Global Land Cover” on the end point.

How can I solve this issue to get “Global Land Cover” data for any area of interest ?

Many thanks…

Hello Phillipe,
apologies also for the late reply,

Unfortunately, since recently endpoint is not stable, therefore sometimes requests fail with the error 403.
CreoDIAS team are trying to resolve the issue, so until it is solved, we are sorry for the inconviniences.

will update once is stable

but should be working normally. If you can post your request that failed here,
It could be possible that the dates you specified, do not have Sentinel-2 L2A 120m Mosaic data.

Hello @PhilippeM

Just for your information endpoint is now stable and you should now be able to download the data without any errrors

we are sorry for inconvinience

1 Like