I have the coding in GEE "var SHP =…
- User
I have the coding in GEE "var SHP = ee.FeatureCollection("users/kokohdwikolistanto/pulau_jawa"); Map.centerObject(SHP, 7); print('Area (km²)', SHP.geometry().area().divide(1e6));
// Impor data var lst = ee.ImageCollection("MODIS/061/MOD11A1"); var startYear = 2002; var endYear = 2021; var startDate = ee.Date.fromYMD(startYear, 1, 1); var endDate = ee.Date.fromYMD(endYear, 12, 31);
var filtered = lst .filter(ee.Filter.date(startDate, endDate)) .select('LST_Day_1km') .map(function(image){return image.clip(SHP)});
// Konversi Kelvin ke Celcius var modLSTc = filtered.map(function(img) { return img .multiply(0.02) .subtract(273.15) .copyProperties(img, ['system:time_start']); });
// List Tahun dan Bulan var years = ee.List.sequence(2002, 2021); var months = ee.List.sequence(1, 12);
// List Tiap Periode var djf03 = modLSTc.filter(ee.Filter.date('2002-12-01', '2003-02-28'));
// Buat koleksi data rata-rata bulanan var monthlyImages = years.map(function(year) { return months.map(function(month) { var filtered = modLSTc .filter(ee.Filter.calendarRange(year, year, 'year')) .filter(ee.Filter.calendarRange(month, month, 'month')); var monthly = filtered.mean(); return monthly .set({'month': month, 'year': year}) .set('system:time_start', ee.Date.fromYMD(year, month, 1)); }); }).flatten(); var monthlyCol = ee.ImageCollection.fromImages(monthlyImages);
// Buat data minimum multiyear var monthlyMinImages = months.map(function(month) { var filtered = monthlyCol.filter(ee.Filter.eq('month', month)); var monthlyMin = filtered.min(); return monthlyMin.set('month', month); }); var monthlyMin = ee.ImageCollection.fromImages(monthlyMinImages);
// Buat data minimum multiyear var monthlyMaxImages = months.map(function(month) { var filtered = monthlyCol.filter(ee.Filter.eq('month', month)); var monthlyMax = filtered.max(); return monthlyMax.set('month', month); }); var monthlyMax = ee.ImageCollection.fromImages(monthlyMaxImages);
//Ubah ke bentuk List var monthlyColList = monthlyCol.toList(monthlyCol.size()); var monthlyMinList = monthlyMin.toList(monthlyMin.size()); var monthlyMaxList = monthlyMax.toList(monthlyMax.size());
//Setiap nilai di Monthly Min dan Monthly Max var janMin = monthlyMinList.get(0); var febMin = monthlyMinList.get(1); var marMin = monthlyMinList.get(2); var aprMin = monthlyMinList.get(3); var meiMin = monthlyMinList.get(4); var junMin = monthlyMinList.get(5); var julMin = monthlyMinList.get(6); var aguMin = monthlyMinList.get(7); var sepMin = monthlyMinList.get(8); var oktMin = monthlyMinList.get(9); var novMin = monthlyMinList.get(10); var desMin = monthlyMinList.get(11);
var djfminCol = ee.ImageCollection.fromImages([desMin,janMin,febMin]); var djfMin = monthlyCol.min(); var mamminCol = ee.ImageCollection.fromImages([marMin,aprMin,meiMin]); var mamMin = monthlyCol.min(); var jjaminCol = ee.ImageCollection.fromImages([junMin,julMin,aguMin]); var jjaMin = monthlyCol.min(); var sonminCol = ee.ImageCollection.fromImages([sepMin,oktMin,novMin]); var sonMin = monthlyCol.min();
- Assistant
The computational timeout error occurs when your code takes too long to process the data. This can happen due to inefficient calculations or processing a large amount of data. In your case, the code is likely running into the computation timeout error because of the large spatial and temporal extent of the input Landsat data. I can provide a few suggestions to improve the efficiency of your code to prevent these issues.
- Resample the data using a lower resolution, so the calculations would process faster. To do this, you can use the
resample()function before importing your data, for example:
- Resample the data using a lower resolution, so the calculations would process faster. To do this, you can use the