Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

update rio-tiler dependency!  #9

@vincentsarago

Description

@vincentsarago

We've introduced a lot of breaking changes since rio-tiler==2.0a.11

https://github.com/NASA-IMPACT/dashboard-api-starter/search?q=from+rio_tiler

  • rio_tiler.io.cogeo -> rio_tiler.io.COGReader

# before 
from rio_tiler.io import cogeo
data, mask = cogeo.tile(path, x, y, z)

# now (2.1)
from rio_tiler.io import COGReader
with COGReader(path) as cog:
     img = cog.tile(x, y, z)
  • from rio_tiler.utils import geotiff_options -> 🔪

from rio_tiler.utils import geotiff_options, render

# before 
from rio_tiler.utils import geotiff_options

# now
# This function as removed
bounds = mercantile.xy_bounds(*Tile(x=tile_x, y=tile_y, z=tile_z))
tr = rasterio.transform.from_bounds(*bounds, 256, 256)
options = {"transform": tr, "crs": rasterio.crs.CRS.from_epsg(3857)}
  • from rio_tiler.colormap import get_colormap -> 🔪

from rio_tiler.colormap import get_colormap

# before
from rio_tiler.colormap import get_colormap
colormap = get_colormap(color_map.value)  

# now 
from rio_tiler.colormap import cmap
colormap = cmap.get(color_map.value)
  • rio_tiler.mercator.get_zooms -> 🔪

from rio_tiler.mercator import get_zooms

from rio_tiler.mercator import get_zooms

# before 
from rio_tiler.mercator import get_zooms
minzoom, maxzoom = get_zooms(src_dst)

# now
from rio_tiler.io import COGReader
with COGReader(path) as cog:
     minzoom, maxzoom = cog.minzoom, cog.maxzoom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions