0

I am practicing on GEE for unsuperised classification. wekaKMean clusterer algorithum,, with this code...

var s2 = sentinal data set level 2a

var geometry = ------

var filtered = s2.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE',10))

  .filter(ee.Filter.date('2023-04-10' , '2023-05-10'))

  .filter(ee.Filter.bounds(geometry));

print(filtered.size());

var bandcomp = {

  min:0.0,

  max:3000,

  bands:['B4','B3','B2'],

};

var median = filtered.median();

var image = median.clip(geometry);

Map.addLayer(image,bandcomp,'Filtered image');

print(image);

var training = image.sample({

  region:geometry,

  scale:20, 

  numPixels : 1e8 ,

});

var samples = ee.Clusterer.wekaKMeans(5).train(training);

var result = image.cluster(samples);

Map.addLayer(result.randomVisualizer(),{},"classified");

But I get this error

classified: Layer error: Output of image computation is too large (23 bands

for 768000 pixels = 134.8 MiB > 80.0 MiB).

If this is a reduction, try specifying a larger 'tileScale' parameter.


I am not coder but working hard for this... How can I resolve this issue?

1 Answer 1

0

You are clustering using all 23 bands, including: "AOT", "WVP", "SCL", "TCI_R", "TCI_G", "TCI_B", "MSK_CLDPRB", "MSK_SNWPRB", "QA10", "QA20", "QA60".

It's highly unlikely you meant to use the (empty) QA10 and AQ20 bands for clustering, and really, you probably don't even want all the reflectance bands, considering B1 is aerosols and B9 is water vapor. Select just the bands you actually want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.