

ImageCollection( "COPERNICUS/S2") // Filter by metadata var filtered = s2. You can also use the drawing tools to draw a geometry for filtering.Īfter applying the filters, you can use the size() function to check how many images match the filters. Filter by location: You can select the subset of images with a bounding box, location or geometry using the ee.Filter.bounds().Filter by date: You can select images in a particular date range using filters such as ee.Filter.date().You can filter by PATH/ROW values, Orbit number, Cloud cover etc. Filter by metadata: You can apply a filter on the image metadata using filters such as ee.Filter.eq(), ee.Filter.lt() etc.We will learn about 3 main types of filtering techniques Select a filter and then run the filter() function with the filter parameters. There are many types of filter functions, look at ee.Filter. We use filters to select the appropriate images. Most applications require a subset of the images. The entire collections are not very useful. The collection contains all imagery ever collected by the sensor. Replace the X and Y coordinates with the coordinates of your city and click Run to see the images of your city. The function takes the X coordinate (longitude), Y coordinate (latitude) and Zoom Level parameters.
#HTML INSPECTOR HOMEWORK CODE#
In the code snippet, You will see a function Map.setCenter() which sets the viewport to a specific location and zoom level. Click Run and you will see the image tiles load in the map. Click the Copy Code Sample button and paste the code into the code editor. This snippet is a great starting point for your work with this dataset. Visit the Sentinel-2, Level 1C page and see Explore in Earth Engine section to find the code snippet to load and visualize the collection. Search for the Sentinel-2 Level 1C dataset and you will find its id COPERNICUS/S2_SR. You can load a collection by searching the Earth Engine Data Catalog for the ImageCollection ID. An ImageCollection is a dataset that consists of images takes at different time and locations - usually from the same satellite or data provider.

Most datasets in Earth Engine come as a ImageCollection.
