First, you need to use var
in order to introduce new variable into to GEE.
Second, you used getThumbURL
without providing visualization parameters. These include dimension
, region
, and format
of your image. Also you could use extra visualization parameters defined in ee.data.getMapId
.
Third, I suggest using collection 2, Tier 1, level 2 or level 1 since they are Landsat data with the highest quality.
Also, you need to use print
in order to see the link in your GEE console.
Your syntax is not reproducible. Here I provide the one that you can check on your machine.
Last point, there is a function prepSrL8
I used for choosing Landsat scenes based on their quality (QA bands).
var i_date = '1972-07-25'
var f_date ='2022-12-31'
var aoi = ee.Geometry.MultiPoint([
[46.72759630878907,38.171211790897694],
[48.38103869160157,38.171211790897694],
[48.38103869160157,39.25559070083476],
[46.72759630878907,39.25559070083476],
[46.72759630878907,38.171211790897694]
]).bounds()
Map.centerObject(aoi, 8)
Map.addLayer(aoi, {}, 'Area of Interest')
var images = ee.ImageCollection("LANDSAT/LC09/C02/T1_L2")
.map(prepSrL8)
.filterBounds(aoi)
.filterDate(i_date, f_date)
var image = ee.Image(images.first()).clip(aoi); print (image)
Map.addLayer(image.select('SR_B4'),{min: 0, max: 0.25})
var gifParams = {
'region': aoi.buffer(2000).bounds(),
'dimensions': 1024,
'bands': "SR_B4",
'min': 0,
'max': 0.25,
'format': 'jpg'
};
var url = image.getThumbURL(gifParams)
print(url)
function prepSrL8(image) {
// Develop masks for unwanted pixels (fill, cloud, cloud shadow).
var qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);
var saturationMask = image.select('QA_RADSAT').eq(0);
var optical = image.select("SR_B.").multiply(0.0000275).add(-0.2)
var thermal = image.select("ST_B.*").multiply(0.00341802).add(149)
// Approximate 0 to 1 range.
.subtract(270)//.divide(50)
// Replace original bands with scaled bands and apply masks.
return image.addBands(ee.Image.cat(optical, thermal), null, true)
.updateMask(qaMask).updateMask(saturationMask);
}