Sunday, 12 May 2019

ndvi - Black vertical lines on exported image from Google Earth Engine



I tried to export the NDVI obtained from the Landsat 8 Surface Reflectance Collection in Google Earth Engine and I keep on getting black lines in my final export. Everything looks fine when displaying it on the map online, it's just the export to google drive that has the problem.


Here is the code I'm using


var region = ee.FeatureCollection(
'ft:1A9vRY9l-eBNBFBwAV_mLAEeCIPYS2T14vsKhiEQc');
var crop = region.geometry();

function mask_image(image){
return image.updateMask(image.select('pixel_qa').bitwiseAnd(ee.Image.constant(2)).eq(2));
}


function ndvi(image){
return image.addBands(image.normalizedDifference(['B5','B4']).rename('NDVI'));
}

var start = ee.Date('2013-01-01');
var end = ee.Date('2017-12-31');
var image = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterDate(start,end)
.filterBounds(crop)
.map(mask_image)

.map(ndvi);

var to_export = image.mean().select(['NDVI']);

Export.image.toDrive({
image: to_export,
description: 'NDVI-test',
folder:'Landsat8-NDVI',
scale: 30,
region: crop,

maxPixels:1e10,
crs: 'EPSG: 32718'
});

Map.centerObject(image,8);
Map.addLayer(to_export.clipToCollection(region));

This is how it looks like when opening the export image in a GIS software.


Black Lines in Landsat8 NDVI image




No comments:

Post a Comment