// RSPB Dove Stone Reserve Boundary
Boundary
// Load an image collection
var collection = ee.ImageCollection('projects/ee-rspbdovestone/assets/aerials')
// Mosaic the collection to get a single image (or use .median(), .mean(), etc.)
var mosaic = imageCollection.mosaic();
Map.addLayer(mosaic, {
bands: ['b1', 'b2', 'b3'],
min: 73,
max: 180
}, 'Mosaic');
// Define visualization parameters for a true-color composite (B4, B3, B2 for Landsat)
var visParam3 = {
bands: ['b1', 'b2', 'b3'],
min: 73,
max: 180,
gamma: 0.7
};
// Layers
Map.addLayer(Boundary, {color: 'Red'}, 'RSPB Dove Stone Boundary')
// Map Style
Map.centerObject(Boundary);
// Analysis
// Define a region in which to generate a segmented map.
var region = Boundary
// Load a Landsat composite for input.
var input = ee.ImageCollection('projects/ee-rspbdovestone/assets/aerials')
// Display the sample region.
// Make the training dataset.
var training = mosaic.sample({
region: Boundary,
scale: 0.3,
numPixels: 10000
});
// Instantiate the clusterer and train it.
var clusterer = ee.Clusterer.wekaKMeans(50).train(training);
// Cluster the input using the trained clusterer.
var result = mosaic.cluster(clusterer);
// Display the clusters with random colors.
Map.addLayer(result.randomVisualizer(), {}, 'clusters');
#Coding #Research #GEE