0

This question already has an answer here:

There is a script in GEE to mask cloud:

// This example demonstrates the use of the pixel QA band to mask
// clouds in surface reflectance (SR) data.  It is suitable
// for use with any of the Landsat SR datasets.

// Load Landsat 8 surface reflectance data
var l8sr = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR');

// Function to cloud mask from the Fmask band of Landsat 8 SR data.
function maskL8sr(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = ee.Number(2).pow(3).int();
  var cloudsBitMask = ee.Number(2).pow(5).int();

  // Get the pixel QA band.
  var qa = image.select('pixel_qa');

  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
      .and(qa.bitwiseAnd(cloudsBitMask).eq(0));

  // Return the masked image, scaled to [0, 1].
  return image.updateMask(mask).divide(10000);
}

// Map the function over one year of data and take the median.
var composite = l8sr.filterDate('2016-01-01', '2016-12-31')
                    .map(maskL8sr)
                    .median();

// Display the results.
Map.addLayer(composite, {bands: ['B4', 'B3', 'B2'], min: 0, max: 0.2});

After applying it, the cloud and shadow cloud pixels are labeled as "masked". I want to create a feature class from the result of the script. In fact, I need to extract the masked pixels and make them as features.

marked as duplicate by Kersten, whyzar, Andre Silva, aldo_tapia, Hornbydd May 24 '18 at 17:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Have you tried anything yourself? – lynxlynxlynx May 24 '18 at 10:44
  • 1
    This has been analyzed before: gis.stackexchange.com/q/282971/80215 Only convert cloud-cloud shadow layer to feature – aldo_tapia May 24 '18 at 11:08
  • Thank you for your response. I had checked that method, but the visualization is not important for my study. Actually, I need to have the cloudy pixels as a class as well as my other classes. Finally, I want to classify all classes including cloudy regions. In addition, I am not expert enough in GEE. Should I use ee.image.reduceToVectors() to convert cloud layer to feature? – Mohammad Mazloumi May 26 '18 at 8:17