I'm a beginner at GE and JavaScript code. I want to apply two masks to a Landsat composition that is already done in the code.

First I've done the raster upload (that I want to be a mask), which I called "image1". Second, I want a mask that will delete pixels that are smaller than 1 ha.

The mask doesn't appear in the final result, where is the problem?

var mascara = function (image) {
  // Develop masks for anthropized area.
 var qaMaska = image1.select("b1")
 return image.updateMask(qaMaska)

var pixels = function (image) {
// Develop masks for pixels larger than 1000 ha.
var minArea = 10000
var maxSize = 200
var pixelCount = hx.connectedPixelCount(maxSize)
var minPixelCount = ee.Image(minArea).divide(ee.Image.pixelArea())
var agricFin = hx.updateMask(pixelCount.gte(minPixelCount))

Here is the link: https://code.earthengine.google.com/a6e853ef1b50056e273ff5d63ece3e7b

  • Use the Get Link button from the Code Editor and update the question with that link - current link doesn't work. Make sure all assets used are shared. You should also try to reduce your script, rewrite it in a way that only focuses on your question. It will significantly increase your chance of getting help. Sep 2, 2022 at 9:07
  • Thanks for the tips Sep 6, 2022 at 1:16


Your Answer

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

Browse other questions tagged or ask your own question.