I have two different DEM images that I am trying to blend. The first is based on SRTM (DEM1) and the second on coastalDEM (DEM2), with different but overlapping areas.

When I do

var DEMblend = DEM2.blend(DEM1);
Map.addLayer(DEMblend, {}, 'DEMblend');

I see what I would expect, the two images blended together. However, when I use the inspector or any other further analysis, Google Earth Engine believes that DEMblend only returns unmasked values for the area of DEM1. Furthermore, the areas of DEMblend.unmask() and DEMblend.mask() are not the same.

Has anyone run into anything like this before? This is a section of some fairly complicated code, but I can pull out a minimal working example if it would help.

Here's DEM 1: DEM1

Here's DEM2: DEM2

Here's Map.addLayer(DEMblend, {}, 'DEMblend'); DEMblend

Here's DEMblend.unmask() DEMblend.unmask()

Here's DEMblend.mask() DEMblend.mask()

  • 1
    That's a strange behaviour. A workaround could be to specify the footprint of the blend manually: DEM2.blend(DEM1).set('system:footprint', DEM1.geometry().union(DEM2.geometry())) Aug 18, 2022 at 9:21

1 Answer 1


So I did end up getting this to work (though still have no idea why this bug is occurring). I did this by making sure that the two images (DEM1 and DEM2) fit within a singular(larger) bounding box neatly before the blend, with just different interior areas masked. I believe this is essentially the same thing as what Daniel Wiell suggests above (which also works).

So DEM1 now looks like:

enter image description here

And DEM2 now looks like:


And the two blended together (note the smooth west and north edges this time around):


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.