Monday, 22 June 2015

qgis - In Google Earth Engine, can I export a layer with visual parameters added to a GeoTIFF?


I am trying to get a LandSAT-8 image of the certain region with cloud cover 2. I am using some visual parameters and adding my layer. I want to export this layer to GeoTIFF but at the moment I am exporting the image which is without the visualization parameters I have chosen. So is it possible to export the visual layer instead of the image? Following is my code:


var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filter(ee.Filter.eq('WRS_PATH', 25))

.filter(ee.Filter.eq('WRS_ROW', 31))
.filter(ee.Filter.lte('CLOUD_COVER', 2));
var image = ee.Image(collection.sort('CLOUD_COVER', false).first()).select(['B2']);
var visParams = {
bands: ['B2'],
min: 400,
max: 1500,
gamma: [1.5]
};
Map.addLayer(image, visParams, 'MyImage');

Export.image.toDrive({
image: image,
description: '25_31_B2',
scale: 30,
maxPixels: 1e13
});

Answer



You can created a 3-band RGB image for export using ee.Image.visualize() and the same visualization parameters you used for displaying the interactive map layer, using this syntax:


Export.image.toDrive({
image: image.visualize(visParams),

...
});

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...