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.

  An optional fourth alpha band may be copied to the output tiles by using
  the --rgba option in combination with the PNG format. This option requires
  that the input dataset has at least 4 bands.

  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).
  --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.
  -f, --format [JPEG|PNG]         Tile image format.
  --tile-size INTEGER             Width and height of individual square tiles
                                  to create.  [default: 256]
  --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 [nearest|bilinear|cubic|cubic_spline|lanczos|average|mode|gauss|max|min|med|q1|q3]
                                  Resampling method to use.  [default:
                                  nearest]
  --version                       Show the version and exit.
  --rgba                          Select RGBA output. For PNG only.
  --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

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

Uploaded Source

Built Distributions

rio_mbtiles-1.4.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

rio_mbtiles-1.4.2-py2-none-any.whl (8.3 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: rio-mbtiles-1.4.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for rio-mbtiles-1.4.2.tar.gz
Algorithm Hash digest
SHA256 4d102c525547e2c50dbfa3eb17a054053183bac3d27fa296bd050b763fcc882b
MD5 091584588829d4d44eb303f2cae1e77d
BLAKE2b-256 cc512442278e0ebe2092d5f7c1203b3a817aa2121aee5222033ff08d4f8d7fee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rio_mbtiles-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for rio_mbtiles-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c58d27f6db06358643c3af8b99c6b8765fa83a749d654ca68c878ef9777e06c
MD5 c62e08b659f9a90def8a6b906c745e8d
BLAKE2b-256 a9da4fb77b00b38717ccc4466061f1706c6ab7e1ab585599a1c292b0f5039727

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rio_mbtiles-1.4.2-py2-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for rio_mbtiles-1.4.2-py2-none-any.whl
Algorithm Hash digest
SHA256 fee36b887bf3e9afca770f13601f91c4e2894b706e0c929693a62e4f3956c52d
MD5 501a4521b42444813c2e7c1bee6125c9
BLAKE2b-256 eb0a1d235d68d300380ab7556cd117f743703c6eecbf19e49c28f42b2dc6f077

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