Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. ee.Image(image.updateMask(mask)).divide(10000).addBands(qa, null, true)
  2. .copyProperties(image).set("system:time_start", image.get("system:time_start"));
  3.  
  4. // bands to use the classification for
  5. var bands = S2.first().bandNames().slice(1,12);
  6. // Think about which image you want to use as input for the classifier:
  7. // Do you have one 'perfect' image? Or do you want to classify based on every single image?
  8.  
  9. // map over the image collection, do the classification per-image
  10. var classified = S2.map(function(image){
  11. var training = image.select(bands).sampleRegions({ collection: newfc, properties: ['id'], scale: 30 }); // print(training)
  12. var classifier = ee.Classifier.cart().train({ features: training, classProperty: 'id'});
  13. var classImage = image.select(bands).classify(classifier).rename('classified');
  14. return image.addBands(classImage);
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement