I am having a visual glitch when adding an image as a band to the map. The glitch consists of a vertical line which is not rendered at all. The more I zoom out of the map, the more this line increases in width, When zoomed in, this line decreases in width.

The problem is specifically when I reduce a collection to the last element while filtering its bounds.

var image = imageCollection3.filterBounds(Lixin);
image = image.reduce(ee.Reducer.last());
var NDVI = image.normalizedDifference(['B8_last', 'B4_last']).rename('NDVI');

When I try to do the same process by reducing to the sum or the mean, the problem does not happen.

var image = imageCollection3.filterBounds(Lixin);
image = image.reduce(ee.Reducer.mean());
var NDVI = image.normalizedDifference(['B8_mean', 'B4_mean']).rename('NDVI');

It is also worth noting I don't get any errors in the console.

This is the link to my code: https://code.earthengine.google.com/f512a8c70b5f0d9444285cf190095f43

Is there a way to correct this?

How it looks when reducing to mean/sum: enter image description here

How the band looks when reducing to last. Default Zoom Zoom Out Increased Zoom Out Zoomed In

  • My guess is that there are some nodata or bad values in the NDVI_LI band that you're visualizing. As you zoom, the resampling shifts the missing block around based on the re-drawn grid at each zoom level. I might be wrong, but you can test this by exporting the NDVI_LI image and inspecting for strange values.
    – Jon
    Jul 2, 2019 at 21:00


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy