0

This code is working and the video is active but only images are there. I couldn't add the date (year) to the images. How can this step be accomplished?

// Define your collection
var collection = (ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA'));
                 

// Path and Row
var path = collection.filter(ee.Filter.eq('WRS_PATH', x));
var pathrow = path.filter(ee.Filter.eq('WRS_ROW', x));
var date= pathrow.filterDate('2020-11-01', '2023-11-01');
var datemonth= date.filter(ee.Filter.calendarRange(7, 7, 'month'));

// Filter cloudy scenes
var clouds = datemonth.filter(ee.Filter.lt('CLOUD_COVER', 5));

// Select the bands, we are going for true color... but could be any!
var bands = clouds.select(['B4', 'B3', 'B2']);

print(bands);

// Make the data 8-bit
function convertBit(image) {
  return image.multiply(512).uint8();
}

function addDateText(image) {
  
 
var date = ee.Date(image.get('system:time_start')).format('YYYY-MM-dd');
  
  // Create an image with the date text at a specific position
  var textImage = ee.Image([1])
    .visualize({palette: 'white'})
    .mask(ee.Image().toByte().paint(ee.Geometry.Point([XXXXX]), 1, 14)
    .
mask().eq(1));
  
  var annotatedImage = image.blend(textImage);
  
  return annotatedImage.set('system:time_start', image.get('system:time_start'));
}

// Call the conversion    
var outputVideo = bands.map(convertBit);

print("About to build video");

// Export to video
Export.video.toDrive({
  collection: outputVideo,
  folder: 'outputVideo',
  description: 'urbinotimelapsezoomout2',
  dimensions: 720,
  framesPerSecond: 3,
  //region: ee.Geometry.Polygon([[XXXXX]]),
  maxFrames: 10000
});
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.