6

Sentinel-2 images are usually provided in JPEG2000 format inside a zip-file with accompanying metadata.

A driver has already been coded and will be shipped with GDAL 2.1: GDAL Sentinel-2 driver

As Even Rouault mentioned on the GDAL mailing list:

You can also compile the driver code as a plugin against older GDAL releases (works at least with 1.10 or later)

I would like to use this driver on a set of Win_x64 machines but have no means of compiling it myself.

Is there a way to obtain the Sentinel-2 driver as a plugin for GDAL under Windows? (possibly like the plugins provided on GISinternals)?

edit: For legacy reasons I am not yet able to switch to GDAL 2.1 so I am explicitly looking for a driver for GDAL 1.11.

7

The original answer is out of date. Don't use this for installing gdal now. The latest stable version is 2.2 and is easily installed from gisinternals.com or via conda.

Original out of date answer

Rather than building as a plugin for an older release, you could download and use a GDAL 2.1 development snapshot build from GISinternals that contains the new Sentinel-2 driver. Both the MSVC 2012 and MSVC 2013 builds have it compiled in.

gdalinfo --version
GDAL 2.1.0dev, released 2015/99/99

gdalinfo --formats|findstr /I sentinel
SAFE -raster- (rov): Sentinel-1 SAR SAFE Product
SENTINEL2 -raster- (rovs): Sentinel 2

Edit: per Kersten's comment, below is how I added the 2.1.0dev python bindings to a python 2.7 virtualenv. This involves downloading and unzipping/extracting the standalone GDAL build and the Python 2.7 bindings from GISInternals and modifying relevant environment variables.

cd c:\temp
c:\Python27\ArcGISx6410.2\python.exe -m virtualenv venvtest
cd venvtest

SET GDALDIR=%CD%\release-1700-x64-gdal-mapserver

REM Download complete GDAL/MS zip, not the core installer
powershell -command "(New-Object System.Net.WebClient).DownloadFile(\"http://download.gisinternals.com/sdk/downloads/release-1700-x64-gdal-mapserver.zip\", \"release-1700-x64-gdal-mapserver.zip\")"
REM Extract the zip
"C:\Program Files\7-Zip\7z.exe" x -orelease-1700-x64-gdal-mapserver release-1700-x64-gdal-mapserver.zip

REM Python bindings included in the above are for Python 3.4. If you use 2.7, do this
powershell -command "(New-Object System.Net.WebClient).DownloadFile(\"http://download.gisinternals.com/sdk/downloads/release-1700-x64-gdal-mapserver/GDAL-2.1.0.win-amd64-py2.7.msi\", \"GDAL-2.1.0.win-amd64-py2.7.msi\")"
REM Extract the 2.7 py bindings MSI (note this doesn't actually "install" anything)
start /wait msiexec /a "%CD%\GDAL-2.1.0.win-amd64-py2.7.msi"  /qn TARGETDIR="%CD%\GDAL-2.1.0.win-amd64-py2.7"
REM replace the 3.4 bindings with the 2.7 ones
xcopy /Y GDAL-2.1.0.win-amd64-py2.7\Lib\site-packages\osgeo\*.pyd %GDALDIR%\bin\gdal\python\osgeo

SET path=%WINDIR%;%WINDIR%\system32
call %GDALDIR%\SDKShell.bat setenv
set PYTHONPATH=%PYTHONPATH%;C:\Temp\venvtest\release-1700-x64-gdal-mapserver\bin\gdal\python\osgeo
call Scripts\activate.bat

python -c "from osgeo import gdal; print gdal.__version__"

2.1.0dev
  • Thanks for the heads up. For legacy reasons I am not yet able to switch to >2.0. If switching to GDAL 2.1 is my only chance I guess I'll finally have to take the plunge. – Kersten Jan 14 '16 at 8:44
  • @Kersten, you can easily run multiple versions of GDAL. No need to switch completely. – user2856 Jan 14 '16 at 22:34
  • And can I install Python bindings for both, maybe by means of a venv? If that would be possible I'll gladly mark your answer as accepted. – Kersten Jan 16 '16 at 17:17
  • @Kersten, yes you can. It involves some fiddling but can be done. I've edited my answer to show how I did this. – user2856 Jan 17 '16 at 23:14
  • Great explanation! – Kersten Jan 19 '16 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.