Skip to main content

A Rasterio plugin command that exports MBTiles

Project description

https://travis-ci.org/mapbox/rio-mbtiles.svg

A plugin for the Rasterio CLI that exports a raster dataset to the MBTiles (version 1.1) format. Features include automatic reprojection and parallel processing.

Usage

$ rio mbtiles --help
Usage: rio mbtiles [OPTIONS] INPUT [OUTPUT]

  Export a dataset to MBTiles (version 1.1) in a SQLite file.

  The input dataset may have any coordinate reference system. It must have
  at least three bands, which will be become the red, blue, and green bands
  of the output image tiles.

  If no zoom levels are specified, the defaults are the zoom levels nearest
  to the one at which one tile may contain the entire source dataset.

  If a title or description for the output file are not provided, they will
  be taken from the input dataset's filename.

Options:
  -o, --output PATH       Path to output file (optional alternative to a
                          positional arg for some commands).
  --title TEXT            MBTiles dataset title.
  --description TEXT      MBTiles dataset description.
  --overlay               Export as an overlay (the default).
  --baselayer             Export as a base layer.
  --format [JPEG|PNG]     Tile image format.
  --zoom-levels MIN..MAX  A min..max range of export zoom levels. The default
                          zoom level is the one at which the dataset is
                          contained within a single tile.
  --image-dump PATH       A directory into which image tiles will be
                          optionally dumped.
  -j INTEGER              Number of worker processes (default: 1).
  --help                  Show this message and exit.

Performance

The rio-mbtiles command is suited for small to medium (~1 GB) raster sources. On a MacBook Air, the 1:10M scale Natural Earth raster (a 21,600 x 10,800 pixel, 700 MB TIFF) exports to MBTiles (levels 1 through 5) in 45 seconds.

$ time GDAL_CACHEMAX=256 rio mbtiles NE1_HR_LC.tif \
> -o ne.mbtiles --zoom-levels 1..5 -j 4

real    0m44.925s
user    1m20.152s
sys     0m22.428s

Installation

If you’ve already installed Rasterio, installation is just pip install rio-mbtiles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rio-mbtiles-1.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distributions

rio_mbtiles-1.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

rio_mbtiles-1.2.0-py2-none-any.whl (11.5 kB view details)

Uploaded Python 2

File details

Details for the file rio-mbtiles-1.2.0.tar.gz.

File metadata

File hashes

Hashes for rio-mbtiles-1.2.0.tar.gz
Algorithm Hash digest
SHA256 dae6c854421d1034d17e88e1fd240f3fa716117aee927708c7cf56ccccb7bef0
MD5 51ae47ac81f35e603ae9afb0f8961d8f
BLAKE2b-256 65c4157ff24cabedb756cd501c30e61a248e8345da503e0dfced6bc11253f258

See more details on using hashes here.

File details

Details for the file rio_mbtiles-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rio_mbtiles-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac0d550194cfe95ae805ca456afeac31a7c37aa626fb32936b15b36412dba0d1
MD5 2099d65a154170291466b654600e3e05
BLAKE2b-256 6a0f6faa7036432db013d7bd3414645240981f6329a2290a31d06d3cd2265694

See more details on using hashes here.

File details

Details for the file rio_mbtiles-1.2.0-py2-none-any.whl.

File metadata

File hashes

Hashes for rio_mbtiles-1.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 759176b286dc4727fd19555e58fae82f2fc7cfd15078c17a578e2d7955d2db8a
MD5 9ddfba428191ca53074a6079d980bda8
BLAKE2b-256 350661e6cbd53b72de5279aa599d27becee7d94f87ae588606fb34d1ebea511e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page