1

I'm trying to overlay multispectral band with panchromatic band from Landsat8 in GEE. Although these bands are perfectly overlapped in QGIS, it is not in gee. Why did this happen and, of course, is it possible to fix it?

Below are two examples of the problem and the code.

'''
roi4 = ee.Feature(ee.Geometry.Rectangle([[-42.946797281314836, -22.39472469429372],\
       [-42.92057776318739, -22.376874965199057]]))
img = ee.ImageCollection("LANDSAT/LC08/C02/T1_RT_TOA").filterBounds(roi4.geometry())\
      .filterMetadata('CLOUD_COVER', 'less_than', 5)\
      .first()
    
Map = geemap.Map()
Map.centerObject(roi4)
Map.addLayerControl()
Map.addLayer(img, {'bands':['B7'],'min':0, 'max':0.3}, 'B7')
Map.addLayer(img, {'bands':['B8'],'min':0, 'max':0.3}, 'B8')
Map

'''

qgis vs gee for mark over pan and ms

1 Answer 1

0

My solution was create a new ee.Image and then redefine define the multispectral band projection as the panchromatic projection. And then, add both in the new image. When I just try redefine the MS bands into the same image didn't work.

Weird problem. I would still like to understand it.

roi4 = ee.Feature(ee.Geometry.Rectangle([[-42.946797281314836, -22.39472469429372],\
       [-42.92057776318739, -22.376874965199057]]))
img = ee.ImageCollection("LANDSAT/LC08/C02/T1_RT_TOA").filterBounds(roi4.geometry())\
      .filterMetadata('CLOUD_COVER', 'less_than', 5)\
      .first()

img1=ee.Image(0)
ms=img.select('B[1-7]').reproject(img.select('B8').projection())
pan=img.select('B8')
img1=img1.addBands([pan,ms])
img1=img1.select('B.*')
Map = geemap.Map()
Map.centerObject(roi4)
Map.addLayerControl()
Map.add_basemap('SATELLITE')
Map.addLayer(img1, {'bands':['B7'],'min':0, 'max':0.3}, 'B7')
Map.addLayer(img1, {'bands':['B8'],'min':0, 'max':0.3}, 'B8')
Map

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.