When conducting analysis using imagery over a large area and an extended period, the initial step always involves aggregating the data into either an image composite or an image cube with a specified time interval. The support of STAC in ArcGIS Pro 3.2 facilitates working with various STAC-compliant datasets in the cloud, such as the open datasets in AWS or Microsoft Planetary Computer. To optimize the process, you can create a virtual machine in the cloud close to these datasets for direct access and process. If you plan to use data on the Microsoft Planetary Computer, refer to the AMPC solution. This blog guides you through the end-to-end process of creating cloud-free image cubes from STAC-enabled open datasets in the cloud. If you already have the data on your machine, you can skip the first two steps and start from step 3.
Step 1: Create a STAC connection file
Use the STAC Connection wizard to create the STAC connection file by providing the STAC API and the cloud store connections to the datasets within the STAC collection. In this blog, this STAC API was used to access USGS’s Landsat Collection 2 datasets in AWS, as illustrated below:
Notes:
- The cloud store connection file to the Landsat 2 collection was created using the Create Cloud Store Connection tool.
- If you use AMPC , you don’t have to create connection files as connection files to all datasets are provided with the setup.
Step 2: Search STAC items
Launch the Search STAC item pane from STAC connection file. Here you can define your search criteria including time, extent, and attribute. In this example we set a time range from 5/15/2022 to 10/15/2022, defined an extent using Oregon state boundary, and applied attribute filter for cloud cover less than 30%. For the details on using STAC in ArcGIS Pro, you can refer to this blog.
Step 3: create a mosaic dataset
To generate a mosaic dataset from the search result, choose the “Add Mosaic Dataset” option, which activates the “Add Raster to Mosaic Dataset” tool. The search result is automatically configured as the input for the tool. Next, select the Landsat 8 raster type and a Multiband template containing the surface reflectance bands along with a QA band. Repeat the same process for Landsat 9 images.
We now have a mosaic dataset containing 229 scenes.
Notes:
- If your image data is stored locally, set the input by providing the folder path.
- For users of AMPC solution, take advantage of the provided scripting tools to streamline mosaic dataset creation.
If you want to aggregate the images per year to create a multidimensional raster, run the Build Multidimensional Info tool to construct multidimensional information for the mosaic dataset. In this example, the “AcquisitionDate” field was employed as the time dimension, and the “Tag” field was designated for the variable name.
Step 4: Define processing templates
Creating a cloud-free image cube from the mosaic dataset involves several processes, all of which can be defined using raster functions:
- A raster function template that removes clouds and shadows for each item in the mosaic dataset. For Landsat 8, the template includes extracting the QA band, creating a QA mask using the Transpose Bits function, where bit 0,1,2,3, and 4 (defined in Landsat product document) represent Fill, Dilated Cloud, Cirrus, cloud, and Cloud shadow, and then applying the mask using the Clip function.
- A Geometric Median that composes overlap pixels within a specified time range. Alternatively, you can use Cell Statistics function to simply calculate a mean or a median.
- A Clip function that trims the mosaic dataset based on the area of interest, using a polygon feature class outlining the Oregon state boundary.
- A Raster Collection function that combines above three functions. Define a processing interval if creating a multidimensional raster.
Save this function as a function template for use in the next step.
Step 5: Generate the image cube
Use Generate Raster From Raster Function tool to apply the aforementioned processing template to the mosaic dataset. Since the input and function parameters are defined in the processing template, no additional parameters are required other than specifying the input processing template and output CRF. Check the “Process as Multidimensional” option if creating a multidimensional raster.
Below is the cloud free image cube created from Landsat Collection 2 data in AWS.
We completed the entire workflow without using a single line of code. However, if you prefer Python-based approach, you can refer to the code provided in this blog.
Check out this blog to see how the resulted image composite gets used in the aboveground biomass prediction.
Article Discussion: