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.

  This command is suited for small to medium (~1 GB) sized sources.

  Python package: rio-mbtiles (https://github.com/mapbox/rio-mbtiles).

Options:
  -o, --output PATH       Path to output file (optional alternative to a
                          positional arg).
  --force-overwrite       Always overwrite an existing output file.
  --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. PNG format required for nodata
                          values to display as transparent.
  --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: 3).
  --src-nodata FLOAT      Manually override source nodata
  --dst-nodata FLOAT      Manually override destination nodata
  --resampling            Resampling method to use. Options within
                          rasterio.enums.Resampling are supported.
                          (default: nearest)
  --version               Show the version and exit.
  --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.4.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distributions

rio_mbtiles-1.4.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

rio_mbtiles-1.4.0-py2-none-any.whl (7.0 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: rio-mbtiles-1.4.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for rio-mbtiles-1.4.0.tar.gz
Algorithm Hash digest
SHA256 8f410e18fe5efb59098ccafd9a9119fda4a33d88150b1b76272c668734f3426a
MD5 263f878e16e3b0aaf9c76fcbd9101cd1
BLAKE2b-256 e2c032de7f760df0bdc48bf28380740bd4e8ef4f0d60a2a90416b7feee0d4fd6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rio_mbtiles-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for rio_mbtiles-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80e7fb36b25d01f97a7a5d9101d16643447f3abc28ff2598ae83318c05acd02d
MD5 25274f35e798363209d7c8adaf94f69e
BLAKE2b-256 9b423a8711590f482285ea22656007e24f9f534332cde3cfad014c66fcf6effa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rio_mbtiles-1.4.0-py2-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15

File hashes

Hashes for rio_mbtiles-1.4.0-py2-none-any.whl
Algorithm Hash digest
SHA256 53d3865efd57b69bc73f91fddaed78e52321f7fb9de940cde6d160c367a9f09d
MD5 35e26ca9e591e66cf15b7142913f42ef
BLAKE2b-256 95502c673846e69c52ca9af019b6fd0ea520095b2045ee019c54c66e469eda2c

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