Skip to main content

User friendly Rasterio plugin to read raster datasets.

Project description

rio-tiler

rio-tiler

User friendly Rasterio plugin to read 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


Description

rio-tiler was initially designed to create slippy map tiles from large raster data sources and render these tiles dynamically on a web map. Since rio-tiler v2.0, we added many more helper methods to read data and metadata from any raster source supported by Rasterio/GDAL. This includes local and remote files via HTTP, AWS S3, Google Cloud Storage, etc.

At the low level, rio-tiler is just a wrapper around the rasterio and GDAL libraries.

Features

  • Read any dataset supported by GDAL/Rasterio

    from rio_tiler.io import Reader
    
    with Reader("my.tif") as image:
        print(image.dataset)  # rasterio opened dataset
        img = image.read()    # similar to rasterio.open("my.tif").read() but returns a rio_tiler.models.ImageData object
    
  • User friendly tile, part, feature, point reading methods

    from rio_tiler.io import Reader
    
    with Reader("my.tif") as image:
        img = image.tile(x, y, z)            # read mercator tile z-x-y
        img = image.part(bbox)               # read the data intersecting a bounding box
        img = image.feature(geojson_feature) # read the data intersecting a geojson feature
        img = image.point(lon,lat)           # get pixel values for a lon/lat coordinates
    
  • Enable property assignment (e.g nodata) on data reading

    from rio_tiler.io import Reader
    
    with Reader("my.tif") as image:
        img = image.tile(x, y, z, nodata=-9999) # read mercator tile z-x-y
    
  • STAC support

    from rio_tiler.io import STACReader
    
    with STACReader("item.json") as stac:
        print(stac.assets)  # available asset
        img = stac.tile(  # read tile for asset1 and indexes 1,2,3
            x,
            y,
            z,
            assets="asset1",
            indexes=(1, 2, 3),  # same as asset_indexes={"asset1": (1, 2, 3)},
        )
    
        # Merging data from different assets
        img = stac.tile(  # create an image from assets 1,2,3 using their first band
            x,
            y,
            z,
            assets=("asset1", "asset2", "asset3",),
            asset_indexes={"asset1": 1, "asset2": 1, "asset3": 1},
        )
    
  • Xarray support (>=4.0)

    import xarray
    from rio_tiler.io import XarrayReader
    
    ds = xarray.open_dataset(
        "https://pangeo.blob.core.windows.net/pangeo-public/daymet-rio-tiler/na-wgs84.zarr/",
        engine="zarr",
        decode_coords="all",
        consolidated=True,
    )
    da = ds["tmax"]
    with XarrayReader(da) as dst:
        print(dst.info())
        img = dst.tile(1, 1, 2)
    

    Note: The XarrayReader needs optional dependencies to be installed pip install rio-tiler["xarray"].

  • Non-Geo Image support (>=4.0)

    from rio_tiler.io import ImageReader
    
    with ImageReader("image.jpeg") as src:
        im = src.tile(0, 0, src.maxzoom)  # read top-left `tile`
        im = src.part((0, 100, 100, 0))  # read top-left 100x100 pixels
        pt = src.point(0, 0)  # read pixel value
    

    Note: ImageReader is also compatible with proper geo-referenced raster datasets.

  • Mosaic (merging or stacking)

    from rio_tiler.io import Reader
    from rio_tiler.mosaic import mosaic_reader
    
    def reader(file, x, y, z, **kwargs):
        with Reader(file) as image:
            return image.tile(x, y, z, **kwargs)
    
    img, assets = mosaic_reader(["image1.tif", "image2.tif"], reader, x, y, z)
    
  • Native support for multiple TileMatrixSet via morecantile

    import morecantile
    from rio_tiler.io import Reader
    
    # Use EPSG:4326 (WGS84) grid
    wgs84_grid = morecantile.tms.get("WorldCRS84Quad")
    with Reader("my.tif", tms=wgs84_grid) as src:
        img = src.tile(1, 1, 1)
    

Install

You can install rio-tiler using pip

python -m pip install -U pip
python -m pip install -U rio-tiler

or install from source:

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

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

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

This version

8.0.9

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rio_tiler-8.0.9-py3-none-any.whl (277.4 kB view details)

Uploaded Python 3

File details

Details for the file rio_tiler-8.0.9.tar.gz.

File metadata

  • Download URL: rio_tiler-8.0.9.tar.gz
  • Upload date:
  • Size: 181.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.7.3"},"implementation":{"name":"CPython","version":"3.14.0"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.6.0 1 Oct 2025","python":"3.14.0","system":{"name":"Darwin","release":"24.6.0"}} HTTPX2/2.3.0

File hashes

Hashes for rio_tiler-8.0.9.tar.gz
Algorithm Hash digest
SHA256 47c1ec986312e9a3c9082d3b1aa92e1cd7b659ec2cd4768e40a4ba9715225dfa
MD5 fe8de16d68b1e305cf8793b074900f3a
BLAKE2b-256 24fe6aea1b3a32efa16db59201db857b77b37715b791d5eb3132501998c22530

See more details on using hashes here.

File details

Details for the file rio_tiler-8.0.9-py3-none-any.whl.

File metadata

  • Download URL: rio_tiler-8.0.9-py3-none-any.whl
  • Upload date:
  • Size: 277.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.7.3"},"implementation":{"name":"CPython","version":"3.14.0"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.6.0 1 Oct 2025","python":"3.14.0","system":{"name":"Darwin","release":"24.6.0"}} HTTPX2/2.3.0

File hashes

Hashes for rio_tiler-8.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6303f1aa92d4ed4b4230dc71e7b4d61f17c056546ff95a56d9c0a50b069215d2
MD5 9c92d126830272c4c96254948414fe90
BLAKE2b-256 0ef4c3cb0ce3691eb7d485c1f3cf2e343d3ce4cc4fdc3cd300d3945e234bb906

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page