User:Ff5722/Using Sentinel-2 imagery

From OpenStreetMap Wiki
Jump to navigation Jump to search

Sentinel-2 satellite data is licenced suitably to be used as background for tracing or any other purpose for OSM (licence). The best resolution available is 10 m, this is enough to trace major roads, rivers, lakes, railways etc. Pretty much the entire world is covered, and imagery is very recent (several captures per month, as recent as last week), however it can be covered in clouds, so in some cases, it is needed to use imagery of a few months old.

To use the imagery in an OSM editor, there are two steps:

  1. Download the raw data and render into GeoTIFF image files
  2. Serve imagery as a tileserver to your OSM editor.

Preview imagery

broom

This article or section may contain out-of-date information: You can now create now rate-limited WMTS and WMS services from free Copernicus accounts
If you know about the current state of affairs, please help keep everyone informed by updating this information. (Discussion)

The data is not available in a viewable image format for free accounts, therefore you need to process it first. However, Sentinel-hub offers a service to preview the tiles. Note that WMS service is only available for paid accounts, and do not trace directly from their website because their licence is CC-BY-NC 4.0, which is not allowed for OSM use. You can use it as an aid to view which area needs updating, or which date has good cloudless capture. https://apps.sentinel-hub.com/sentinel-playground/

Rendering images

You can either use QGIS or ESA's own software to render the data. I recommend QGIS as it is much more versatile.

Using QGIS

  1. Install QGIS from https://qgis.org/en/site/forusers/download.html
  2. Download data from browser.dataspace.copernicus.eu/. You need to register a (free) account to download data.
    1. Login to your account
    2. Click 'Find products for current view' or select an area on the map (the ⬟ icon on the right) and search.
    3. Filter the results to show only Sentinel-2 captures, set cloud cover limits.
    4. If the download does not work, it means the granule is not processed yet, it will also say 'offline'. You will have to add it to cart and refresh the page later. The tile will normally be available for download within one hour from the cart symbol in the search box.
    5. Download the zip package (usually around 1 GB).
  3. In QGIS, open the Data Source Manager (press CTRL+L), select the zip package and add. (thanks to User:InsertUser for the simplified guide) [1]
  4. Select the layer ID containing bands B2, B3 and B4 (natural colour).
  5. The image will be rendered in QGIS
  6. Save as GeoTIFF or directly render to tiles (See User:Ff5722/How to create and host tilesets from GeoTIFF images)

Using ESA SNAP software

  1. Download SNAP and the Sentinel-2 toolbox
  2. Download data from scihub.copernicus.eu. You need to register a (free) account to download data. Login with your account, select an area on the map (try to keep the selected area small, it's best to download one tile at once) and search. The results with the green tag S2A MSI are the ones you will want. It's recommended to filter the results to show only Sentinel-2 captures, and sort by cloud cover. Download the zip package (usually around 700 MB).
  3. Process data in SNAP (tutorial). It's recommended to place the downloaded granule on an SSD if available, to speed up the process (lots of R/W operations). Unzip the compressed folder, and open the XML file in the top level (e.g. MTD_MSIL1C.xml). Once it's visible in the left pane, right-click to open RGB view, the three colour bands will be pre-selected. Simply click OK and wait for the RGB image to be generated.Use the colour manipulation tool in the bottom left pane to ensure good contrast of roads etc.
  4. Export processed image from SNAP. Right-click on the image, click export. Choose 'export full scene' and 'full resolution' and for filetype geoTIFF. It will take several minutes to finish on most computers.

Serving imagery

See User:Ff5722/How to create and host tilesets from GeoTIFF images