Global Population Density Data Processing with MapTiler Engine
This tutorial will explore using the MapTiler Engine, a powerful tool for processing global population data and generating a pyramid of tiles in the MBTiles format.
In this tutorial, we will work with pre-processed population data. For information on processing population data, please take a look at the tutorial on preparing gridded raster data for visualization. Once you have processed your data in MapTiler Engine, you can follow this tutorial on how to visualize it with the MapTiler SDK: Visualize and animate the evolution of population data
The most efficient way to tile a GeoTiff into Web Mercator, regardless of its original projection, is by using the MapTiler Engine. Once installed, it can be used through a graphic interface (GUI) and a command-line interface (CLI). The CLI provides more expert-level customizations and encodings, but for this tutorial, we will focus on the GUI due to its simplicity and user-friendliness.
Follow the steps below to convert a GeoTiff, export it as mbtiles, and host it on MapTiler Cloud using the MapTiler Engine. For this example, we will use population data from 2000.
-
Load the density_2000_sqrt.tif GeoTiff file into MapTiler Engine.
-
Once the file is loaded into MapTiler Engine, you can view its extension, size, etc. Press the Export button to begin the conversion process.
-
When you press the Export button, an alert message indicates that we must specify the data scaling values for each image band.
-
Indicate the minimum and maximum values for each band. In this case, we can leave the values that already appear by default. The values that we will use are Min = 0 and Max = 255 for each band. For the alpha channel, select the option to ignore the alpha channel.
-
Select the output format. For this example, we will select the MBTiles format.
-
Select the format of the images that we are going to generate. Select PNG as the output format without transparency. We can also adjust the zoom levels we want to generate in our pyramid of tiles. For the example data, a maximum zoom level of 7 is fine.
-
Select the name and location of the output file.
-
Computing. The MapTiler Engine shows us information about the progress of the rendering process.
-
Preview the result. Once the process is finished, we can see the final result on a map.
-
Upload the result to the MapTiler Cloud.
-
Choose the title we want to give to our tileset.
-
The upload is complete. The result can be viewed directly in the My Tiles section of your MapTiler Cloud account.
If you prefer the MapTiler Engine CLI instead of the GUI, here is an example of the command to generate a .mbtiles.
maptiler-engine -f png -o density_2000_sqrt-png.mbtiles density_2000_sqrt.tif -zoom 0 7 -data_scale 255
Once the file is generated, you can upload it directly to the MapTiler Cloud. (Check out the tutorial on How to upload map tiles to MapTiler Cloud.) If you prefer to automate the entire process, use the MapTiler Cloud Upload API.
To learn all the MapTiler Engine options via CLI, check out the MapTiler Engine Manual.
We will have to repeat this process for the years 2005, 2010, 2015 and 2020.
At the end of the process, all the new raster tilesets are available under the My tiles section in your MapTiler Cloud space, so you can get some info and learn their tileset IDs (useful for the Visualize and animate the evolution of population data tutorial).
Check out the Visualize and animate the evolution of population data tutorial to visualize the evolution of population data on a web page using the MapTiler SDK JS.
Related guides
- Add a basemap from MapTiler Cloud to MapTiler Engine
- Add a basemap from MapTiler Server to MapTiler Engine
- Amazon S3 map hosting
- Coordinate reference systems
- Custom map with OpenLayers for Drupal CMS
- Custom Retina scale
- Custom watermark
- Disabled network adapters
- Estimated rendering time
- Folder vs. MBTiles vs. GeoPackage