Sentinel2 gets black images on some area

Dear all,

I would need your help in solving a problem.

Using your sample code for retrieving true-color images (or NDVI etc.) using Sentinel2 (L1C and/or L2A) , I can usually get a correct PNG image of an area that I query using the Polygon syntax, that I get from the relative geoJSON file.

For some polygonal area requested, the images returned are always black, independently from the period asked – while in your Playground are visible (with the same constellation) and moreover are very near other areas whose images I get without problems.

For instance, the following GeoJSON areas could be always retrieved with Sentinel (1 & 2):

  • {“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“properties”:{“color”:“#3388ff”,“opacity”:1,“fillColor”:null,“fillOpacity”:0.2,“weight”:3,“dashArray”:null},“geometry”:{“type”:“Polygon”,“coordinates”:[[[10.550512,43.32638],[10.551357,43.325414],[10.55291,43.326183],[10.552379,43.327014],[10.550512,43.32638]]]}}]}
  • {“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“properties”:{“color”:“#3388ff”,“opacity”:1,“fillColor”:null,“fillOpacity”:0.2,“weight”:3,“dashArray”:null},“geometry”:{“type”:“Polygon”,“coordinates”:[[[10.582393,43.34299],[10.582259,43.339783],[10.582924,43.33951],[10.583906,43.339432],[10.585032,43.339482],[10.585188,43.340352],[10.584571,43.341398],[10.584356,43.342182],[10.584195,43.342455],[10.582881,43.343076],[10.582393,43.34299]]]}}]}

While the following areas returns always BLACK PNG (and so it is not possible to compute NDVI and other indexes):

  • {“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“properties”:{“color”:“#3388ff”,“opacity”:1,“fillColor”:null,“fillOpacity”:0.2,“weight”:3,“dashArray”:null},“geometry”:{“type”:“Polygon”,“coordinates”:[[[10.608603,43.351045],[10.610052,43.35172],[10.611484,43.354697],[10.611581,43.356054],[10.608094,43.355492],[10.606163,43.352777],[10.607439,43.352372],[10.608603,43.351045]]]}}]}
  • {“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“properties”:{“color”:“#3388ff”,“opacity”:1,“fillColor”:null,“fillOpacity”:0.2,“weight”:3,“dashArray”:null},“geometry”:{“type”:“Polygon”,“coordinates”:[[[16.26513,40.598892],[16.265452,40.599495],[16.265699,40.599413],[16.265731,40.599519],[16.265967,40.599478],[16.265935,40.598875],[16.265956,40.597849],[16.265988,40.597254],[16.26572,40.597303],[16.265441,40.597344],[16.265237,40.597385],[16.265237,40.597784],[16.265259,40.597988],[16.265377,40.598949],[16.265216,40.598892],[16.26513,40.598892]]]}}]}

Could you help me understand where is the problem?

Hi Davide, Please can you provide the code you are using so we can replicate the issue.

Hello,
the code is the C# transposition of your sample code in API documentation, as follows where instead of the bounding box, I use a Polygon descriptor.
The Polygon coordinates are taken from the GeoJSON description above.

The code is taken from Examples for S2L1C (sentinel-hub.com) , first True Color sample code.

As stated in initially, the same code works perfectly on some areas while in very near other returns black areas. Moreover, I have implemented also the catalog request for the images availabilities on that polygon on the same period of the visible ones and the request returns the availabilities (usually on the same dates of the near visible areas).

curl -X POST \
  https://services.sentinel-hub.com/api/v1/process \
  -H 'Authorization: Bearer <your access token>' \
  -F 'request={
    "input": {
        "bounds": {
            "properties": {
                "crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
            },
            "bbox": [
                13.822174072265625,
                45.85080395917834,
                14.55963134765625,
                46.29191774991382
            ]
        },
        "data": [
            {
                "type": "sentinel-2-l1c",
                "dataFilter": {
                    "timeRange": {
                        "from": "2018-10-01T00:00:00Z",
                        "to": "2018-12-31T00:00:00Z"
                    }
                }
            }
        ]
    },
    "output": {
        "width": 512,
        "height": 512
    }
}' \
  -F 'evalscript=//VERSION=3

function setup() {
  return {
    input: ["B02", "B03", "B04"],
    output: {
      bands: 3,
      sampleType: "AUTO" // default value - scales the output values from [0,1] to [0,255].
     }
  }
}

function evaluatePixel(sample) {
  return [2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02]
}'

Hi Davide,

The above example you provided works perfectly. Can you please provide examples where it is not working correctly please.

Yes, as I’ve written before, the code works perfectly on the greatest part of polygons passed (the previous code was sent just for example and with bounding box instead of geometry->polygon->coordinates) but I will write down in the following post the exact failing call.

Hello, checking my code I’ve seen that I missed the correct geometry->polygon->coordinates structure!
Now that I’ve corrected it, now is fully working.
Thanks for your patience and support.
D.

Good to hear that your issue has been solved :+1:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.