Geographic Information Systems Asked by Petr Janoš on August 9, 2021
I have created a classification using Google Earth Engine following the tutorial using ee.Algorithms.Landsat.simpleComposite.
I know the algorithm only uses raw scenes (as the documentation says), but is there any reason to try to create a composite from the Surface Reflectance data?
If I create a code for the composite from L8 SR, will it have a positive effect on the output classification or is it a wasted effort?
I asked the question because almost everyone uses Landsat.simpleComposite, but my friend insists that the L8 Surface Reflectance is better.
// buffer (m)
function bufferPoints(radius, bounds) {
return function(pt) {
pt = ee.Feature(pt);
return bounds ? pt.buffer(radius).bounds() : pt.buffer(radius);
}
}
var land = ee.FeatureCollection("users/petrjanos/hlavni/mongolsko_2021");
var pts = ee.FeatureCollection("users/petrjanos/klasifikace/class")
.map(bufferPoints(30, false))
// Make a cloud-free Landsat 8 TOA composite (from raw imagery).
var L8 = ee.ImageCollection('LANDSAT/LC08/C01/T1').filterBounds(pts)
var image = ee.Algorithms.Landsat.simpleComposite({
collection: L8.filterDate('2020-06-01', '2020-09-30'),
asFloat: true
});
// Use these bands for prediction.
var bands = ['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11'];
// This property stores the land cover labels as consecutive
// integers starting from zero.
var label = 'class';
// Overlay the points on the imagery to get training.
var training = image.select(bands).sampleRegions({
collection: pts,
properties: [label],
scale: 30
});
// Train a CART classifier with default parameters.
var trained = ee.Classifier.smileCart().train(training, label, bands);
// Classify the image with the same bands used for training.
var classified = image.select(bands).classify(trained);
// Display the inputs and the results.
Map.centerObject(geo, 8);
Map//.addLayer(image.clip(land), {bands: ['B4', 'B3', 'B2'], max: 0.4}, 'image');
Map.addLayer(classified.clip(land),
{min: 0, max: 3, palette: ['blue', 'red', 'purple', 'green']},
'classification');
link to code: https://code.earthengine.google.com/68ad9918a02b15e4a7113ad05fc2340d
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP