I need to layer stack two Landsat images from the dry season and the wet season.

Is the function 'composite' in earth engine going to give me the layer stacking?

  • By Earth Engine do you mean Google Earth Engine or something else? – PolyGeo Feb 14 '17 at 19:44
  • in EarthEngine terminology a 'composite' is a single image. What you are looking for is either an 'Image Collection' or a 'Image' with multiple bands. What you use is solely dependent on what you plan to do with your image stack. I suggest you have a look into the official EarthEngine documentation since this and all of your previous questions are answered in there. – Kersten Feb 15 '17 at 9:04
  • Thanks Kersten. I have been reading the official Earth Engine documentation and its not very clear about Layerstacking as I understand it from ENVI or any other proprietary Image analysis software. – Pamela Ochungo Feb 15 '17 at 14:40

The ee.Image.addBands() method can be used to "stack" bands from two Landsat images. For example:

var wet = ee.Image('LANDSAT/LC8_L1T/LC80440342017005LGN00');
var dry = ee.Image('LANDSAT/LC8_L1T/LC80440342016195LGN00');
var stacked_composite = wet.addBands(dry);
print('stacked_composite bands', stacked_composite.bandNames());

Note that the resulting image object stacked_composite will retain the metadata of the primary image (wet). You may also want to rename the bands with ee.Image.rename() either before or after stacking them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.