Skip to content
Self hosted maps, MBTiles key value storage and server
Go JavaScript HTML CSS Makefile Shell Dockerfile
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd static + musl Mar 17, 2020
loglevel
server added key authentication Mar 10, 2020
storage cbor v2 and optimization Mar 13, 2020
testdata 1st import Mar 10, 2020
.drone.yml 1st import Mar 10, 2020
.gitignore added automap generation Mar 12, 2020
.golangci.yml 1st import Mar 10, 2020
LICENSE Initial commit Mar 9, 2020
Makefile static + musl Mar 17, 2020
README.md docs Mar 12, 2020
automap.sh rm build file after automap Mar 13, 2020
go.mod cbor v2 and optimization Mar 13, 2020
go.sum cbor v2 and optimization Mar 13, 2020
maps.csv country l9 are useless size too close to l10 Mar 17, 2020

README.md

kvtiles

kvtiles is a web server to embed and serve maps. Free map for all!

Regions are precomputed, simply pull the image and you are good to go.

Using the MVT format extracted from MBTiles, kvtiles is using a key value storage to speed up queries.

In short this project provides self hosted map tiles.

Docker & Kubernetes

Main goal of kvtiles is to be run in Docker/Kubernetes.

You can browse all the different regions and levels via kvtiles docker tags

 docker run --rm -it -p 8080:8080 akhenakh/kvtiles:us-9-latest

Then point your browser to http://yourdockerip:8080/static/

An example deployment for kubernetes is located in cmd/kvtilesd.

APIs

Tiles are available at /tiles/{z:[0-9]+}/{x:[0-9]+}/{y:[0-9]+}.pbf, an optional key URL param can be passed to secure access to your tiles server, (use the tilesKey option).

Metrics are provided via Prometheus at http://host:httpMetricsPort/metrics.

A debug visual map is available at http://host:httpAPIPort/static/.

Health status is provided via gRPC host:healthPort or via HTTP http://host:httpAPIPort/healthz.

A http://host:httpAPIPort/version is giving you running version but also information on the dataset.

Application usage

To transform an MBTiles into an embedded DB use mbtilestokv

Usage of ./cmd/mbtilestokv/mbtilestokv:
  -centerLat=48.8: Latitude center used for the debug map
  -centerLng=2.2: Longitude center used for the debug map
  -dbPath="./map.db": db path out
  -logLevel="INFO": DEBUG|INFO|WARN|ERROR
  -maxZoom=9: max zoom used for the debug map
  -tilesPath="./hawaii.mbtiles": mbtiles file path

To serve the DB use kvtilesd

Usage of ./cmd/kvtilesd/kvtilesd:
  -allowOrigin="*": Access-Control-Allow-Origin
  -dbPath="map.db": Database path
  -healthPort=6666: grpc health port
  -httpAPIPort=8080: http API port
  -httpMetricsPort=8088: http port
  -logLevel="INFO": DEBUG|INFO|WARN|ERROR
  -tilesKey="": A key to protect your tiles access
You can’t perform that action at this time.