0

My Google Earth Engine code (see below) returns the error Line 20: Unrecognized argument type to convert to an Image: [object Object]. Line 20 is the 3rd from last line, displayImage(ee.Image(image));

var sentinel1 = imageCollection
  .filterBounds(geometry)
  .filterDate('2016-12-19', '2016-12-21')
  .select('HH');

// Create a visualization parameter for displaying the image.
var visParams = {min: -25, max: 0};

// Create a function to display each image in the collection.
var displayImage = function(image) {
  var imageId = image.id().getInfo();
  var date = ee.Date(image.get('system:time_start')).format('YYYY-MM-DD').getInfo();
  var name = 'Sentinel-1 Image (' + date + ')';
  Map.addLayer(image, visParams, name);
};

// Apply the displayImage function to each image in the filtered collection.
sentinel1.evaluate(function(images) {
  images.features.forEach(function(image) {
    displayImage(ee.Image(image));
  });
});

I tried the above code and expected GEE to load each image onto to the map as a separate layer but just got the above error message.

Rachel
  • 1

0 Answers0