Belgium at 10 m resolution in July 2018

Using the new L3A product in Theia it is possible to make nice cloud-free mosaics from Sentinel-2 imagery. Here is an example for Belgium and the script to do it in your terminal.


Click here to view in full screen.

# download L3A images over Belgium
python -l 'Belgium' -d 2018-07-01 -f 2018-07-31 --level LEVEL3A -a config_theia.cfg
# unzip using GNU parallel
parallel unzip ::: SENTINEL2X_201807*zip
# make a mosaic of each band
# WARNING only works if all images have the same projection otherwise an extra step is required with gdalwarp
parallel gdalbuildvrt {}.vrt SENTINEL2X_201807*/*{}*.tif ::: B2 B3 B4
# stack the band mosaics
gdalbuildvrt -separate B432.vrt B4.vrt B3.vrt B2.vrt
# export as a RGB image at full resolution
gdal_translate -ot Byte -scale 0 2000 B432.vrt B432.tif
# Optionally clip the image using the polygon of the Belgium borders

gdalwarp -dstnodata 0 -q -cutline Belgium.kml -crop_to_cutline B432.tif B432_Belgium.tif
# make a tiled map to display in a browser -z 6-12 B432_Belgium.tif


NB) I used this command to generate the file Belgium.kml from the Eurostat Countries datasets:

ogr2ogr -f KML Belgium.kml -where "NAME_ENGL='Belgium'" CNTR_RG_01M_2016_4326.shp

Posted under: Composite (3A), In English, Sentinel-2


Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>