After creating an order, you have to confirm it, to actually have it “running”, see the process flow.
After that, you will have to wait some time (typically minutes) for data to become available in Sentinel Hub, then you will be able to retrieve it.
Perhaps worth checking the webinar on this topic:
ok fine!! I confirmed the ordered data, now in the SentinelHub dashboard I can read Status Done in the 3rd Party Data orders import table.
So now I can use the following link:
https://services.sentinel-hub.com/api/v1/process
where I can set collectionId from my collections table, byoc type, the time range and the ROI.
Currently the image is still total black!
What is wrong?
Hi Davide,
The image may appear very dark (almost total black) if you use the default True color script. However, if you try changing the evalscript to an NDVI visualisation like below, you should see your data:
//VERSION=3
function setup() {
return {
input: ["Red", "NIR", "dataMask"],
output: { bands: 4}
}
}
function evaluatePixel(sample) {
var NDVI = index(sample.NIR , sample.Red)
return valueInterpolate(NDVI,
[0.0, 0.3, 1.0],
[
[1, 0, 0, sample.dataMask],
[1, 1, 0, sample.dataMask],
[0.1, 0.3, 0, sample.dataMask],
])
}
For the True Color visualisation you can try multiplying the bands by a number higher than 2.5 if you wish for the image to be brighter. e.g. 5 * sample.Red / 10000
I’m still obtaining total black images instead of true color map, here my python code:
# RGB DATA REQUEST
def rgb():
return '''
function setup() {
return {
input: :{"bands": :"Blue", "Green", "Red"]}],
output: { bands: 3}
}
}
function evaluatePixel(sample) {
return n5 * sample.Red / 10000,
5 * sample.Green / 10000,
5 * sample.Blue / 10000]
}
'''
if response_token:
url = 'https://services.sentinel-hub.com/api/v1/process'
data = {
'input': {
'bounds': {
'properties': {
'crs': 'http://www.opengis.net/def/crs/EPSG/0/32633'
},
'geometry': geometry,
},
'data': :
{
'type': collectionId,
'dataFilter': {
'timeRange': timeRange
}
}
]
},
'output': output,
'evalscript': rgb()
}
I cannot understan the reson why i’m getting total black images. From planet.com dashboard the area is detected correctly.
Now I also have a question, PlanetScope should have about 3 meters resolution, haven’t it? So which is the my image pixel resolution?
Hi, the following should work when using the Python Requests library.
I have included the resolution parameters in this example setting the resolution at 3m resolution for you. Please note the values are in degrees and not metres as the request is currently returning data in WGS84, whose native units of measurement are degrees and not metres.
import requests
url = "https://services.sentinel-hub.com/api/v1/process"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <access_token>"
}
data = {
"input": {
"bounds": {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12.513888887654666,
43.178055600904415
],
[
12.514722220990855,
43.17694440090427
],
[
12.516666665441807,
43.17777780090459
],
[
12.51722222099919,
43.1786111009048
],
[
12.51694444322047,
43.17888890090482
],
[
12.515277776548206,
43.17888890090469
],
[
12.515277776548217,
43.17861110090464
],
[
12.513888887654666,
43.178055600904415
]
]
]
}
},
"data": [
{
"dataFilter": {
"timeRange": {
"from": "2023-09-01T00:00:00Z",
"to": "2023-09-09T23:59:59Z"
}
},
"type": "byoc-8b63ddf2-15b5-4d51-8c6a-9a4363bfb816"
}
]
},
"output": {
"resx": 0.0003,
"resy": 0.0003,
"responses": [
{
"identifier": "default",
"format": {
"type": "image/jpeg"
}
}
]
},
"evalscript": "//VERSION=3\nfunction setup() {\n return {\n input: [\"Blue\", \"Green\", \"Red\"],\n output: { bands: 3}\n }\n}\nfunction evaluatePixel(sample) {\n return [5 * sample.Red / 10000,\n 5 * sample.Green / 10000,\n 5 * sample.Blue / 10000]\n}"
}
response = requests.post(url, headers=headers, json=data)
I recommend testing your scripts in Request Builder, it’s a really neat tool that helps you understand how to build up your Sentinel Hub Requests