This Sentinel-1 image capturing the Mississippi River has been processed into a GIS-compatible format and imported for ease of use. Credit: Copernicus Sentinel data 2017, processed by ESA.

How to Geocode Sentinel-1 with QGIS 3.X

This Sentinel-1 image capturing the Mississippi River has been processed into a GIS-compatible format and imported for ease of use. Credit: Copernicus Sentinel data 2017, processed by ESA.

Background

Sentinel-1 Ground-Range Detected (GRD) products are available for download from ASF’s Vertex data portal. These Level-1 GRD products are georeferenced to geographic coordinates using the Earth ellipsoid WGS84, but are still in SAR geometry.

By following this data recipe, users will learn how to geocode Sentinel-1 GRD products in QGIS 3.X using the Warp (Reproject) tool. QGIS version 2.18 is the current long term release, and while the basic approach is still the same in QGIS 3.X, the interface is slightly different. For instructions specific to QGIS 2.18, refer to ASF’s Geocoding Sentinel-1 GRD Products using QGIS 2.18 Data Recipe.

Why Geocode?

Once extracted from their zip file, GRD products downloaded from Vertex can be viewed directly in QGIS without any additional steps. The georeferenced TIFF files include the information necessary to allow most GIS software platforms to project the data layers on the fly to match the other layers in your GIS, so you can easily visualize the data without additional effort. If you are visualizing the images outside of a GIS platform, however, the images may appear reversed or rotated. To display the images as you would expect to see them, the image must be transformed from its SAR geometry into a map projection. When working with SAR data, this process is called “Geocoding”.

Geocoding the imagery will ensure not only that the image displays at the correct location on the Earth’s surface in any given application, but that the image will also display as expected when it is viewed outside of a spatially-enabled framework (i.e. north is up, features are not stretched or reversed in unexpected ways).

Even when working within a GIS, if you want to go beyond simply visualizing the data and perform analysis or geoprocessing functions using the GRD granule, it should be geocoded to a map projection first. In QGIS, this can be accomplished by using the Warp (Reproject) tool. If you would prefer to use GDAL or ArcGIS to geocode, refer to ASF’s Data Recipes for geocoding products within each of these platforms.

Note that using different geocoding techniques/options may result in slight differences in the output products. While one output is not necessarily “better” than another, it is a good idea to be consistent when generating geocoded products for use in the same project, especially if you are looking at imagery from one location through time. The best approach to use will vary depending on the goals and preferences of the user.

Geocoding is NOT Terrain Correction

It is important to understand that this geocoding process does not involve terrain correction. To match the imagery to actual features on the earth and correct for distortions caused by the side-looking geometry of SAR data, you must perform Radiometric Terrain Correction (RTC) instead. This will be particularly important in areas of high topographic variation. Refer to ASF’s Data Recipes on Radiometric Terrain Correction, or contact ASF to learn about other resources for RTC processing.

Prerequisites

Materials List:

Note to Mac users: Take care with your QGIS installation. Consult the README file in the installation folder to ensure that you install the required software packages in the correct order and add any additional paths required to access GDAL-based tools.

  • Earthdata login credentials
    • If you do not already have an Earthdata account, visit the Earthdata website to register for this free service
  • Download Sentinel-1 GRD data using Vertex
    • You may use this Sample Granule
    • When downloading from Vertex, you must either already be logged in to Earthdata, or you will be prompted to enter your Earthdata Login username and password before the download will begin.

Viewing Sentinel-1 Data in QGIS 3.X

The default settings for viewing rasters in QGIS 3.X are different than in QGIS 2.18, where the default settings are fairly reasonable for displaying the Sentinel-1 imagery without having to make any changes.

When you view a GRD granule or a projected product in QGIS 3.X, it may appear very dark, or even completely black. In most cases, you will need to adjust the stretch settings in order to see features. An approach that works fairly well for most of the GRDs, regardless of the range of pixels, is to set the Min/Max stretch to two mean standard deviations.

    1. Add your image to your QGIS canvas.
    2. Right-click on the layer in the Layers panel and select Properties.
    3. Click the Symbology tab of the Properties, and select Stretch to MinMax from the dropdown menu for Contrast enhancement.
    4. Expand the Min/max values settings, and select the Mean +/- standard deviation option (the default number is 2, which works well in most cases)
    5. Click the Apply button to view how the settings will impact the image. Adjust the number of SDs if necessary, or the Min and Max values as desired. Click OK.
Setting Stretch to 2 Mean SDs

Geocoding Steps

Download Sentinel-1 Data

Using Vertex, download a Sentinel-1 GRD granule. Note that you will need to log in with your Earthdata credentials before the download will begin. The download will be served as a .zip file.

Extract the .tif File with the Data of Interest

Within the downloaded zip file is a base directory with the name of the granule followed by a .SAFE extension. This SAFE structure contains a number of directories and files, and the data images are saved as georeferenced .tiff files in the folder named “measurement.”

The image we are interested in for this tutorial is the co-polarized GRD:

s1a-iw-grd-vv-20170819t001029-20170819t001054-017985-01e2e8-001.tiff

Contents of the GRD SAFE file, within the downloaded .zip file

Note: If you are using a different granule than the sample provided, the co-pol image may be labeled hh instead of vv.

Use your preferred method to extract the desired file from the zipped folder, or refer to the suggestions below.

Unzipping with OS X or Linux

Using the Unix unzip utility (also works with OS X) in the command terminal, you can extract just the file you want from the downloaded zip folder (filename .zip) with a command like this:

unzip <filename.zip> */measurement/*vv*.tiff

This will extract just the VV polarized image from this zip package. If you know which file you want, this is usually much faster than extracting the whole zip file.

Unzipping with Windows 10

If you unzip the entire folder with the standard Windows 10 zip utility, there is a good chance that you will exceed the number of characters allowed in a Windows directory path. You can either save the zipped contents to a different folder, or you can just extract the single file as follows:

    1. Double-click the .zip file in your Downloads folder, double-click the .SAFE file, double-click the measurement folder and highlight the desired .tiff file.
    2. Under the Compressed Folder Tools menu (which appears when you browse into a zip file), click the Extract button, and select the Extract To… option.
The compressed Folder Tools menu within the measurement folder in the downloaded .zip file.
    1. Select one of the recent folders (which will start the extraction immediately), or use the Choose Location option at the bottom of the dialog box to navigate to the desired extraction location and click the Copy button to extract the file.
    2. The single .tiff file will be extracted from the zipped folder structure.

You may also wish to download the 7-Zip File Manager for a more flexible zip utility than the standard Windows zip utility, especially if you have a Windows operating system earlier than Windows 10.

Project your Product

    1. Open QGIS 3.X
    2. In the QGIS Raster menu, select Projections — Warp (Reproject)
    3. Enter the parameters into the dialog window.

Notes: If you chose to download a granule other than the sample granule, you will need to determine an appropriate projection system to use for that location. If you have other imagery for that same area of interest, you may want to set the Target coordinate reference system (CRS) of your warped granule to match the projection system of your other imagery.

If you add an image that is already in the desired projection to the QGIS Layers Panel first, the projection of that image will be registered as the Project CRS and be included in the dropdown list of recently used projections.

      1. If you’ve added your input raster to your QGIS canvas, select it from the dropdown list of layers; otherwise, click the Select button next to the field, browse to the image to be projected, and click the Open button. (a)
      2. Select the coordinate system of the input raster. Note that the layers listed in the Input layer dropdown box all have the European Petroleum Survey Group (EPSG) code of their coordinate system listed, so if your input layer is in your canvas, you can see that the source CRS is EPSG 4326. If it is not listed in the Source CRS dropdown menu, click the CRS button next to the field to open the Coordinate Reference System Selector. WGS 84 should be listed in the Recently used coordinate reference systems list. Highlight it and click OK. (b)
      3.  To select the output coordinate system, click the CRS button next to the field to find and select your desired projection. (c)

The sample granule provided is located in Louisiana, which is UTM Zone 15N (EPSG 32615).

  • If you know the EPSG number of the desired projection, you can type that number into the Filter field and press Enter to locate the projection. Highlight the desired CRS and click the OK button.
  • If you would like your image to be output in the same projection as another image that is not currently in your project canvas, navigate to that image in the QGIS Browser panel, right-click on the layer, and select Properties. Scroll down to the CRS and copy the EPSG code to paste into the CRS filter in the CRS Selector.
      1. Select the Bilinear option from the dropdown for a Resampling method to use. (d)
      2. Set the Nodata value for output bands to 0. (e)
        • This option sets any padding pixels added around the edges during the warp process to No Data instead of 0 values.
        • This option also sets any of the incoming 0 values from the original GRD to Nodata. See No Data Pixels section below for more detail on Nodata Settings.
QGIS 3.X Warp (Reproject) dialog window
Coordinate Reference System Selector
Layer Properties, including the CRS
      1. If you would like to define the pixel size of the output, you can enter that value here. Only one value is accepted; the output pixels are square. Units are the output file projection units (i.e. meters for UTM). (f)
      2. Enter the path and filename of the output image, or use the Browse button and select Save to File… to navigate to a target directory and enter the filename. (g)
      3. Note that as you enter the parameters, the GDAL/OGR console pane displays the compiled call. In earlier versions of QGIS (including the long-term release version 2.18), the user was able to make code tweaks directly in this pane if there were additional options desired. With the change to 3.0, this functionality was lost. If you want to access other options not offered in the QGIS 3.X Warp tool interface, consider using the OSGeo4W Shell that installs with QGIS. Refer to ASF’s Geocoding Sentinel-1 GRD Products using GDAL for more information on using the gdalwarp command to geocode. (h)
    1. Click the Run in the Background button to generate the projected output.

No Data Pixels

If you set the Nodata value for output bands, no additional 0-value padding pixels were added to the image during projection. In addition, any incoming 0-value pixels are also converted to Nodata. This is not what happens when using gdalwarp directly, or when using QGIS 2.18 to reproject the image; there is a -srcnodata option that must be applied to change the incoming 0-values in these workflows.

If you do not apply the Nodata setting, the projected image will retain the 0-value pixels from the original GRD, and add additional pixels to pad the image out to a rectangular extent in the new projection. You can set the 0-value pixels to transparent later by right-clicking the layer in the QGIS Layer panel and selecting Properties: click Transparency, type 0 in the Additional no data value field, click OK to apply the settings.

Note: There still may be artifacts along the edges of the projected image, even with all the 0-value pixels being changed to Nodata. ESA has used different approaches over time to deal with edge artifacts, and only with IPF version 2.90 (March 2018) did ESA start masking all of the artifacts at the image edges with 0 values. When the nodata option is applied to newer images, the output is a nice clean image, but older images will likely have some leftover garbage pixels even with the 0-values removed. Refer to ESA Documentation for more information on pixel masking.

Different Nodata Settings. Series 1 is an image processed by ESA with IPF 2.82, Series 2 is an image processed by ESA with IPF 2.91. In each series, A is the original GRD with edge pixels, B is the projected GRD with no Nodata settings applied, C is the projected image with Nodata set to 0 in the QGIS 3.X Warp tool.

Comments are closed.