I am having difficulties with masks in Google Earth Engine (GEE).
I need to classify a sentinel image of the GEE. But I don't want the eucalyptus areas in my image to be classified. I have a shapefile that contains all the areas of eucalyptus planted and I would like the GEE to disregard the eucalyptus shapefile area during classification.
How can I do it?
var S2_1 = ee.ImageCollection("COPERNICUS/S2")
.filterMetadata('MGRS_TILE', 'equals', '21KYT')
.filterMetadata('CLOUDY_PIXEL_PERCENTAGE','less_than', 1)
.filterDate('2020-01-01','2020-07-31')
.median();
//Classificação
var classnames = veg1.merge(past1).merge(past2).merge(agua).merge(past3).merge(veg2);
print(classnames);
var bands = ['B4', 'B3', 'B2'];
var training = S2_1.select(bands).sampleRegions({
collection: classnames,
properties:['classe'],
scale: 10
});
print (training);
var cart = ee.Classifier.cart().train({
features: training,
classProperty: 'classe',
inputProperties: bands
});
var cart_class = cart.select(bands).classify(cart)