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 <https://github.com/mapbox/rasterio#installation>, 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.1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distributions

rio_mbtiles-1.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

rio_mbtiles-1.1.1-py2-none-any.whl (11.3 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: rio-mbtiles-1.1.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rio-mbtiles-1.1.1.tar.gz
Algorithm Hash digest
SHA256 11f47970dcb6c76dfee78b60acf29c2bcd4c694ba5e01054267d407b8a622ce8
MD5 711ec9f9333d3758cb636b1d23bbecc1
BLAKE2b-256 c9e1d6f2a0e7fd450f40afca2aa7e35d2d1b7b290650a5777805d00633c6768a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rio_mbtiles-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ebe80f1b28a3e49a60ca06d71fd33c5bdc3b610c6434176be5b2374f0ddc568
MD5 6d423e2347437de82daa077015c3ec75
BLAKE2b-256 bdaa6e1be58787c22e21ea555306c5fbedf42187cfdee95096bb278d3b9bc469

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rio_mbtiles-1.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 03cd78cc6a8479f07fa2b9da0ac44d36c2a89c37aeed34c1c074e356449c8985
MD5 7f41ad5660fa6e1621a65e3ca0cfd516
BLAKE2b-256 4bd1c383f7c65f7c6e21eb704362d6721b9c49c798408bc2acf4c53757587319

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