Examples for SPOT

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.ayJzdWIiOiI0MmYwODZjCy1kMzI3LTRlOTMtYWMxNS00ODAwOGFiZjI0YjIiLCJhdWQiOiJlY2I1MGM1Zi1i
MWM1LTQ3ZTgtYWE4NC0zZTU4NzJlM2I2MTEiLCJqdGkiOiI5MzYxMWE4ODEyNTM4Y2M0MmU0NDJjYjUyMTY0YmJlNyIsImV4cCI6MTU1N
TQyMzk3MiwibmFtZSI6ImFuamEudnJlY2tvQHNpbmVyZ2lzZS5jb20iLCJlbWFpbCI6ImFuamEudnJlY2tvQHNpbmVyZ2lzZS5jb20iLC
JzaWQiOiIzZjVjZDVkNS04MjRiLTQ3ZjYtODgwNy0wNDMyNWY4ODQxZmQifQ.U7FPOy_2jlEOFxXSjyN5KEdBROna3-Dyec0feShIbUOY
1p9lEXdNaMmR5euiINi2RXDayX9Kr47CuSTsvq1zHFvZs1YgkFr1iH6kDuX-t_-wfWpqu5oPjoPVKZ4Rj0Ms_dxAUTQFTXR0rlbLuO-KS
gnaeLVb5iiv_qY3Ctq2XKdIRcFRQLFziFcP4yZJl-NZMlwzsiiwjakcpYpI5jSYAdU2hpZLHRzceseeZt5YfZOe5Px1kZXro9Nd0L2GPC
-qzOXw_V1saMGFa2ov8qV6Dvk92iv2SDDdGhOdII_JOf8XkK4E3g2z0EEFdWhG9F4Iky4ukNsqBPgE8LRb31s0hg

A Postman collection with examples can be downloaded here.

When your SPOT 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 57d54a21-09e9-40b7-b837-ff7c78b2b691 used in the examples in "type": "byoc-57d54a21-09e9-40b7-b837-ff7c78b2b691". 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 SPOT data returns a true color image. The band values are divided by 10000 to bring them to reflectance values 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/4326"
},
"bbox": [
15.813,
46.703,
15.840,
46.717
]
},
"data": [
{
"type": "byoc-57d54a21-09e9-40b7-b837-ff7c78b2b691",
"dataFilter": {
"timeRange": {
"from": "2017-01-27T00:00:00Z",
"to": "2018-04-28T00:00:00Z"
}
}
}
]
},
"output": {
"width": 512,
"height": 512
}
}' \
-F 'evalscript=//VERSION=3
function 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 SPOT 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/4326"
},
"bbox": [
15.813,
46.703,
15.840,
46.717
]
},
"data": [
{
"type": "byoc-57d54a21-09e9-40b7-b837-ff7c78b2b691",
"dataFilter": {
"timeRange": {
"from": "2017-01-27T00:00:00Z",
"to": "2018-04-28T00:00:00Z"
}
}
}
]
},
"output": {
"width": 512,
"height": 512
}
}' \
-F 'evalscript=//VERSION=3
function setup() {
return {
input: ["B0", "B1", "B2", "PAN"],
output: { bands: 3 }
}
}
function evaluatePixel(samples) {
let sudoPanW = (samples.B0 + samples.B1 + samples.B2) / 3
let ratioW = samples.PAN / sudoPanW
let red = 2.5 * samples.B2 * ratioW
let green = 2.5 * samples.B1 * ratioW
let blue = 2.5 * samples.B0 * ratioW
return [red/10000, green/10000, blue/10000]
}'

NDWI visualized using valueInterpolate function

The following example of SPOT 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/4326"
},
"bbox": [
15.813,
46.703,
15.840,
46.717
]
},
"data": [
{
"type": "byoc-57d54a21-09e9-40b7-b837-ff7c78b2b691",
"dataFilter": {
"timeRange": {
"from": "2017-01-27T00:00:00Z",
"to": "2018-04-28T00:00:00Z"
}
}
}
]
},
"output": {
"width": 512,
"height": 512
}
}' \
-F 'evalscript=//VERSION=3
function setup() {
return {
input: ["B1", "B3"],
output: { bands: 3}
}
}
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],
[1,0.5, 0],
[1,1, 0],
[0.2,1,0.5],
[0,0,1],
[0,0,0.3],
[0,0,0],
])
}'