[GEE Basic] Add an Image collection in Google Earth Engine

Table of Contents

Bài viết tiếng Việt ở đây.


In a web browser, go to the Google Earth Engine homepage: https://earthengine.google.com/ Click on Datasets in the upper right corner..

In GEE's data catalog we have many types of data, today we will work with Landsat data.

Clicking on the symbol at the end of this line of code will take us to the sample script in https://code.earthengine.google.com/, written in Javascript language.

If you are not logged in, we will have to log in with a Google account.

Explanation of code

The first line of code: use the 'var' keyword to create a variable called 'dataset', This variable will contain the Landsat 8 Collection 2 Tier 1 calibrated top-of-atmosphere (TOA) reflectance image collection của GEE.

(An image collection is a group of images of the same type in Earth Engine. For example, all Landsat 8 images in GEE are an image collection)

The second line: Filtering images from January 1, 2017 to December 31, 2017.

The third line: Create a variable 'trueColor432' containing true color bands 4, 3 and 2.

The fourth line: Create a variable 'trueColor432Vis' that defines max as 0.4 and min as 0.0.

The fifth line: The 'Map.setCenter' function tells GEE at which coordinates the map should be viewed, with which zoom level.

In the upper left toolbar, switch from the Scripts tab to the Docs tab. Type Map.setCenter into the search bar of Docs → The zoom range is from 0 to 24.

We can change the 3rd parameter of the function, a smaller number to zoom out, a larger number to zoom in.

All parameters are changeable, you can go to the Docs section to read more about the functions used and try changing the parameters.

The final line: using the Map.addLayer function will help put the Landsat image set with channels 4, 3, 2 into the map view, and the displayed value will be limited from min = 0.0 to max = 0.4.

Click the Run button to run the code. The True Color (432) data layer will be added to the map view.

Shorten the code

Instead of creating many different variables, we can shorten this script like this:

You can also try with other data that GEE has available.

Tutorial video:

Leave a Reply

Your email address will not be published. Required fields are marked *