FME Version
Files
-
- 10 KB
- Download
Introduction
In this exercise, we will read in Landsat-8 data and provide some tips on reading enormous satellite datasets.
When reading satellite image formats, the FeatureReader is typically a better option than the traditional readers. Imagery providers have huge global datasets and reading using the traditional readers requires typing in the coordinates of a bounding box, which is not very convenient. With the FeatureReader, we can use a feature's geometry to initiate reading of a particular area, which is much easier.
Landsat has multiple bands in different spectral ranges. Each band is stored separately. Bands 2, 3, and 4 represent Blue, Green, and Red respectively. Band 8 is a panchromatic image (grayscale) and can be used for pansharpening operations (increasing resolution of the lower-res color bands). Here is an example of the files which the Landsat-8 on AWS reader reads.
Step-by-step Instructions
1. Create Search Envelope
Since we want to pull a satellite image from a particular location, we can create a search envelope. Add a Creator to the canvas and then add a 2DBoxReplacer. The 2DBoxReplacer takes max and min values for both x and y coordinates to create a box. In the parameters, set the following:
- Min X Value: -123
- Min Y Value: 49.1
- Max X Value: -123.25
- Max Y Value: 49.3
Optionally, you could create published parameters for each of these values or use values for another location on earth. These values are for Vancouver, Canada.
2. Set Coordinate System
If we were to run the workspace right now, the values we enter into the 2DBoxReplacer don’t have any real meaning without a coordinate system attached, so let’s fix that. Add a CoordinateSystemSetter to the canvas and connect it to the 2DBoxReplacer. In the parameters, set the Coordinate System to LL84 which is a latitude/longitude coordinate system.
3. Add a Landsat-8 on AWS Feature Reader
Add a FeatureReader transformer to the canvas and connect it to the CoordinateSystemSetter. In the parameters, set the Format to Landsat-8 on AWS, then click on Parameters.
In the parameters, disable Worldwide Reference System. Since we are using a search envelope we don’t need to use the Landsat Worldwide Reference System (WRS), but if you would like to use this filtering feature, see Landsat’s documentation. Next, set the Maximum Percent Cloud Cover to 60. Then expand Schema Attributes and for Additional Attributes to Expose, select fme_basename. Click OK once.
Back in the Landsat-8 on AWS Feature Reader parameters, click on the ellipsis for Feature Types to Read and select Preview_Large. This will return a preview of the Landsat image with all of the bands. After you have found the image you wish you use, you can add additional bands of interest. Next, set the Spatial Filter to Bounding Boxes OGC - Interset, this will use the box we created with the coordinates to filter out the Landsat images from AWS.
4. Run the Workspace
Run the workspace with Feature Caching Enabled and view the output of the Preview_Large output port. Depending on the day, the results may vary for what images you get back. You can change the cloud cover tolerance or the date if you are not getting any results.
This particular workspace run returned four Landsat images, highlight the one of interest, then in the Feature Information Window copy the fme_basename.
5. Test for fme_basename
Add a Tester to the canvas and connect it to the Preview_Large output port on the FeatureReader. In the parameters create the test:
fme_basename = <landsat file name>
Now continue your workspace however you wish using the selected Landsat image.
Comments
0 comments
Please sign in to leave a comment.