Actually, when I'm trying to do a landuse supervised classification with Google Earth Engine, a strange message appears :
Collection.geometry: Unable to perform this geometry operation. Please specify a non-zero error margin. in , line 11 in , line 24
What is wrong with my code?
var image = ee.Image(ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterBounds(roi)
.filterDate('2018-05-01', '2018-06-30')
.sort('CLOUD_COVER')
.first());
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'],min:0, max: 3000});
var classNames = turban.merge(twater).merge(tforest).merge(tagriculture).merge(tsoil);
print(classNames);
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7'];
var training = image.select(bands).sampleRegions({
collection: classNames,
properties: ['landcover'],
scale: 30
});
print(training);
var classifier = ee.Classifier.cart().train({
features: training,
classProperty: 'landcover',
inputProperties: bands,
});
var classified = image.select(bands).classify(classifier);
Map.centerObject(classNames, 11);
Map.addLayer(classified,
{min: 0, max: 4, palette: ['red', 'blue', 'green','yellow','orange']},
'classification');