Skip to main content

Rasterio plugin to read mercator tiles from Cloud Optimized GeoTIFF.

Project description

rio-tiler

rio-tiler

Rasterio plugin to read mercator tiles from Cloud Optimized GeoTIFF.

Test Coverage Package version Conda Forge Downloads Downloads Binder


Documentation: https://cogeotiff.github.io/rio-tiler/

Source Code: https://github.com/cogeotiff/rio-tiler


Install

You can install rio-tiler using pip

$ pip install -U pip
$ pip install rio-tiler --pre # version 2.0 is in development

or install from source:

$ git clone https://github.com/cogeotiff/rio-tiler.git
$ cd rio-tiler
$ pip install -U pip
$ pip install -e .

Overview

rio-tiler is a rasterio plugin which aims to ease the creation of slippy map tile dynamically from any raster data.

from typing import Dict, List

from rio_tiler.io import COGReader
from rio_tiler.models import ImageData

with COGReader("my-tif.tif") as cog:
    # get info
    info: Dict = cog.info()

    # get image statistics
    stats: Dict = cog.stats()

    # get metadata (info + image statistics)
    meta: Dict = cog.metadata()

    # Read data for a mercator tile
    img: ImageData = cog.tile(tile_x, tile_y, tile_zoom, tilesize=256)
    assert img.data
    assert img.mask

    # Read part of a data for a given bbox (size is maxed out to 1024)
    img: ImageData = cog.part([minx, miny, maxx, maxy])

    # Read data for a given geojson polygon (size is maxed out to 1024)
    img: ImageData = cog.feature(geojson_feature)

    # Get a preview (size is maxed out to 1024)
    img: ImageData = cog.preview()

    # Get pixel values for a given lon/lat coordinate
    value: List = cog.point(lon, lat)

Partial reading on Cloud hosted dataset

rio-tiler perform partial reading on local or distant dataset, which is why it will perform best on Cloud Optimized GeoTIFF (COG). It's important to note that Sentinel-2 scenes hosted on AWS are not in Cloud Optimized format but in JPEG2000. When performing partial reading of JPEG2000 dataset GDAL (rasterio backend library) will need to make a lot of GET requests and transfer a lot of data.

Ref: Do you really want people using your data blog post.

Plugins

  • rio-tiler-mvt: Create Mapbox Vector Tile from numpy array (tile/mask)

Mission Specific tiler

In rio-tiler v2 we choosed to remove the mission specific tilers (Sentinel2, Sentinel1, Landsat8 and CBERS). Those are now in a specific plugin: rio-tiler-pds.

Implementations

  • rio-viz: Visualize Cloud Optimized GeoTIFF in browser locally
  • titiler: A lightweight Cloud Optimized GeoTIFF dynamic tile server.
  • cogeo-mosaic: Create mosaics of Cloud Optimized GeoTIFF based on mosaicJSON specification.

Contribution & Development

See CONTRIBUTING.md

Authors

The rio-tiler project was begun at Mapbox and has been transferred in January 2019.

See AUTHORS.txt for a listing of individual contributors.

Changes

See CHANGES.md.

License

See LICENSE.txt

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rio-tiler-2.0.0rc4.tar.gz (125.7 kB view details)

Uploaded Source

File details

Details for the file rio-tiler-2.0.0rc4.tar.gz.

File metadata

  • Download URL: rio-tiler-2.0.0rc4.tar.gz
  • Upload date:
  • Size: 125.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for rio-tiler-2.0.0rc4.tar.gz
Algorithm Hash digest
SHA256 eb87fc07cc15710c046c73b5b95cf67c0a53abf37dd62b31c708e19e060b8dca
MD5 c577a4a3b86df84467d65f849a27c1c7
BLAKE2b-256 4ba01f1fb8265d1dfc2b63c9af6dcb8d183529f7b3cc9d154beec83095312492

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