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

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:

  // .filterBounds(ROI)

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?

Geographic Information Systems Asked on November 14, 2021

1 Answers

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 November 14, 2021

Add your own answers!

Related Questions

Modifying the TIFF’s attribute table value with R

1  Asked on January 28, 2021 by user173675


How to calculate pixel size on image of map?

2  Asked on January 28, 2021 by presto


Split polygons between 2 shapefiles

1  Asked on January 28, 2021 by ntelo


Quickosm and the modeler

0  Asked on January 28, 2021 by alessandro-bollini


Catching clicked signal on a QgsMapCanvas

1  Asked on January 28, 2021 by ainardi


Using my “layerGroup” outside of the function

1  Asked on January 28, 2021 by sm21


Usage of index in R raster setValues function

1  Asked on January 28, 2021 by karpfen


Ask a Question

Get help from others!

© 2021 All rights reserved.