GEE Tutorials

Google Earth Engine Tutorial: Google Earth Engine 9 Image Filtering Part – 2 Path and Row

Credit: Youtube Channel “Terra Spatial, Advanced techniques for filtering image collections including path/row selection”

You can see all the tutorials from here: Techgeo Academy.

Google Earth Engine (GEE) is a powerful platform that allows GIS specialists to analyze and visualize geospatial data efficiently. One crucial step in working with remote sensing data in GEE is image filtering, which helps narrow down the data to meet specific criteria for your analysis. In this tutorial, we will focus on filtering images using path and row numbers, which are commonly used with satellite data such as Landsat. Path and row numbers define the specific tile of the Earth’s surface that a satellite image covers, enabling more targeted data retrieval. The tutorial will guide you through using the `filterMetadata()` function in GEE to filter images by path and row for a given satellite dataset.

Before starting, it is important to note that path and row numbers are specific to certain satellite missions. For example, Landsat 8 and 9 use a standard global tile system consisting of 233 paths and 120 rows, while other satellites like Sentinel-2 use different systems. The metadata properties for these parameters are usually named ‘PATH’ and ‘ROW’, but it’s critical to check the documentation for the specific dataset being used. Let’s now go through the process of filtering an image collection based on these parameters.

Let’s consider a sample dataset in GEE, such as Landsat 9 Surface Reflectance (`LANDSAT/LC09/C02/T1_L2`). To filter the images in this collection by path and row, we would use the `filterMetadata()` function, specifying the ‘PATH’ and ‘ROW’ properties with the appropriate comparison operators and values. The `filterMetadata()` function in GEE takes three arguments: the metadata property name, a comparison string, and the value. In this case, you would use ‘equals’ as the comparison string followed by the specific path and row numbers.

Here is a step-by-step example of filtering an image collection by path and row:

  1. Open the Google Earth Engine Code Editor and start a new script.
  2. Define the image collection from the desired dataset (for example, Landsat 9).
  3. Use the `filterMetadata()` function to filter the collection by path and row. Here’s a code snippet to help you understand:

var imageCollection = ee.ImageCollection('LANDSAT/LC09/C02/T1_L2');
var filteredCollection = imageCollection
  .filterMetadata('PATH', 'equals', 43)
  .filterMetadata('ROW', 'equals', 30);

This script retrieves an image collection from the Landsat 9 dataset and filters it to only include images with path number 43 and row number 30, allowing for focused spatial analysis in that specific tile of the Earth. You can adjust the path and row numbers according to your area of interest.

It’s also possible to apply additional filters alongside path and row filtering. For instance, you can filter images based on cloud cover, sensor date, or other relevant data properties. This is done by chaining multiple `filterMetadata()` functions, each specifying a different metadata property and condition. Let’s say we want to include images from path 43 and row 30 with less than 10% cloud cover:


var filteredCollection = imageCollection
  .filterMetadata('PATH', 'equals', 43)
  .filterMetadata('ROW', 'equals', 30)
  .filterMetadata('CLOUD_COVER', 'less_than', 10);

Furthermore, you can combine `filterMetadata()` with `filterDate()` to ensure that you only get images within a specific date range. This is especially useful for time-series analysis or when ensuring comparability across images by focusing on data from a consistent period. You can achieve this by appending the `filterDate()` function after applying the path and row conditions.

Once the image collection is filtered according to your parameters, you can proceed to map and visualize the imagery, or further analyze it for your GIS project. Always remember to print or visualize your filtered collection using functions like `print()` or `Map.addLayer()` to verify that you’ve retrieved the right dataset.

In summary, path and row filtering is a fundamental technique for GIS specialists using Google Earth Engine, particularly when working with satellite images that are stored in a tile-based format. By using the `filterMetadata()` function and specifying the ‘PATH’ and ‘ROW’ parameters, we can efficiently focus on the exact location we want and add additional filters based on criteria such as cloud cover or dates. This approach greatly enhances the precision of your analysis and the relevance of the data used.

What is the purpose of image filtering in Google Earth Engine?

Image filtering is useful in any analysis involving historical imagery, as it allows you to focus on the data that’s most relevant to your research goals. By filtering out unnecessary data, you can reduce processing time, get more accurate results, and focus specifically on the condition of the Earth’s surface you want to study.

How can I filter out images based on a specific date range in Google Earth Engine?

You can utilize the filterDate() function. This function takes two arguments: the start date and the end date of the date range you’re interested in. Be sure to use the correct date format, which is in the format of ‘YYYY-MM-DD’.

What is the name of the function to filter images based on metadata like cloud cover?

You can use the filterMetadata() function. This function is used to filter images based on their metadata properties. In the case of cloud cover, the metadata property 'CLOUD_COVER' is used. The function takes three arguments: the first is the metadata property name, the second is the comparison operator (like 'less_than'), and the third is the value to compare with.

Can I apply multiple filters to an image collection in Google Earth Engine?

Yes, you can apply multiple filters by chaining the filterMetadata() and filterDate() functions together. Since Google Earth Engine processes collections in a functional programming style, you can add multiple filters as needed by stacking these calls.

In what way can I filter images by both path and row in Google Earth Engine?

Images captured by satellites such as Landsat are divided into different path and row numbers, allowing you to partition the data by location. In order to filter images by path and row, you can use the filterMetadata() function, and specify the metadata properties 'PATH' and 'ROW' in the function’s parameters.

For example, you can use code like this:


var collection = ee.ImageCollection('LANDSAT/LC09/C02/T1_L2')
  .filterMetadata('PATH', 'equals', 43)
  .filterMetadata('ROW', 'equals', 30);

This filters the collection to only include images from path 43 and row 30.

Similar Posts

Leave a Reply

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