Examples for Pleiades
To request data using any of the request below, you will need to replace the string <your access token>
with your Sentinel Hub access token. Sentinel Hub access token can be obtained as described in the Authentication chapter. It will look something like this:
ayJhbGciOiJSUzI1NiJ9.ayJzdWIiOiI0MmYwODZjCy1kMzI3LTRlOTMtYWMxNS00ODAwOGFiZjI0YjIiLCJhdWQiOiJlY2I1MGM1Zi1iMWM1LTQ3ZTgtYWE4NC0zZTU4NzJlM2I2MTEiLCJqdGkiOiI5MzYxMWE4ODEyNTM4Y2M0MmU0NDJjYjUyMTY0YmJlNyIsImV4cCI6MTU1NTQyMzk3MiwibmFtZSI6ImFuamEudnJlY2tvQHNpbmVyZ2lzZS5jb20iLCJlbWFpbCI6ImFuamEudnJlY2tvQHNpbmVyZ2lzZS5jb20iLCJzaWQiOiIzZjVjZDVkNS04MjRiLTQ3ZjYtODgwNy0wNDMyNWY4ODQxZmQifQ.U7FPOy_2jlEOFxXSjyN5KEdBROna3-Dyec0feShIbUOY1p9lEXdNaMmR5euiINi2RXDayX9Kr47CuSTsvq1zHFvZs1YgkFr1iH6kDuX-t_-wfWpqu5oPjoPVKZ4Rj0Ms_dxAUTQFTXR0rlbLuO-KSgnaeLVb5iiv_qY3Ctq2XKdIRcFRQLFziFcP4yZJl-NZMlwzsiiwjakcpYpI5jSYAdU2hpZLHRzceseeZt5YfZOe5Px1kZXro9Nd0L2GPC-qzOXw_V1saMGFa2ov8qV6Dvk92iv2SDDdGhOdII_JOf8XkK4E3g2z0EEFdWhG9F4Iky4ukNsqBPgE8LRb31s0hg
A Postman collection with examples can be downloaded here. Our Postman collections are deprecated and are not being updated since July 2022.
When your Pleiades data is imported into Sentinel Hub using our Third Party Data Import API, you will receive the collection ID, with which you need to replace the collection ID 934273b4-ffe6-464f-ac83-e49b58154e93
used in the examples in "type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93"
. You will also need to adjust the values of bounds and timeRange parameters, so that they correspond to your data.
True color
The following example of Pleiades data returns a true color image. The bands are divided by 10000 to convert them to reflectance, and multiplied by 2.5 to increase the brightness.
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/EPSG/0/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93","dataFilter": {"timeRange": {"from": "2017-09-01T00:00:00Z","to": "2017-09-28T00:00:00Z"}}}]},"output": {"width": 512,"height": 512}}' \-F 'evalscript=//VERSION=3function setup() {return {input: [{"bands": ["B0", "B1", "B2"]}],output: { bands: 3}}}function evaluatePixel(sample) {return [2.5 * sample.B2 / 10000,2.5 * sample.B1 / 10000,2.5 * sample.B0 / 10000]}'
True color, full 2 meter resolution
The following example of Pleiades data returns a true color image in full 2 meter resolution. The bands are divided by 10000 to convert them to reflectance, and multiplied by 2.5 to increase the brightness.
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/EPSG/0/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93","dataFilter": {"timeRange": {"from": "2017-09-01T00:00:00Z","to": "2017-09-28T00:00:00Z"}}}]},"output": {"resx": 2,"resy": 2}}' \-F 'evalscript=//VERSION=3function setup() {return {input: [{"bands": ["B0", "B1", "B2"]}],output: { bands: 3}}}function evaluatePixel(sample) {return [2.5 * sample.B2 / 10000,2.5 * sample.B1 / 10000,2.5 * sample.B0 / 10000]}'
True color, pan-sharpened
Pan-sharpening is a technique which combines a high-resolution panchromatic band with multispectral bands to obtain a colorful high-resolution image. Different algorithms exist and some can be translated into Sentinel Hub evalscript. The script below gives a good true color visualization for Pleaiades data.
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/EPSG/0/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93","dataFilter": {"timeRange": {"from": "2017-09-01T00:00:00Z","to": "2017-09-28T00:00:00Z"}}}]},"output": {"width": 512,"height": 512}}' \-F 'evalscript=//VERSION=3function setup() {return {input: ["B0", "B1", "B2", "PAN"],output: { bands: 3 }}}function evaluatePixel(samples) {let sudoPanW = (samples.B0 + samples.B1 + samples.B2) / 3let ratioW = samples.PAN / sudoPanWlet red = 2.5 * samples.B2 * ratioWlet green = 2.5 * samples.B1 * ratioWlet blue = 2.5 * samples.B0 * ratioWreturn [red/10000, green/10000, blue/10000]}'
True color, pan-sharpened, full 0.5 meter resolution
Pan-sharpening is a technique which combines a high-resolution panchromatic band with multispectral bands to obtain a colorful high-resolution image. Different algorithms exist and some can be translated into Sentinel Hub evalscript. The script below gives a good true color visualization for Pleaiades data in full 0.5 meter resolution.
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/EPSG/0/32633"},"bbox": [562968.79,5173021.20,563497.05,5173518.90]},"data": [{"type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93","dataFilter": {"timeRange": {"from": "2017-09-01T00:00:00Z","to": "2017-09-28T00:00:00Z"}}}]},"output": {"resx": 0.5,"resy": 0.5}}' \-F 'evalscript=//VERSION=3function setup() {return {input: ["B0", "B1", "B2", "PAN"],output: { bands: 3 }}}function evaluatePixel(samples) {let sudoPanW = (samples.B0 + samples.B1 + samples.B2) / 3let ratioW = samples.PAN / sudoPanWlet red = 2.5 * samples.B2 * ratioWlet green = 2.5 * samples.B1 * ratioWlet blue = 2.5 * samples.B0 * ratioWreturn [red/10000, green/10000, blue/10000]}'
NDWI visualized using valueInterpolate function
The following example of Pleiades data returns a visualized NDWI, using green and IR bands.
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/EPSG/0/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93","dataFilter": {"timeRange": {"from": "2017-09-01T00:00:00Z","to": "2017-09-28T00:00:00Z"}}}]},"output": {"width": 512,"height": 512,"responses": [{"identifier": "default","format": {"type": "image/png"}}]}}' \-F 'evalscript=//VERSION=3function setup() {return {input: ["B1", "B3", "dataMask"],output: { bands: 4}}}function evaluatePixel(sample) {var NDWI = index (sample.B1, sample.B3)return valueInterpolate (NDWI,[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],[[1, 0, 1, sample.dataMask],[1, 0.5, 0, sample.dataMask],[1, 1, 0, sample.dataMask],[0.2, 1, 0.5, sample.dataMask],[0,0, 1, sample.dataMask],[0, 0, 0.3, sample.dataMask],[0, 0, 0, sample.dataMask],])}'
False color with integer band values stretched to unsigned 16-bit range
In this example we returned a false color composite with NIR, red and green bands. We divided the numbers by 10000 to bring them to reflectance values, and then multiplied them by 65535 to bring them to an unsigned integer 16-bit range. To learn how to use other formats, read the documentation about sampleType.
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/EPSG/0/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-934273b4-ffe6-464f-ac83-e49b58154e93","dataFilter": {"timeRange": {"from": "2017-09-01T00:00:00Z","to": "2017-09-28T00:00:00Z"}}}]},"output": {"width": 512,"height": 512,"responses": [{"identifier": "default","format": {"type": "image/tiff"}}]}}' \-F 'evalscript=//VERSION=3function setup() {return {input: [{bands: ["B1", "B2", "B3"]}],output: {bands: 3,sampleType: "UINT16"}}}function evaluatePixel(sample) {return [sample.B3 / 10000 * 65535,sample.B2 / 10000 * 65535,sample.B1 / 10000 * 65535]}'