As in the Hillshade Example, I wanted to automate adding all Layer from one Image for visual inspection.
var band_names =Image.bandNames()
print(ee.String(band_names.get(0)))
for (var i = 0; i < 4; i += 1) {
Map.addLayer(Image.select(ee.String(band_names.get(i))), {}, ee.String(band_names.get(i)));
}
This returns the longest Error ever, not gonna post it entirely
2 Questions:
the Layer name is a String:
print(ee.String(band_names.get(0)))
yields a string. What's wrong with this code?
How do I call the number of Bands for the automation? I imagine something like :
ee.Number(ee.Image.bad