MapTiler Engine Pro plan includes a command-line utility that provides access to its full functionality from the terminal. The Enterprise plan lets you run it also in Docker and use it on basically any Linux distribution in a matter of a few simple commands. This article will show you how to do it.
MapTiler Engine is a command-line interface for MapTiler Engine Pro. It gives you access to the full potential of the GUI application from the command line. This makes it possible to integrate MapTiler Engine into more complex geodata processing pipelines.
The bare minimum to render a map to a folder with MapTiler Engine is this command:
maptiler-engine -o output_directory input_file.ext
To process multiple files at once, just specify them one after another:
maptiler-engine -o output_directory input1.ext input2.ext input3.ext
maptiler-engine without any arguments or using the
-help switch will print out all available usage options. For more details on advanced usage of MapTiler Engine, please have a look at the command reference guide.
Running in Docker
Alongside every release of MapTiler Engine, we also release a MapTiler Engine Docker image. This is a very convenient solution to using MapTiler Engine on cloud computing platforms such as Google Compute Engine or Amazon EC2, available in the Enterprise plan.
All released MapTiler Engine Docker images are available in the MapTiler Docker Hub repository.
The most basic command to run MapTiler Engine in Docker would look like this:
docker run -ti --rm -v $(pwd):/data maptiler/engine maptiler-engine -help
Running this command will print the MapTiler Engine usage help in your terminal. Let’s now break it down and explain its subsequent parts:
docker run- creates a Docker container layer based on the specified image.
-ti- enables an interactive shell so you can use
bashinside the created container.
--rm- tells Docker to automatically remove the container upon exiting.
-v $(pwd):/data- maps the current working directory to the
/datadirectory inside the Docker container. This directory is writable, and all relative paths and bash autocomplete from your local machine are available. The rendering results will persist in the working directory when Docker exits.
maptiler/engine- the name of the Docker image. Providing just the image name will pull the latest version from the repository. In case you need to use an older version, use
:<version>after the image name. For example, to use version 11.2, type
maptiler-engine -help- this is where you provide the actual commands for MapTiler Engine.
Using your MapTiler Engine Enterprise license key
Executing the command as explained above will run MapTiler Engine in demo mode. Demo mode has all the features of the Enterprise version, but the output tiles will have an embedded watermark. To use your purchased MapTiler Engine Enterprise license key, you need to pass it to Docker using the
MAPTILER_LICENSE environment variable. This is done by adding the
-e MAPTILER_LICENSE=<license_key> parameter to the command.
A complete command to render a map from an input image would look like this:
docker run -ti --rm -v $(pwd):/data -e MAPTILER_LICENSE=<license_key> maptiler/engine maptiler-engine -o outputdir input.tif
For the time being, running MapTiler Engine in Docker supports only online activation via environment variable. The software will be automatically deactivated upon exiting.
To increase ease of use, you can create a
bash alias to run MapTiler Engine in Docker:
alias maptiler-engine="docker run -ti --rm -v $(pwd):/data -e MAPTILER_LICENSE=<license_key> maptiler/engine maptiler-engine"
Then, to process your geodata, just run:
maptiler-engine -o outputdir input.tif
In this article, we have presented MapTiler Engine and its basic usage. We have also shown you how to properly run MapTiler Engine in Docker and use your purchased MapTiler Engine Pro license with it.
MapTiler Engine product page
MapTiler Engine Manual
MapTiler Docker Hub repository
Docker reference documentation
Please sign in to leave a comment.