Deploy an Application Including the GDAL Library

The GDAL library is often used in application needing to manipulate geospatial data. This page describes the steps to deploy an application on Scalingo which makes use of the GDAL library.

Install GDAL on a Scalingo Application

To install the GDAL library on a Scalingo application, you need to make use of the APT buildpack. Such a buildpack should be used as part of a multi-buildpack. For instance, if your application is developed using the Python programming language:

$ echo 'https://github.com/Scalingo/apt-buildpack' > .buildpacks
$ echo 'https://github.com/Scalingo/python-buildpack' >> .buildpacks
$ git add .buildpacks
$ git commit -m 'Add multi-buildpack'

You need to instruct the APT buildpack to install the GDAL library. Create a Aptfile at the root of your project with the following content:

gdal-bin
libgdal-dev

Last, set the following environment variables on your application:

PYTHONPATH=/app/.apt/usr/lib/python3/dist-packages/
LD_LIBRARY_PATH=/app/.apt/usr/lib/x86_64-linux-gnu/blas/:/app/.apt/usr/lib/x86_64-linux-gnu/lapack/
PROJ_LIB=/app/.apt/usr/share/proj

Deploy your application, it is ready to use the GDAL library!


Suggest edits

Deploy an Application Including the GDAL Library

©2023 Scalingo