top of page

An Analysis of Forest Area Change in India and its NE-Region on Google Earth Engine.

Updated: Nov 6, 2020

Before starting of let us first understand and have a short brief on the google earth engine, so

- What is Google Earth Engine(GEE)? According to the developers of it, Google Earth Engine is a platform for scientific analysis and visualization of geospatial datasets, for academic, non-profit, business, and government users. It hosts satellite imagery and stores it in a public data archive that includes historical earth images going back more than forty years. The images, ingested on a daily basis, are then made available for global-scale data mining. Earth Engine also provides APIs and other tools to enable the analysis of large datasets.

Now, the second question which arises is that, - What types of analyses can we do using the Google Earth Engine?

We can answer large-scale research questions in an efficient way that really was just not possible before. We can use large geospatial datasets to address a plethora of questions and challenges facing humanity in the modern world. It's also possible to import your own georeferenced imagery.


So let us first understand some of the basic vocabulary we will use most often,

ee.ImageCollection: An ImageCollection is a stack or sequence of images. An ImageCollection can be loaded by pasting an Earth Engine asset ID into the ImageCollection constructor. You can find ImageCollection IDs in the data catalog of any dataset.

ee.Image: Images are composed of bands and a dictionary of properties. Raster data are represented as Image objects in Earth Engine. Images are composed of one or more bands and each band has its own name, data type, scale, mask, and projection. Each image has metadata stored as a set of properties. We can get Image from ImageCollection with the help of the `ee.ImageCollection` function.

Bands: Images in Earth Engine are made up of one or more bands. Each band in an image has its own name, pixel values, pixel resolution, and projection. As you'll soon discover, the SRTM image has one band: 'elevation'.


Analysis of Forest Area Change in India(2000-2019):

Before starting the analysis make sure you have: 1. Signed up to the GEE platform, and have the access to the GEE Code editor.

2. Downloaded the shapefiles containing the boundaries of India from here: Click

3. Basic knowledge in JavaScript.

At first and foremost we'll need to import our downloaded shapefile and import the dataset with which we will be working on.

By clicking on the `Assets` tab present on the left panel, click on the `New` button, and wait for the shapefiles to get uploaded. After the upload is completed by clicking on the `->` and Import it in the script, and change the variable name to India.

Alternatively, this can also be done with codes as :

var india = ee.FeatureCollection("users/<username>/IndiaBoundary");

Dataset: Results from time-series analysis of Landsat images in characterizing global forest extent and change. It contains 13 bands. which are:

"treecover2000", "loss", "gain", "lossyear", "first_b30", "first_b40",  "first_b50", "first_b70", "last_b30", "last_b40", "last_b50", "last_b70", and "datamask"

Most frequently we are going to use `treecover2000`, `loss`, and `gain`.

Now, let us import the dataset:

var gfc2019 = ee.Image("UMD/hansen/global_forest_change_2019_v1_7").clip(india);

In the above code, we have added a special function i.e.,


which is used to clip only those portion from the bands or layer which is present in the boundaries of India, that has been previously provided as a shapefile.

Lets us have a look at the vegetation of the country, with the help of the below code snippet:

    {bands: ['last_b50', 'last_b40', 'last_b30']},
    'false color'

and then click on the Run button, which will generate the below visualization,

Vegetation of India

This image has been generated using three bands, Landsat 5, 4, and 3. Here the band combination shows healthy vegetation as green and soil as mauve. The states which come under larger vegetation area are the north-eastern region and a bit of south coastal region. The northern region of the country comes out in a blue color which represents the colder regions that receive ice fall in most of the months of a year. The areas with darker pink color fall out in the states of Rajasthan and a bit in Gujarat.

Which resembles that these states have more soil than vegetation.

We can also have a look at the forest cover in the country, by selecting the `treecover2000` band with a specific color palette as `black` and `green`. with the help of `palette` option which comes with the `Map.addLayer()` function.

Map.addLayer(gfc2019, {
  bands: ['treecover2000'],
  palette: ['000000', '00FF00'],
  max: 100
}, 'forest cover percent');

After Running the above script, this code snippet will generate a visualization that displays the areas with large forest areas with a darker green color.

Now let us have a look at the forest area loss, and gain.

Let us set the forest loss to show up as bright red and forest gain to show up as bright blue. To fix this, we can use the visualization parameter max to set the range to which the image data are stretched. Note that the max visualization parameter takes a list of values, corresponding to maxima for each band:

Map.addLayer(gfc2019, {
  bands: ['loss', 'treecover2000', 'gain'],
  max: [1, 255, 1]
}, 'forest cover, loss, gain');

Now, after clicking the `Run` button, it will generate the below visualization.

Indian Map depicting the forest cover, loss, gain

In the above visualization, we can see green where there are forests, red where there's forest loss,

If we zoom into some portion of the area in the north-eastern region:

Zoom-In portion of the North-Eastern Region

We can also see blue where there are forest gain and magenta where there's both gain and loss. A closer inspection, however, reveals that it's not quite right. Instead of loss being marked as red, it's orange. This is because the bright red pixels mix with the underlying green pixels, producing orange pixels. Similarly, the pixels where there's forest, loss, and gain are pink - a combination of green, bright red, and bright blue. Also, we can see a huge red color mark which depicts that there is huge deforestation or loss in the vegetation area of the north-eastern region and which is also somewhat the area where huge deforestation is taking place in the country.

We can also create a visualization of the area displaying only the vegetation in any portion of the Map with the help of the below code snippet.

Map.addLayer(gfc2019.mask(gfc2019), {
  bands: ['treecover2000'],
  palette: ['000000', '00FF00'],
  max: 100
}, 'forest cover masked');

Let us focus on the north-eastern region.

Vegetation Cover in Assam

In the above visualization, the blue color line which is flowing from east to west is the river Brahmaputra, and the darker black portion depicted resembles a non-forested area or human habitual region. Most of the areas beside the river region are the human habitat region.

With all the above code snippets and visualization, we had a problem with overlaying pixels that caused an unwanted orange color with no meaning that can be fixed by creating separate images or layers for the forest loss, gain, and for both loss and gain. By adding each of these images to the map in the order that's best.

Now We can put everything together with one small difference. Instead of specifying the band's parameter in the `Map.addLayer` call, we will create new images using the `select()` function.

Here's the code snippet:

var treeCover =['treecover2000']);
var lossImage =['loss']);
var gainImage =['gain']);

// Add the tree cover layer in green.
    {palette: ['000000', '00FF00'], max: 100}, 'Forest Cover');

// Add the loss layer in red.
            {palette: ['FF0000']}, 'Loss');

// Add the gain layer in blue.
            {palette: ['0000FF']}, 'Gain');

After clicking on the `Run` button, we will have a visualization similar to the below visuals,

Forest Loss, Gain and Loss--Gain in NE Region

In the above visualization, we can see that three layers of images are layered on top of others, Now we will also be able to see only the area or pixels where there is only forest gain by `Un Ticking` all other layers, in the same manner by unticking other layers. These are the visuals when only one layer is kept selected.

Now let us also have a look at the other layers.

Forest Loss

So, let us first have a look at the forest loss in the above region. Make sure you Untick the other layers and leave the `Loss` layer ticked.

Forest Loss in NE Region

As in our above script, we have dedicated the color `red` to display the forest loss. It is very bad to see that such a huge area of forest is lost.

Forest Gain

Now we can also have a look at the forest gain in the above region. Make sure you Untick the other layers and leave the `Gain` layer ticked.

Forest Gain in NE Region

As we can see there is very less or negligible blue color pixels present in the visualization, but though it depicts that there is a forest or vegetation gain in the NE Region, and that's very good news that in spite of so much deforestation there are some portion or area where there is a gain in vegetation. You can find the entire script here:- Link

Timelapse of NE-Region from 1984-2019

It is also possible to create a time-lapse of any region of portion with the help of a library known as `geemap`. So, to create a time-lapse of India, first, fork this repository and clone it to your local machine. Repo Link:- Link

After cloning it into the local machine move into the examples>notebooks folder and run this below command:(Make sure you have anaconda environment activated)

jupyter-notebook 18_create_landsat_timelapse.ipynb

and then follow the instruction provided in the notebook. In order to create a similar GIF for any of your regions of interest, By following the instruction provided in the notebook, you can create a GIF and also change the label, control the frame rate, change the color pallet, and a lot more can be achieved. If you face the `module not found error` try running this line of code at the foremost:

!pip install geemap

With the help of the library, and the notebook I have managed to create a simple Time-Lapse GIF from the Landsat dataset:

North-East Region(GIF)[1984-2019]

Change in the Land of NE Region(1984-2019)

Labels and Time Stamp can also be added, Which will result in this kind of GIF:

Lansat 8 Image output
For more reference, The entire notebook can be found here:- Link


In this blog/article I have done an analysis of the forest cover change in India. With this analysis, we can get an insight into the deforestation going on in the country and globally. We know that forests are home to most of the earth's terrestrial biodiversity. Yet deforestation and forest degradation continue at alarming rates. So, It should be our responsibility to conserve our forest and vegetation as much as we can and try to plant more trees.

To know more about BridgeConnectBiz, follow us on LinkedIn and also go through the other blogs on this platform to get an insight into the vision of the company.

If you have reached till here than there is a high chance that you have enjoyed reading this article and found it insightful, you can connect with me on:- GitHub & LinkedIn






156 views0 comments

Recent Posts

See All
bottom of page