Request Builder returns a white image

I’m using the Request Builder to check the tiles I uploaded in a BYOC collection. And the response is just blank.

Here is the request review.

curl -X POST https://services.sentinel-hub.com/api/v1/process \
 -H 'Content-Type: application/json' \
 -H 'Authorization: Bearer <your access token>' \
 -d '{
  "input": {
    "bounds": {
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -1.595475,
              9.535525
            ],
            [
              -1.536525,
              9.535525
            ],
            [
              -1.536525,
              9.594475
            ],
            [
              -1.595475,
              9.594475
            ],
            [
              -1.595475,
              9.535525
            ]
          ]
        ]
      }
    },
    "data": [
      {
        "dataFilter": {
          "timeRange": {
            "from": "2023-01-18T00:00:00Z",
            "to": "2023-02-18T23:59:59Z"
          }
        },
        "type": "byoc-227df0dc..."
      }
    ]
  },
  "output": {
    "width": 512,
    "height": 519.173,
    "responses": [
      {
        "identifier": "default",
        "format": {
          "type": "image/jpeg"
        }
      }
    ]
  },
  "evalscript": "return [image]"
}'

And the response.

Any ideas on how to fix it are appreciated. Thank you.

Hello Nguyen Ha,

I would like to ask a few questions about your code to understand the problem better.

  • I do not see your evalscript in the curl request you have provided. So to view the data from your BYOC collection, you will have to elaborate on how you have defined the “image”.

  • Do the dates mentioned in the “timeRange” field fall within the sensing time of your data?

And I have a suggestion, please do not display your Authorization Bearer as it contains your credentials and might be misused.

Because it is your private collection, I cannot have access to the data with just this information. The issue might be that the resolution of your data might match the output resolution of 12.64m in both X and Y axis, but I can only know this if I know the data. Let me know if changing the above details fixed your issue or if you need further help.

1 Like

Hi @nguyenforresearch,

I briefly checked your BYOC collection and the ingested tile is missing the sensing time. If there’s no specific sensing time, you can set an arbitrary one. After that, you just have to make sure your request’s time range parameter encompasses the specified sensing time and the request should run without a problem.

1 Like

Hello, I have set the sensing time of my image to 01 November 2021, 12:00 (UTC), and my time range to be from 2019-01-01 to 2019-12-31. And now I got this black image instead.

  • The “image” is the band name of my tile (which is 1-band).
  • I have fixed the timeRange to match with the sensing time, but it’s still not showing the tile.
  • Thank you for your suggestion and for fixing my post.

Hi @nguyenforresearch ,

If you don’t specify a sampleType for the output, it will default to AUTO, hence Values below 0 and above 1 will be clamped to 0 and 255.

The following curl request works, but requests a GeoTIFF instead of a JPG:

curl -X POST https://services.sentinel-hub.com/api/v1/process \
 -H 'Content-Type: application/json' \
 -H 'Authorization: Bearer <your access token>' \
 -d '{
  "input": {
    "bounds": {
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -1.595475,
              9.535525
            ],
            [
              -1.536525,
              9.535525
            ],
            [
              -1.536525,
              9.594475
            ],
            [
              -1.595475,
              9.594475
            ],
            [
              -1.595475,
              9.535525
            ]
          ]
        ]
      }
    },
    "data": [
      {
        "dataFilter": {
          "timeRange": {
            "from": "2021-11-01T00:00:00Z",
            "to": "2023-02-18T23:59:59Z"
          }
        },
        "type": "byoc-227df0dc-..."
      }
    ]
  },
  "output": {
    "width": 512,
    "height": 519.173,
    "responses": [
      {
        "identifier": "default",
        "format": {
          "type": "image/tiff"
        }
      }
    ]
  },
  "evalscript": "//VERSION=3\nfunction setup() {\n  return {\n    input: [\"image\"],\n    output: { bands: 1 , sampleType: \"UINT16\"}\n  }\n}\n\nfunction evaluatePixel(sample) {\n  return [sample.image]\n}"
}'

If you want to request the image in JPG format, you might lose valuable information. For visualisation purposes, you can apply a factor to the data to make sure the data is mapped in the visible range:

//VERSION=3
function setup() {
  return {
    input: ["image"],
    output: { bands: 1 }
  }
}

function evaluatePixel(sample) {
  return [sample.image/1000]
}

For further information, I recommend you to read my colleague’s blog post on the issue.

2 Likes

I see. Thank you very much. It works now.

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