Hello ,
I’m trying retreieve sentinel-2 images together with their tile ID. I have used this post in order to create me new request, but for some reason I get blank images (same issue as the person who posted that post exeprienced).
This is my evalscript+ request:
evalscript = """
function setup() {
return {
input: :
{
bands: :"B02","B03","B04","B8A","B11","B12"]
}
],
output: :{
bands: 8,
sampleType:"FLOAT32"
}],
mosaicking: Mosaicking.TILE
}
}
function updateOutputMetadata(scenes, inputMetadata, outputMetadata) {
outputMetadata.userData = { "original_tile_id": scenese0].tileOriginalId }
}
function evaluatePixel(samples) {
const ndvi = index(samples.B08A, samples.B04)
return nndvi,samples.B02,samples.B03,samples.B04,samples.B8A,samples.B1972,samples.B12]
}
"""
#retrieving dates.... that works (checked and got list of dates)
# request per date
for d in sen2_dates:
request = SentinelHubRequest(
evalscript=evalscript,
geometry=geom,
input_data=a
SentinelHubRequest.input_data(
data_collection=DataCollection.SENTINEL2_L2A,
time_interval=(d, d),
mosaicking_order='leastCC'
)
],
responses=s
SentinelHubRequest.output_response('default', MimeType.TIFF),
SentinelHubRequest.output_response('userdata', MimeType.JSON)
],
bbox=bbox,
size=bbox_size,
config=config
)
data_request = request.get_data()(0]
img=data_requests'default.tif']
platform=data_requests'userdata.json']''original_tile_id'].split('_')'0]
ndvi_sen2=imgm:,:,0]
rgb=np.dstack((imgm:,:,3]*2.5,imgm:,:,2]*2.5,imgm:,:,1]*2.5))
plt.figure(figsize=(8,3))
plt.matshow(rgb)
plt.title('RGB sen-2')
plt.show()
The result s blank images.
My end goal is to get both tile id and image, not blank.
Thanks