Skip to main content
edited body
Source Link

I just perform a NDVI classification, and I want to know if I can plot or display the values of the NDVI lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not noto plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')

I just perform a NDVI classification, and I want to know if I can plot or display the values of the NDVI lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not no plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')

I just perform a NDVI classification, and I want to know if I can plot or display the values of the NDVI lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not to plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')
English usage; naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

plot Plot a range of values of a ndviNDVI calculated in Google Earth Engine

iI just perform a NDVI classification, and I want to know if iI can plot or display the values of the nvdiNDVI lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not no plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')

plot a range of values of a ndvi calculated in Google Earth Engine

i just perform a NDVI classification, and I want to know if i can plot or display the values of the nvdi lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not no plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')

Plot a range of values of a NDVI calculated in Google Earth Engine

I just perform a NDVI classification, and I want to know if I can plot or display the values of the NDVI lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not no plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')
Source Link

plot a range of values of a ndvi calculated in Google Earth Engine

i just perform a NDVI classification, and I want to know if i can plot or display the values of the nvdi lower than 0.8, or within a range for example from 0.3 to 0.5 and the rest of values in black or just not no plot them.

Here is part of my code:

//cargar coleccion de landsat
///////////////////////////////////////////////////////////////
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')


//geometry with the AOI 
var roi = geometry;

//filtrar la imagen de acuerdo a la cobertura de nubes en el poligono
////////////////////////////////////////////////////////////////////
var l8f = l8.filterBounds(roi);

var withCloudiness = l8f.map(function(img_zone) {
  var cloud = ee.Algorithms.Landsat.simpleCloudScore(img_zone).select('cloud');
  var cloudiness = cloud.reduceRegion({
    reducer: 'mean', 
    geometry: roi, 
    scale: 30,
  });
  return img_zone.set(cloudiness);
});

var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));


var image = ee.Image(filteredCollection.filterBounds(roi)
    .filterDate('2017-03-30', '2017-07-30')
    .sort('CLOUD_COVER')
    .first());



var red = image.select('B4');

//infrarrojo cercano
var NIR = image.select('B5')


var nvdi = (NIR.subtract(red)).divide(NIR.add(red)).rename('NDVI');


Map.addLayer(nvdi,{min: -1, max: 1},'ndvi_rice_1')