1

I was working with Dynamic world data following the tutorial series. The following code works and display actual data:

var START = ee.Date('2021-04-02');
var END = START.advance(1, 'day');

var colFilter = ee.Filter.and(
    ee.Filter.bounds(ee.Geometry.Point(20.6729, 52.4305)),
    ee.Filter.date(START, END));

var dwCol = ee.ImageCollection('GOOGLE/DYNAMICWORLD/V1').filter(colFilter).first();

but the following results in all filtered pixel:

var START = ee.Date('2021-04-02');
var END = START.advance(1, 'day');

var colFilter = ee.Filter.and(
    ee.Filter.date(START, END));

var dwCol = ee.ImageCollection('GOOGLE/DYNAMICWORLD/V1').filter(colFilter).first();

Why is it compulsory to filter by date and geometry ?

1 Answer 1

1

The last snippet works fine, it's probably just rendering the image where you're not looking.

var START = ee.Date('2021-04-02');
var END = START.advance(1, 'day');

var colFilter = ee.Filter.and(
    ee.Filter.date(START, END));

var dwCol = ee.ImageCollection('GOOGLE/DYNAMICWORLD/V1').filter(colFilter).first();
Map.centerObject(dwCol)
Map.addLayer(dwCol)

Note that dwCol is a bit confusing variable name. It's actually an image, not a collection after you called first().

https://code.earthengine.google.com/f76c5cd2143ba84e90db44fe93d575d7

1
  • Thanks Daniel, you are very right I should call mosaic() instead. Sorry for the variable convention I simply kept the one from the exemple. Jul 25, 2023 at 11:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.