Maps are an essential part of many online tools, user interfaces and products. Third-party services, such as Google Maps API, are often used, but thanks to Docker and OpenStreetMap this is changing now. The open-source OpenMapTiles.org project revolutionises how easy it is to deploy world maps from any infrastructure of choice running Docker. Learn how to launch your own map service with containers, how to turn raw OpenStreetMap data into tiles, how to adjust the look&feel and language of the maps, and how to scale production deployment horizontally with Docker Swarm. The maps are powered by open-source software and open data, without vendor lock-in, and are directly usable in web products, mobile applications and online services.
OpenMapTiles.org project launched in early 2017 and has been already adopted by Siemens, IBM, GeoCaching, Amazon, Bosch, Planet Labs and others.
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
Take Control of Your Maps with Docker
1. Take control of your
maps with Docker
OpenMapTiles Project
Klokan Technologies GmbH
Petr Pridal
Martin Mikita
2. Docker - real life use-cases
Four use-cases for Docker containers:
- Self-hosting world maps
- Scaling of a global map service
- Generating vector tiles (data processing)
- Big data on a cluster (pull job queue)
3. Maps APIs are not for free!
Pay for integration behind login, commercial apps,
use on the intranet, asset tracking (fleet of
vehicles, ships, IoT), more than 25k visitors a day, …
10k+ USD / year + grows with visitors
Limits for offline use, customisation,
no derivative data, redistribution, …
4. Self-hosted world maps
Now possible and easy with
OpenSource + OpenData + Docker
This talk:
Best practice, practical demos,
lessons learned, deployment tips, …
5. World map in containers
Scaling with Docker Swarm
Using the maps (APIs)
Styling the maps
Maps with Docker: Agenda
Generating map tiles
Cluster using Docker
Satellite map & raster tiles
Data packages & hosting
7. Community project, data collected by
volunteers (4 million users), GPS tracks,
government open data, tracing, …
“Wikipedia for maps”
Open Database License (ODbL)
OpenStreetMap
8. 4 billion nodes
450 million ways
5 million relations
SQL database, Postgres + PostGIS, …
Global geographic data
12. OpenMapTiles Open-Source Project
Containerised open-source tools for working with maps
• Processing OSM and other geodata
• Map server software
• Ready to use open map styles
• Schema - structure of vector tiles
• Visual design editor for maps
• Open Mapbox vector tile format
18. Easy-to-use software
Two basic steps:
1. Install docker or docker toolbox
2. Start “openmaptiles-server” container
Available now on Docker Hub and Docker Store
22. Map server in a container
Component structure (monolith / microservices):
• Nginx
• Memcached
• OMT Map Server (or TileServer GL)
The data volume (~60 GBytes for whole world):
• Replicated data (from a snapshot, network FS, copy)
23. Map server in a container
Low hardware requirements:
- VPS with 8 GB RAM and 60 GB disk
- Raster tiles on demand: require higher spec
- Easy to scale (horizontally and vertically)
30. Compatibility
JavaScript API:
- Mapbox GL JS, ArcGIS API for JavaScript, …
- OpenLayers (raster+vector tiles)
- Leaflet (XYZ raster tiles), and many more
Mobile SDKs
- Android and iOS: Mapbox, Mapzen, Carto, …
Desktop software:
- ESRI ArcGIS, QGIS, …
31. Map styles
• Ready to use styles available: just adjust for
your application or business brand
• One style - different outputs (raster, print)
• JSON format - Mapbox open standard:
adopted by ESRI, OpenLayers, etc.
• Visual web editor - for designers
39. Extensible
• Bring in your own business data:
• Style with multiple sources (GeoJSON, VT)
• Pregenerated combined with dynamic servers
(PostServe, GeoServer, MapServer, etc)
• Any coordinate system and map projection
• Amazing visualisations, data driven styling, etc.
• Large number features, heat maps, live interaction.
41. Hack the source code
- OpenMapTiles GitHub repo:
OSM to Postgres to Vector Tiles
- Same principle for custom geodata
- VT Schema: selection of data for zoom levels
- Community driven, support available
- One VT “layer” per folder in the repo
github.com/openmaptiles
43. $ git clone git@github.com:openmaptiles/openmaptiles.git
$ cd openmaptiles
# launch database container
$ docker-compose up -d postgres
# Import data from external sources like Natural Earth
$ docker-compose run import-water
$ docker-compose run import-natural-earth
$ docker-compose run import-lakelines
$ docker-compose run import-osmborder
44. # Download raw OpenStreetMap (planet or extract)
$ wget http://download.geofabrik.de/europe/denmark-latest.osm.pbf -O data/
denmark.osm.pbf
$ docker-compose run import-osm
$ docker-compose run import-sql
# Generating vector tiles
$ docker-compose run generate-vectortiles
46. OpenMapTiles generating on cluster
Entire planet = 126M tiles
(theoretical 360M)
Divide into 64k jobs
Copy PostGIS database
Merge results back together
Stats:
~128 days of CPU time
1 day scaled across
32 machines, 4 cores
Latest data from rendering OMT
47. Worker
Input
Storage
(bucket on S3,
GCS, Swift)
• Lease a job
• Download data
• Process data
(while reporting
progress + log)
• Upload results
• Mark as finished
Job Queue
Output
Storage
(bucket on S3,
GCS, Swift)
Mark finished
LogsMetrics
github.com/klokantech/cloudwrapper
Pull a task
48. Swarm
Kubernetes
Terraform
Worker
Input
Storage
(bucket on S3,
GCS, Swift)
• Lease a job
• Download data
• Process data
(while reporting
progress + log)
• Upload results
• Mark as finished
Job Queue
Output
Storage
(bucket on S3,
GCS, Swift)
Pull a task Mark finished
LogsMetrics
github.com/klokantech/cloudwrapper
49. Processed geodata…
Vector features
- OpenMapTiles: 4 billion features (OSM)
- Regular releases and weekly updates
OpenMapTiles.com
Raster data
- Petabytes of satellite data (for clients)
- USA aerial imagery (NAIP + HRO) 170 TB
MapTiler.com
MapTiler
OpenMapTiles