In this tutorial, we will use the MODIS based V6 Terra Vegetation Indices 16-Day Global 250m product. This MODIS NDVI and EVI products are computed from atmospherically corrected bi-directional surface reflectances that have been masked for water, clouds, heavy aerosols, and cloud shadows. We will use this product to create NDVI based threshold classified thematic map.

  1. Let’s start by importing the datasets in the Earth Engine code editor.

    var modisVI = ee.ImageCollection("MODIS/006/MOD13Q1");
    
  2. Draw the AOI on the map. It is available as geometry variable.
    You can also import your shapefile to the Earth Engine. If you already do not know how to do that, check here.
  3. We will create a monthly threshold based classification map. Let’s go ahead and make a monthly NDVI maps. We will be focusing on 2019. If any aggregation, those will be aggregated by median reducer. There will be max 2 images per month as this is 16-Day composite. Notice the scale factor for the product is 0.0001

    var year = 2019;
    var month = ee.List.sequence(1, 12);
    
    var monthlyNDVI = ee.ImageCollection(month.map(function(m) {
      var startDate = ee.Date.fromYMD(year, m, 1);
      var endDate = startDate.advance(1, 'month');
      return modisVI
        .select(['NDVI'])
        .filterBounds(geometry)
        .filterDate(startDate, endDate)
        .median()
        .multiply(0.0001)
        .set('system:time_start', startDate);
    }));
    
  4. Next, lets create a monthly NDVI classified maps from monthlyNDVI which we created in above step. We will be using where operator in the Earth Engine. Below is the thresholded value.

    Original NDVI Range Thresholded Value
    -0.2 to 0.3 1
    0.3 to 0.6 2
    0.6 to 1.0 3
    var classifiedNDVI = monthlyNDVI.map(function (img){
      return ee.Image(3)
        .where(img.select('NDVI').lte(0.6), 2)
        .where(img.select('NDVI').lte(0.3), 1)
        .set('system:time_start', img.get('system:time_start'));
    });
    
  5. Add the NDVI for January and the thresholded maps for January in the map for comparison. Feel free to use your area of interest, year and month.

    var ndviJan = monthlyNDVI.filterDate('2019-01-01', '2019-01-30').first().clip(geometry);
    Map.addLayer(ndviJan, {min: 0, max: 0.4, palette: 'red,yellow,orange,green,darkgreen'}, 'NDVI Jan');
    
    var classifiedNdviJan = classifiedNDVI.filterDate('2019-01-01', '2019-01-30').first().clip(geometry);
    Map.addLayer(classifiedNdviJan, {min:1, max:3, palette: 'yellow,green,darkgreen'}, 'classified NDVI Jan');
    

Get the final code here.