This article is going to show you how you can use MapTiler Engine to preprocess your imagery in GeoTIFF format and host it on your own server using MapTiler server.
The use case: You need a lot of good and detailed imagery for your project. You need to ensure that all members of your team (or all your customers - you name it) get access to it without the hassle of searching through tile indexes and browsing folders on network drives. As the size of your imagery collection grows it starts to be too difficult to address these needs. MapTiler Server is the perfect solution for such a situation. It allows you to manage your imagery on a single location in a centralized way. Together with MapTiler Engine, the MapTiler server allows you to preprocess your imagery files into a structure that allows serving it very fast at any zoom level, any area of interest. Users only need network connection and software compliant with WMTS or MapboxGL Styles specification.
This article is written for Ubuntu Linux, but you can use any other operating system including Windows or macOS. Both MapTiler Server and MapTiler Engine can run on these operating systems.
The Use Case
Let's describe the use case and explain how MapTiler tools fit in.
We want to provide users (6) with access to imagery that is stored in files (1), for example, GeoTIFFs
To serve any area of interest on any zoom level fast and smoothly, we use MapTiler Engine (2) to convert imagery files into a zoomable map stored in
*.mbtilesfile format, which is optimized for fast retrieval.
*.mbtileswill be stored on storage (3) which is accessible to the MapTiler server.
We will use MapTiler server (4) to serve preprocessed imagery via the Web Map Tile Service (WMTS) or MapboxGL style (and/or TileJSON) so that users (6) can access the imagery using their software.
The most simpler setup is to install the MapTiler Server on a single server within the organization and allow users within the same organization to access it directly. However, in most cases, It is necessary to set up additional security measures, HTTPS, serve multiple services on a single machine, load-balancing, rate-limiting, or other advanced features. In such a case, you can also install the firewall and the reverse proxy
Installing The MapTiler Engine
Download the installer from the MapTiler website - Engine section for your platform. We use Ubuntu for this article so we download the Linux DEB package and install it as follows:
Converting GeoTIFF to
We will launch the MapTiler Engine by simply typing into the terminal:
Then we will drag our GeoTIF image (it is possible to drag multiple images as well) over the MapTiler Engine window. The image will be loaded and showed on the background map. To position the image correctly in the geographic space, it is necessary to specify the coordinate reference system. Our image is in British National Grid (EPSG:27700).
In the next step, MapTiler Engine will ask us in which format we want to convert our file. We will choose MBTiles and Global Mercator as the output coordinate system.
MapTiler Deskop will process the file and store it in the location we have specified. Now we can go on, install the MapTiler Server and configure it to serve the file we have just created.
Installing The MapTiler Server
Download the installer from the MapTiler website - server section for your platform. We use Ubuntu for this article so we download the Linux DEB package and install it as follows:
After the installation, we can simply launch the server by typing:
You can also configure your server to launch MapTiler Server as a system service. The server will start and you should see output similar to this one:
Notice the generated admin password. You should configure the server to use a password of your choice as well as use the port which fits your environment. Please refer to the installation guide to get more information. To keep things simple in this article, we use generated password.
Add the Imagery to MapTiler Server
Open your browsers on
http://localhost:3650 and log in using the Admin password.
In the left menu, select Tiles and upload your mbtiles file. If you have access to the server, you can also copy the file into the MapTiler Server data folder. You can see which folder it is on the Tiles screen.
After the file has been uploaded it takes a while until the Engine processes the file. When everything is ready, you should see the image:
This screen also shows correct URLs to access the imagery from outside, such as WMTS or MapboxGL style.
Access the imagery
You can access the imagery you have just published in any software which implements WMTS client, Mapbox GL style viewer, and so on. For example, you can connect to the imagery from QGIS using the WMTS capabilities document:
And enter the URL:
From now on, you have access to the imagery without the need to download it locally.
MapTiler Server and Engine make it easy to organize and publish custom imagery data (such as GeoTIFFs) and allow users to access the imagery in a very comfortable way. And as you could see, the installation and use of this software are super easy, which helps to concentrate on your business rather than wasting time on infrastructure problems.