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.0rc3.tar.gz (125.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: rio-tiler-2.0.0rc3.tar.gz
  • Upload date:
  • Size: 125.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for rio-tiler-2.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 239fcbbb1c4693ef6b7b0da328a59e3bda512995313d66acfd634d90bdb14174
MD5 ba6fa3c3adc99fe3afc99187f887b3ff
BLAKE2b-256 7d675b36d224de6511957069da65ec1563b26eddbe0bebd64dff5efc0e2f8758

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