When I download Analysis results from Google Earth Engine, the image is exported in to google drive but it does not have a color palette. How do i add color palette with the exported image using earth engine.
var landcover_roi = composite.clip(ft);
var ndvi =landcover_roi.normalizedDifference(['B8', 'B4']) ;
Map.addLayer(landcover_roi,{bands: ['B6', 'B4', 'B3'], min: 0, max: 0.3}, 'From Fusion Table');
// Make a palette: a list of hex strings.
var palette = ['FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718',
'74A901', '66A000', '529400', '3E8601', '207401', '056201',
'004C00', '023B01', '012E01', '011D01', '011301'];
// Center the map
Map.setCenter(87.32,22.40, 6);
Map.addLayer(ndvi,{min: 0, max: 1, palette: palette},'Sentinel-2 NDVI')
Export.image.toDrive({
image:ndvi,
description: 'ndvi',
scale: 30,
// region: geometry,
maxPixels:34089663741
});
Best Answer
Use
visualize
functionIn Python: