Exercise 3.1: Filter
Completion requirements
The collection contains all imagery ever collected by the sensor. The entire collections are not very useful. Most applications require a subset of the images. We use filters to select the appropriate images. There are many
types of filter functions, look at ee.Filter...
module to see all available filters. Select a filter and then run the filter()
function with the filter parameters.
We will learn about 3 main types of filtering techniques
- Filter by metadata: You can apply a filter on the image metadata using filters such as
ee.Filter.eq()
,ee.Filter.lt()
etc. You can filter by PATH/ROW values, Orbit number, Cloud cover etc. - Filter by date: You can select images in a particular date range using filters such as
ee.Filter.date()
. - Filter by location: You can select the subset of images with a bounding box, location or geometry using the
ee.Filter.bounds()
. You can also use the drawing tools to draw a geometry for filtering.
After applying the filters, you can use the size()
function to check how many images match the filters.
The code is available in this repository under Module3/Exercise1
Your task after the exercise
Modify the script of exercise 3.1 in such a way that:
- it uses the location of your own area of interest
- it shows the band combination R = NIR, G = RED, B = GREEN
- it only shows results for the Sentinel 2A satellite without Sentinel 2B. For this you need to add a filter. Hint 1: use the 'SPACECRAFT_NAME' metadata property. Hint 2: Use the ee.Filter.eq() filter
Last modified: Monday, 19 July 2021, 3:38 PM