0

I am unable to identify the bands after exporting as it shows no band name after exporting in google drive

I have tried to download Landsat 8 Surface Reflectance Tier 1 image. I filtered the images based on cloud cover,  boundary shape file and satellite date. I also clipped the file. I further filtered to obtain only 7 bands .

How can we control the band names when exporting to google earth engine?

// Variable to import Landsat Satellite Files 
var image=ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")

// Filter the number of images available for shape file region
var filter_region=image.filterBounds(roi)

// Filter the region with less than 1 % cloud cover and reduced bands
var filter_cloud=filter_region.filterMetadata('CLOUD_COVER','less_than',3).select(['SR_B1','SR_B2','SR_B3','SR_B4','SR_B5','SR_B6','ST_B10']);

//Clip the Pune bands

var rgbVis={min:0,max:3000,bands:['SR_B4','SR_B3','SR_B2']};

var PNClip_PreMon2014=filter_cloud.filterDate('2014-03-01','2014-04-30').mean().clip(roi);
print(PNClip_PreMon2014);
Map.addLayer(PNClip_PreMon2014,rgbVis,'Pre Monsoon 2014 Clipped Image ');
var PNClip_PreMon2017=filter_cloud.filterDate('2017-03-01','2017-03-31').mean().clip(roi);
print(PNClip_PreMon2017);
Map.addLayer(PNClip_PreMon2017,rgbVis,'Pre Monsoon 2017 Clipped Image ');
var PNClip_PreMon2020=filter_cloud.filterDate('2020-03-01','2020-03-31').mean().clip(roi);
print(PNClip_PreMon2020);
Map.addLayer(PNClip_PreMon2020,rgbVis,'Pre Monsoon 2020 Clipped Image ');
var PNClip_PostMon2014=filter_cloud.filterDate('2014-10-01','2014-10-30').mean().clip(roi);
print(PNClip_PostMon2014);
Map.addLayer(PNClip_PostMon2014,rgbVis,'Post Monsoon 2014 Clipped Image ');
var PNClip_PostMon2017=filter_cloud.filterDate('2017-11-01','2017-11-30').mean().clip(roi);
print(PNClip_PostMon2017);
Map.addLayer(PNClip_PostMon2017,rgbVis,'Post Monsoon 2017 Clipped Image ');
var PNClip_PostMon2020=filter_cloud.filterDate('2020-11-01','2020-12-30').mean().clip(roi);
print(PNClip_PostMon2020);
Map.addLayer(PNClip_PostMon2020,rgbVis,'Post Monsoon 2020 Clipped Image ');

// Check the project for Shape File and Clipped Pune Files

var projection1 = PNClip_PostMon2020.projection().getInfo();
print(projection1)
var projection2 = roi.projection().getInfo();
print(projection2)

// Export the Clipped Images

Export.image.toDrive({image:PNClip_PreMon2014,description:'ExportToDrivePreMon2014',fileFormat:'GeoTIFF',scale:10,region:roi,maxPixels:1E10});
Export.image.toDrive({image:PNClip_PreMon2017,description:'ExportToDrivePreMon2017',fileFormat:'GeoTIFF',scale:10,region:roi,maxPixels:1E10});
Export.image.toDrive({image:PNClip_PreMon2020,description:'ExportToDrivePreMon2020',fileFormat:'GeoTIFF',scale:10,region:roi,maxPixels:1E10});
Export.image.toDrive({image:PNClip_PostMon2014,description:'ExportToDrivePostMon2014',fileFormat:'GeoTIFF',scale:10,region:roi,maxPixels:1E10});
Export.image.toDrive({image:PNClip_PostMon2017,description:'ExportToDrivePostMon2017',fileFormat:'GeoTIFF',scale:10,region:roi,maxPixels:1E10});
Export.image.toDrive({image:PNClip_PostMon2020,description:'ExportToDrivePostMon2020',fileFormat:'GeoTIFF',scale:10,region:roi,maxPixels:1E10});

enter image description here

enter image description here

1 Answer 1

1

You rename the bands of an image with rename() or select(). The band names are included in the GeoTIFF metadata.

var image = ee.Image([
  ee.Image(1),
  ee.Image(2),
  ee.Image(3)
]).rename(['foo', 'bar', 'baz'])
var region = ee.Geometry.Point([0, 0]).buffer(100).bounds()
Export.image.toDrive({
  image: image, 
  description: 'test-image',
  region: region,
  scale: 30
})

https://code.earthengine.google.com/251a8754247954e6f524d5ef7c96cf77

Running gdalinfo on the resulting image, downloaded from Google Drive, outputs the below. Note the Description for each band.

...
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Description = foo
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Description = bar
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Description = baz

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.