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.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 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/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"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=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 6 meter resolution
The following example of SPOT data returns a true color image in a full 6 meter resolution. 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/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-57d54a21-09e9-40b7-b837-ff7c78b2b691","dataFilter": {"timeRange": {"from": "2017-01-27T00:00:00Z","to": "2018-04-28T00:00:00Z"}}}]},"output": {"resx": 6,"resy": 6}}' \-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 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/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"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=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 1.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 SPOT data in full 1.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": [562150.34,5172481.37,564214.37,5174058.72]},"data": [{"type": "byoc-57d54a21-09e9-40b7-b837-ff7c78b2b691","dataFilter": {"timeRange": {"from": "2017-01-27T00:00:00Z","to": "2018-04-28T00:00:00Z"}}}]},"output": {"resx": 1.5,"resy": 1.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 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/32633"},"bbox": [562150.34,5172481.37,564214.37,5174058.72]},"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,"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],])}'