Created
February 1, 2021 21:21
-
-
Save vincentsarago/a4877c281febc357259f9c2464017a67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rio_tiler.io import COGReader | |
with COGReader("my-tif.tif") as cog: | |
# get info | |
info = cog.info() | |
# get image statistics | |
stats = cog.stats() | |
# get metadata (info + image statistics) | |
meta = cog.metadata() | |
# Read data for a mercator tile | |
tile = cog.tile(tile_x, tile_y, tile_zoom, tilesize=256) | |
# Read part of a data for a given bbox (size is maxed out to 1024) | |
aoi = cog.part([minx, miny, maxx, maxy]) | |
# Read data for a given geojson polygon (size is maxed out to 1024) | |
feat = cog.feature(geojson_feature) | |
# Get a preview (size is maxed out to 1024) | |
preview = cog.preview() | |
# Get pixel values for a given lon/lat coordinate | |
values = cog.point(lon, lat) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment