BergWerkGIS / vtpk2mbtiles

Convert ESRI VTPK into mbtiles
22 stars 9 forks source link
android basemap-at convert docker docker-image dotnet-core esri ios map mapbox mapbox-gl-js mapbox-gl-native mbtiles mbview mvt pbf tiles vector-tile-package vector-tiles vtpk

Convert ESRI's Vector Tile Package (VTPK) to mbtiles

Resulting mbtiles can be used with mapbox-gl-js (Web), mapbox-gl-native (iOS/Android) or offline with QGIS via Vector-Tiles-Reader Plugin.

Disclaimer 1

I don't have access to any ESRI software or data. This is tested with the Austrian basemap.at Verwaltungsgrundkarte Vektor Offline (Beta) Österreich (EPSG:3857) only.

A few parameters are hard coded towards basemap.atas well, as some metadata values in the vtpkg are not correct.

Download vtpk here: https://www.data.gv.at/katalog/dataset/b694010f-992a-4d8e-b4ab-b20d0f037ff0

Disclaimer 2

No magic sauce or reverse engineering in the code, the internals of ESRI cache format are documented here: https://github.com/Esri/raster-tiles-compactcache

Another piece of software that does the same thing: https://github.com/syncpoint/openvtpk

Disclaimer 3

This is a one off proof of concept written months ago, putting it online now for educational purposes, unblocking offline and open source tool use. And free :beers:, maybe. Implementation is quick and dirty. No plans for further development. Feel free to clone, fork, ...

Note

For convenience a docker image is provided. For fast conversion Linux is recommended.

On my laptop:

Usage

vtpk2mbtiles </path/to/extracted/vtpkg/folder> <output> <decompress tiles>

Abort processing with Ctrl+C.

Linux

Windows

Converted mbtiles in mbview:

mbview

mbview