This is due to the client/server split of Earth Engine.
The Earth Engine servers know that if you map()
a feature collection and each result feature is an image, then the result collection can be an image collection. But the Earth Engine client — the JavaScript (or Python) functions you actually call to define your computation — don't look at the map()
and conclude "this always returns an ee.Image
". So, as far as the client knows, you're working on a FeatureCollection
, not an ImageCollection
, and can't use any methods of ImageCollection
.
The solution is to write a cast, to inform the client that the result will definitely be an ImageCollection:
// add this to your script
// ↓ ↓ ↓
var imageCollection = ee.ImageCollection(featureCollection.map(function (feature) {
return ee.Image.constant(feature.get('myProperty')).rename('myBand');
}));