Easy way to overlay population density in your vector tile based maps. The vector tiles show population density from Gridded Population of the World (GPW) v4 on the basis of small polygons. The polygons not only count the population density but also styling indicators that show relative importance on higher zoom levels.
🌐 Check the demo at naturalearthtiles.org
📂 Download the vector tiles from the releases page.
You can use mbview to take a look at the MBTiles vector tiles locally.
The entire project is structured components using Docker containers to work together. Ensure you meet the prerequisites.
- Install Docker
- Install Docker Compose
Start up the PostgreSQL database with the PostGIS extension.
docker-compose up -d postgres
Now download the GeoTIFF
from the GPW v4 datasets
and put the unpacked ZIP
file into the ./data
folder.
Run the import script which will polygonize and import the GWP data into PostGIS.
docker-compose run import-gwp
Import the required database schema (views, prepared tables and helper functions).
docker-compose run db-schema
Export the vector tiles for the planet (can take up to 15min).
The exported vector tiles are stored in data/gpw.mbtiles
.
docker-compose run export-vectortiles
To visualize and work with the vector tiles you can spin up Mapbox Studio
in a Docker container and visit localhost:3000
.
docker-compose up mapbox-studio
The raster tiles are exported directly from Mapbox Studio from the raster-datasource
. This process is not automated yet.
The produced vector tiles are made available under the Public Domain Dedication and License v1.0 whose full text can be found at: http://www.opendatacommons.org/licenses/pddl/1.0/.
The source code is Copyright (c) Lukas Martinelli under MIT as defined in License.