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.
Metadata
Release files for rio-mbtiles 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rio-mbtiles-1.4.0.tar.gz | 6.1 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rio_mbtiles-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
| rio_mbtiles-1.4.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 20.2 kB
Release files / rio-mbtiles-1.4.0.tar.gz
| Download URL | rio-mbtiles-1.4.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f410e18fe5efb59098ccafd9a9119fda4a33d88150b1b76272c668734f3426a
|
|
BLAKE2b-256 checksum How to use checksums |
e2c032de7f760df0bdc48bf28380740bd4e8ef4f0d60a2a90416b7feee0d4fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / rio_mbtiles-1.4.0-py3-none-any.whl
| Download URL | rio_mbtiles-1.4.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80e7fb36b25d01f97a7a5d9101d16643447f3abc28ff2598ae83318c05acd02d
|
|
BLAKE2b-256 checksum How to use checksums |
9b423a8711590f482285ea22656007e24f9f534332cde3cfad014c66fcf6effa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / rio_mbtiles-1.4.0-py2-none-any.whl
| Download URL | rio_mbtiles-1.4.0-py2-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
53d3865efd57b69bc73f91fddaed78e52321f7fb9de940cde6d160c367a9f09d
|
|
BLAKE2b-256 checksum How to use checksums |
95502c673846e69c52ca9af019b6fd0ea520095b2045ee019c54c66e469eda2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|