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.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distributions

rio_mbtiles-1.4.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

rio_mbtiles-1.4.1-py2-none-any.whl (8.0 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: rio-mbtiles-1.4.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.3

File hashes

Hashes for rio-mbtiles-1.4.1.tar.gz
Algorithm Hash digest
SHA256 5f9ab578e8f792f2ff598073aae9f6bb523cd09786d804edc158dfc2fe0a866d
MD5 f8d921f42f664e6a6f74b9c602db0250
BLAKE2b-256 845fcb8b786558ed8cfae95461bc07add96c3816a361219de4a2284f0089c21e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rio_mbtiles-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.3

File hashes

Hashes for rio_mbtiles-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be08f2d887f810829639ec9592a2683898db0cb6cb784db655e6e7a2257e55b3
MD5 c64ee25b35d916d98f6976e9edb805f3
BLAKE2b-256 d36d58466f8ffd7be2fb696deb19217f190dc702fbcdcf2ba0f3278a1ab8f2e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rio_mbtiles-1.4.1-py2-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/2.7.15

File hashes

Hashes for rio_mbtiles-1.4.1-py2-none-any.whl
Algorithm Hash digest
SHA256 e70c5072aed870c1c1d8860e13b38111d0406ce4126eb682e88ceca5961caf50
MD5 15fe9155f7b3ede7400db8a73d44acdc
BLAKE2b-256 f7b99521b21bdece189938dbb8d0cc4107565a5e1cf9cb99a6b3fe53f44451e0

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