Hello, currently I am using sentinel hub’s process request for fetching all bands and using them in my API.
The request that I am sending is the following:
# Variables for the request
crs = "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
query = "?useCache=true&retries=5"
url = "https://services.sentinel-hub.com/api/v1/process" + query
# this returns the width and the height of the bbox
w_h = self.get_width_height(geometry)
width = int(w_h[0])
height = int(w_h[1])
# Request
response = requests.post(
url,
headers={"Authorization": "Bearer {}".format(token)},
json={
"input": {
"bounds": {
"properties": {
"crs": crs
},
"geometry": geometry,
},
"data": [
{
"type": "S2L2A",
"dataFilter": {
"timeRange":
{
"from": start,
"to": end
}
},
}
],
},
"output": {
"width": width,
"height": height,
"responses": [
{
"identifier": "default",
"format": {
"type": "image/tiff"
}
}
],
},
"evalscript": """
//VERSION=3
function setup() {
return {
input: [{
bands: ["B01", "B02", "B03", "B04", \
"B05", "B06", "B07", "B08", "B8A", \
"B09", "B11", "B12"],
units: "DN" }],
output: {
id: "default",
bands: 12,
sampleType: SampleType.UINT16
}
}
}
function evaluatePixel(sample) {
return [ sample.B01, sample.B02, sample.B03, \
sample.B04, sample.B05, sample.B06, sample.B07, \
sample.B08, sample.B8A, sample.B09, \
sample.B11, sample.B12]
}
""",
},
)
return response.content
The problem here is, in some days when I use the geojson of the area that I want to fetch the data, it works fine. But some days, the sentinel api requires the reversed geojson (replace lats with lngs and lngs with lats) in order to work properly, if i do not reverse the geojson it gives me data of a different area.
For example:
I chose this area, but sentinel gives me a reverse of it like the following:
And some days it works fine.
I would be thankful if you helped me.
Best regards