TransWikia.com

Google Earth Engine: Working with imagery with "no bands" --how to select or rename a band

Geographic Information Systems Asked on December 3, 2020

I am trying to perform various operations on MODIS datasets in google earth engine.

Every operation I try to perform is prevented by the requirement in code to select a band to work with.

This collection: MODIS/MCD43A4_006_NDVI’
has no bands. It shows up in the console as

bands: [] when I perform any operation that requires selecting or manipulating bands.

part of the code I’ve tried is this:

  .filter(ee.Filter.calendarRange(startyear,endyear,'year'))
  .filter(ee.Filter.calendarRange(startmonth,endmonth,'month'))
  .sort('system:time_start')
  // .filterBounds(ROI)
  .select('NDVI');

I can’t select NDVI, which I need later in the code, because I can’t select anything with this dataset–there are no bands. I can’t add a band, since the information is already there, NDVI and day of year, but apparently not stored in a band.

How can I use this dataset in operations that require selection of a band?

One Answer

The bands field present when printing an image collection does not indicate exactly what bands the images in that collection have. It only specifies that, if any bands are listed there, all images in the collection do have those named bands. Each image may have more bands than the ones listed. (The bands information is only present in certain simple cases such as examining an image asset.)

You can look at each image within a collection to see what bands that image has:

Screenshot of console with image expanded

Similarly, from code:

print(collection.first().bandNames());     // will print ["NDVI"]

Answered by Kevin Reid on December 3, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP