Skip to main content

Hi guys, I’m having an issue in getting data through the process API

the issue is that I always get a black picture (no matter which format I use, png, tiff)

the weirdest thing is that if I use positive latitudes and longitudes (hemisphere North/East), it works like a charm, the moment I query a region that requires negative latitudes and/or longitudes, the black dots response comes back with status=200.


Using POSTMAN :


end point: https://services.sentinel-hub.com/api/v1/process

HEADER

Accept : image/tiff


my reques is as follow:


{

“input”: {

“bounds”: {

“properties”: {

“crs”: “http://www.opengis.net/def/crs/OGC/1.3/CRS84

},

“bbox”: ,

-31.942244,

-63.414089,

-31.424924,

-63.069441

]

},

“data”: /

{

“type”: “S2L2A”,

“dataFilter”: {

“timeRange”: {

“from”: “2019-02-23T00:00:00Z”,

“to”: “2019-02-25T00:00:00Z”

}

}

}

]

},

“output”: {

“width”: 512,

“height”: 512

}

}


the evalscript is this:


// VERSION=3

function setup() {

return {

input: =“B02”, “B03”, “B04”],

output: { bands: 3 }

}

}


function evaluatePixel(sample) {

return r2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02]

}


if I use the same request with the default coordinates it works fine and i can actually download the image in TIFF format.

the original coordinates that work are:

13.822174072265625,

45.85080395917834,

14.55963134765625,

46.29191774991382

I am guessing that the area where you are looking for data is an ocean and therefore has none.


Try changing the order of coordinates to

-63.414089,

-31.942244,

-63.069441,

-31.424924,

(or similarly).


It should be lon,lat,lon,lat.


I did, I’ve tried several places and also flipping the lat,lon pair in the coordinates without success I’ve also tried polygons rather than bbox , even though in the posted example I’m using bbox


as an example:

this is a region in France(I get the proper values)

45.348645,1.666404,45.371700,1.759612

as you can see the pairs for the bbox are lat1,lon1, lat2,lon2 (same as in my example for south america)


Hi hbalussi,


switching a coordinate order from lat, lon to lon, lat worked for me (my request below).


A coordinate order, which should be used for a request, depends on the definition of coordinate reference system (crs), which is also sent as a parameter in a request. In your example the crs definition “http://www.opengis.net/def/crs/OGC/1.3/CRS84” is used thus coordinate order must be lon, lat. We will add a not to documentation to make this more obvious. Thank you for pointing it out.


My request:


curl -X POST \
https://services.sentinel-hub.com/api/v1/process \
-H 'Authorization: <your access token> \
-F 'request={
"input": {
"bounds": {
"properties": {
"crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
},
"bbox": x
-63.414089,
-31.942244,
-63.069441,
-31.424924
]
},
"data": a
{
"type": "S2L2A",
"dataFilter": {
"timeRange": {
"from": "2019-02-23T00:00:00Z",
"to": "2019-02-26T00:00:00Z"
}
}
}
]
},
"output": {
"width": 512,
"height": 512
}
}
' \
-F 'evalscript=// VERSION=3
function setup() {
return {
input: u"B02", "B03", "B04"],
output: { bands: 3 }
}
}

function evaluatePixel(sample) {
return u2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02]
}'

Reply