An error occurred in raster to vector conversion:
Layer 1: Layer error: ImageCollection.mosaic: Invalid type. Expected type: Image. Actual type: FeatureCollection.
Why is the Map
function trying to mosaic an image collection when I have a feature collection that is also a valid input to Map
.
My code link is: https://code.earthengine.google.com/f14646de49f536d7ed4b4e0d5a9ccb21
var elevation=SRTM;
var sorted = L8.filter(ee.Filter.eq('WRS_PATH', 147))
.filter(ee.Filter.eq('WRS_ROW', 38))
.filter(ee.Filter.calendarRange(2013,2013,'year'))
.filter(ee.Filter.calendarRange(7,10,'month'))
.filterMetadata('CLOUD_COVER', 'less_than', 10)
var ndwi1 = sorted.map(
function(img) {
var ndwi = img.normalizedDifference(['B3','B5']);
var slop = ee.Terrain.slope(elevation);
var evi1 = ndwi.expression('(thr>0.25) && (slp<20)? 1 : 0' ,
{ 'thr' : ndwi, 'slp' : slop });
var evi = evi1.clip(table)
var vectors = evi.addBands(evi)
.reduceToVectors({
geometry: table,
crs: evi.projection(),
scale: 30,
geometryType: 'polygon',
reducer: ee.Reducer.mean(),
maxPixels: 1e8
});
return vectors;
})
print(ndwi1)
Map.addLayer(ndwi1)