Skip to main content
Offline MBTiles Layers

The best way is to learn how to create MB Tiles.

Cory MacVie avatar
Written by Cory MacVie
Updated over 2 weeks ago

Fulcrum leverages the MBTiles format for offline map layers. MBTiles files are essentially SQLite databases containing tiles and metadata tables for storing tilesets.

Fulcrum currently only supports raster tilesets. The MBTiles file container can also be used with vector tilesets, but these are not supported in Fulcrum. Be sure your MBTiles file contains only raster tiles for use in Fulcrum.

MBTiles files can be loaded directly from your mobile device or uploaded to Fulcrum for use on the web. Managing Member Permissions is possible in all uploaded layers. These layers can be downloaded on mobile devices to work offline.

Below are some useful tools for generating MBTiles from local raster files, GIS datasets, and remote tile servers.

MapTiler Desktop

MapTiler is a free tool for converting raster images generated in GIS, AutoCAD, etc. into the MBTiles format. If you have a GeoTIFF or JPEG2000 file, this is a great tool for converting it for use in Fulcrum. MapTiler also has built in georeferencing, making it easy to position images that may not be referenced.

QGIS 3.8+

QGIS, the popular free and open source Geographic Information System, now supports directly generating raster XYZ tiles, including MBTiles, from the QGIS map canvas. This is the best way to style your GIS data (raster and/or vector) and export an MBTiles map for use in Fulcrum. More information is available on our blog.

GDAL

The open source Geospatial Data Abstraction Library (GDAL) can transform raster images into the MBTiles format. The following commands convert a GeoTIFF dataset to MBTiles and add overviews.

$ gdal_translate my_dataset.tif my_dataset.mbtiles -of MBTILES
$ gdaladdo -r average my_dataset.mbtiles 2 4 8 16

Landez

Landez is a Python library that manipulates tiles, builds MBTiles, does tiles compositing and arrange tiles together into single images. The example below fetches tiles from a NYC tile server and generates an MBTiles file for zoom levels 16-18 for an area around Columbia University.

import logging
from landez import MBTilesBuilder

mb = MBTilesBuilder(
tiles_url="https://maps.nyc.gov/xyz/1.0.0/photo/2018/{z}/{x}/{y}.png8",
filepath="nyc-columbia.mbtiles"
)
mb.add_coverage(
bbox=([-73.9737267047167,40.80240696594497,-73.94969411194324,40.815367424893566]),
zoomlevels=[16,17,18]
)
mb.run()

Uploading MBTiles Layers to Fulcrum

Once you have your MBTiles file, you can create a new layer right from the Web app following the instructions described in the following article:

It is also possible to add your MBTiles file directly to your mobile devices. To learn more about how to do this, please check out the article that corresponds to your device type.

More Resources

Did this answer your question?