Skip to main content

Rasterio plugin to read mercator tiles from Cloud Optimized GeoTIFF.

Project description

rio-tiler

rio-tiler

Rasterio plugin to read web map tiles from raster datasets.

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 -U rio-tiler

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 that aims to ease the creation of slippy map tiles dynamically from any raster source.

from typing import Dict, List

from rio_tiler.io import COGReader
from rio_tiler.models import ImageData, Info, Metadata, ImageStatistics

with COGReader("my-tif.tif") as cog:
    # get info
    info: Info = cog.info()
    assert info.nodata_type
    assert info.band_descriptions

    # get image statistics
    stats: ImageStatistics = cog.stats()
    assert stats.min
    assert stats.max

    # get metadata (info + image statistics)
    meta: Metadata = cog.metadata()
    assert meta.statistics
    assert meta.nodata_type
    assert meta.band_descriptions

    # 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
    values: List = cog.point(lon, lat)

Plugins

rio-tiler-pds

rio-tiler v1 included several helpers for reading popular public datasets (e.g. Sentinel 2, Sentinel 1, Landsat 8, CBERS) from cloud providers. This functionality is now in a separate plugin, enabling easier access to more public datasets.

rio-tiler-mvt

Create Mapbox Vector Tiles from raster sources

Implementations

rio-viz

Visualize Cloud Optimized GeoTIFFs locally in the browser

titiler

A lightweight Cloud Optimized GeoTIFF dynamic tile server.

cogeo-mosaic

Create mosaics of Cloud Optimized GeoTIFF based on the mosaicJSON specification.

Contribution & Development

See CONTRIBUTING.md

Authors

The rio-tiler project was begun at Mapbox and was transferred to the cogeotiff Github organization in January 2019.

See AUTHORS.txt for a listing of individual contributors.

Changes

See CHANGES.md.

License

See LICENSE

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

Uploaded Source

File details

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

File metadata

  • Download URL: rio-tiler-2.0.0.tar.gz
  • Upload date:
  • Size: 126.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for rio-tiler-2.0.0.tar.gz
Algorithm Hash digest
SHA256 84892b56e0b7a114d70ecc238f82cd461db43fd1559d7cebcb9e26934ad74e35
MD5 abf5217110658d18e4f10f88453f3f12
BLAKE2b-256 c9145d4f85dabfbee6362d2aabc8944fbb91541ba33764a206052fa99937340e

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