i am using processAPI to get all the acquisition dates given a certain time series and given that the satellite mission is sentinel-2-l2a
i have the following request and the evalscript ES_AcquisitionDates.
Why i can not retrieve the acquisiton dates?
const req = {
"input": {
"bounds": {
"geometry": coordsInEPSG3857,
"properties": {
"crs": "http://www.opengis.net/def/crs/EPSG/0/3857"
}
},
"data": [
{
"dataFilter": {
"timeRange": {
"from": sYear + "-" + sMonth + "-" + sDay + "T" + sHour + ":00:00Z",
"to": eYear + "-" + eMonth + "-" + eDay + "T" + eHour + ":00:00Z"
},
},
"type": satMissionType
}
]
},
"output": {
"responses": [
{
"identifier": "userdata",
"format": {
"type": "application/json",
},
},
]
},
"evalscript": ES_AcquisitionDates(mosaickingType),
};
ES_AcquisitionDates
function setup() {
return {
input: [],
output: [],
mosaicking: Mosaicking.${mosaickingType}
}
}
function updateOutputMetadata(scenes, inputMetadata, outputMetadata) {
if (scenes) {
if (scenes.tiles) {
if (scenes.tiles.length > 0) {
let acquisitionDates = [];
for (let i = 0; i < scenes.tiles.length; i++) {
acquisitionDates.push(scenes.tiles[i].date)
}
outputMetadata.userData = { metadata: JSON.stringify(acquisitionDates) };
} else {
outputMetadata.userData = { metadata: "No tiles data available." };
}
} else {
outputMetadata.userData = { metadata: "No tiles available." };
}
} else {
outputMetadata.userData = { metadata: "No scenes are available." };
}
}`