Importing imageCollection from Google Earth Engine to QGIS - why the map does not appear on the canvas, if the code and crs seem to be ok?

Viewed 217

I try to import an imageCollection to qgis from google ee with the code below. I do not receive any error message. The syntax check syas everything is ok, the map appears among the layers, the crs of the imageCollection and the project match - yet the map does not appear on the canvas.

What could be the problem?


from ee_plugin import Map

imageCollection = ee.ImageCollection("MODIS/006/MOD13Q1"),
geometry = ee.Geometry.MultiPoint();
    
dataset = ee.ImageCollection('MODIS/006/MOD13Q1')\
                  .filter(ee.Filter.date('2021-01-01', '2021-05-31'));
ndvi = dataset.select('EVI');
ndviVis = {
  'min': 0.0,
  'max': 8000.0,
  'palette': [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ]};

Map.setCenter(19.040236, 47.197913, 7.5)

Map.addLayer(ndvi, ndviVis, 'EVI');
1 Answers

The reason is that the plugin does not interpret image collection properly. It looks like a bug - please report it as an issue with the above script to reproduce on GitHub. It should run mosaic() by default for image collections.

A workaround is to replace the last line with:

Map.addLayer(ndvi.mosaic(), ndviVis, 'EVI');

Or with:

Map.addLayer(ndvi.mean(), ndviVis, 'EVI');

Or any other reducer.

Related