Coder Social home page Coder Social logo

spatialhast / rio-mbtiles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapbox/rio-mbtiles

0.0 2.0 0.0 854 KB

A plugin command for the Rasterio CLI that exports a raster dataset to an MBTiles 1.1 SQLite file

License: MIT License

Python 100.00%

rio-mbtiles's Introduction

rio-mbtiles

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, installation is just pip install rio-mbtiles.

rio-mbtiles's People

Contributors

geowurster avatar sgillies avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.