Google Earth Engine – Raster to Vector Conversion in Google Earth Engine

google-earth-enginevectorization

I would like to convert a raster image into vector. My image is referenced to a specific zone (vect).
I'm working with Hansen dataset and in particularly the layer 'lossyear'. Raster image is from a different polygon in a specific year (for example 2007) and I obtain it by the function ReduceResolution. The value of different pixel that constitute the image are float number. The code is:

var loss_2007_vt = loss_2007_filtered_res.reduceToVectors({
reducer: ee.Reducer.mean(),
geometry: vect,
crs: collection.projection(),
scale:500,
geometryType:'polygon',
});

I received this error message: "FeatureCollection (Error)
Image.reduceToVectors: Need 1+1 bands for , image has 1".

Best Answer

Try not specifying the reducer. I think it's looking for additional bands to reduce (i.e. get the mean for a homogeneous region and set it as a property of the output feature) and not finding any.