1

Does anyone know how to build a mapnik with an ECW driver on Ubuntu.

There is a successfully installed GDAL 2.2.1 with ECW support.

Install ECW 3.3

wget http://www.kyngchaos.com/files/macosxport/libecwj2-3.3-2006-09-06.zip &&\
    unzip libecwj2-3.3-2006-09-06.zip &&\
    wget http://trac.osgeo.org/gdal/raw-attachment/ticket/3162/libecwj2-3.3-msvc90-fixes.patch &&\
    patch -p0< libecwj2-3.3-msvc90-fixes.patch &&\
    wget http://osgeo-org.1560.x6.nabble.com/attachment/5001530/0/libecwj2-3.3-wcharfix.patch &&\
    wget http://trac.osgeo.org/gdal/raw-attachment/ticket/3366/libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch &&\
    cd libecwj2-3.3/ &&\
    patch -p0< ../libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch &&\
    patch -p1< ../libecwj2-3.3-wcharfix.patch &&\
    ./configure &&\
    make &&\
    make install

Compile and install GDAL

wget -c http://download.osgeo.org/gdal/2.2.1/gdal-2.2.1.tar.gz
...
./configure --with-python --with-spatialite --with-pg --with-curl --with-ecw=/usr/local
make
make install
ldconfig

Install mapnik. Im tried:

  1. https://github.com/mapnik/mapnik/wiki/UbuntuInstallation
  2. And that:

    curl -L https://github.com/mapnik/mapnik/releases/download/v3.0.12/mapnik-v3.0.12.tar.bz2 | tar -xj -C /tmp/ && \ cd /tmp/mapnik-v3.0.12 && python scons/scons.py configure && \ cd /tmp/mapnik-v3.0.12 && make JOBS=4 && make install JOBS=4

Result

from mapnik import Gdal
Gdal(file='ololo.ecw', nodata=0, shared=True)
ERROR 4: `ololo.ecw' not recognised as a supported file format.
  • It seems you should configure mapniks build system since it uses its own gdal version. – Majid Hojati Aug 4 '17 at 7:17

Your Answer

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

Browse other questions tagged or ask your own question.