Landsat Collection 2
Readers¶
rio_tiler_pds.landsat.aws.landsat_collection2.LandsatC2Reader(input, tms=<TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>, minzoom=5, maxzoom=12, reader=<class 'rio_tiler.io.rasterio.Reader'>, reader_options=NOTHING, bucket='usgs-landsat', prefix_pattern='collection02/level-{_processingLevelNum}/{category}/{_sensor_s3_prefix}/{acquisitionYear}/{path}/{row}/{scene}/{scene}')
AWS Public Dataset Landsat Collection 2 COG Reader.
tms(TileMatrixSet, optional) —input(str) — Landsat 8 sceneid.minzoom(int, optional) —maxzoom(int, optional) —reader_options(dict, optional) —reader(type of Reader, optional) —bucket(str, optional) —prefix_pattern(str, optional) —
bands(tuple) — list of available bands.bounds—crs—input(any) — input data.maxzoom(int) — Dataset's Max Zoom level (default is 12).minzoom(int) — Dataset's Min Zoom level (default is 5).reader_options(dict, option) — options to forward to the reader. Defaults to{}.scene_params(dict) — scene id parameters.stac_item—tms(morecantile.TileMatrixSet, optional) — TileMatrixSet grid definition. Defaults toWebMercatorQuad.
>>> with LandsatC2Reader('LC08_L2SR_093106_20200207_20201016_02_T2') as scene:
print(scene.bounds)
>>> with LandsatC2Reader('LC08_L1TP_116043_20201122_20201122_02_RT') as scene:
print(scene.bounds)
__attrs_post_init__()— Fetch productInfo and get bounds.__enter__()— Support using with Context Managers.__exit__(exc_type,exc_value,traceback)— Support using with Context Managers.feature(shape,bands,expression,**kwargs)(rio_tiler.models.ImageData) — Read and merge parts defined by geojson feature from multiple bands.get_geographic_bounds(crs)(float, float, float, float) — Return Geographic Bounds for a Geographic CRS.get_geometry()— Fetch geometry info for the scene.info(bands,**kwargs)(dict) — Return metadata from multiple bands.parse_expression(expression)(tuple) — Parse rio-tiler band math expression.part(bbox,bands,expression,**kwargs)(rio_tiler.models.ImageData) — Read and merge parts from multiple bands.point(lon,lat,bands,expression,**kwargs)(PointData) — Read a pixel values from multiple bands.preview(bands,expression,**kwargs)(rio_tiler.models.ImageData) — Read and merge previews from multiple bands.statistics(bands,expression,categorical,categories,percentiles,hist_options,max_size,**kwargs)(dict) — Return array statistics for multiple assets.tile(tile_x,tile_y,tile_z,bands,expression,**kwargs)(rio_tiler.models.ImageData) — Read and merge Web Map tiles multiple bands.tile_exists(tile_x,tile_y,tile_z)(bool) — Check if a tile intersects the dataset bounds.
get_geographic_bounds(crs) → (float, float, float, float)
Return Geographic Bounds for a Geographic CRS.
crs(CRS) —
tile_exists(tile_x, tile_y, tile_z)
Check if a tile intersects the dataset bounds.
tile_x(int) — Tile's horizontal index.tile_y(int) — Tile's vertical index.tile_z(int) — Tile's zoom level index.
True if the tile intersects the dataset bounds.
__enter__()
Support using with Context Managers.
__exit__(exc_type, exc_value, traceback)
Support using with Context Managers.
exc_type—exc_value—traceback—
parse_expression(expression) → tuple
Parse rio-tiler band math expression.
expression(str) —
info(bands=None, **kwargs)
Return metadata from multiple bands.
bands(sequence of str or str, optional) — band names to fetch info from. Required keyword argument.**kwargs(any) —
Multiple bands info in form of {"band1": rio_tile.models.Info}.
statistics(bands=None, expression=None, categorical=False, categories=None, percentiles=None, hist_options=None, max_size=1024, **kwargs)
Return array statistics for multiple assets.
bands(sequence of str or str) — bands to fetch info from. Required keyword argument.expression(str, optional) — rio-tiler expression for the band list (e.g. b1/b2+b3).categorical(bool) — treat input data as categorical data. Defaults to False.categories(list of numbers, optional) — list of categories to return value for.percentiles(list of numbers, optional) — list of percentile values to calculate. Defaults to[2, 98].hist_options(dict, optional) — Options to forward to numpy.histogram function.max_size(int, optional) — Limit the size of the longest dimension of the dataset read, respecting bounds X/Y aspect ratio. Defaults to 1024.**kwargs(any) —
Multiple assets statistics in form of {"{band}/{expression}": rio_tiler.models.BandStatistics, ...}.
tile(tile_x, tile_y, tile_z, bands=None, expression=None, **kwargs)
Read and merge Web Map tiles multiple bands.
tile_x(int) — Tile's horizontal index.tile_y(int) — Tile's vertical index.tile_z(int) — Tile's zoom level index.bands(sequence of str or str, optional) — bands to fetch info from.expression(str, optional) — rio-tiler expression for the band list (e.g. b1/b2+b3).**kwargs(any) —
ImageData instance with data, mask and tile spatial info.
part(bbox, bands=None, expression=None, **kwargs)
Read and merge parts from multiple bands.
bbox(tuple) — Output bounds (left, bottom, right, top) in target crs.bands(sequence of str or str, optional) — bands to fetch info from.expression(str, optional) — rio-tiler expression for the band list (e.g. b1/b2+b3).**kwargs(any) —
ImageData instance with data, mask and tile spatial info.
preview(bands=None, expression=None, **kwargs)
Read and merge previews from multiple bands.
bands(sequence of str or str, optional) — bands to fetch info from.expression(str, optional) — rio-tiler expression for the band list (e.g. b1/b2+b3).**kwargs(any) —
ImageData instance with data, mask and tile spatial info.
point(lon, lat, bands=None, expression=None, **kwargs)
Read a pixel values from multiple bands.
lon(float) — Longitude.lat(float) — Latitude.bands(sequence of str or str, optional) — bands to fetch info from.expression(str, optional) — rio-tiler expression for the band list (e.g. b1/b2+b3).**kwargs(any) —
PointData
feature(shape, bands=None, expression=None, **kwargs)
Read and merge parts defined by geojson feature from multiple bands.
shape(dict) — Valid GeoJSON feature.bands(sequence of str or str, optional) — bands to fetch info from.expression(str, optional) — rio-tiler expression for the band list (e.g. b1/b2+b3).**kwargs(any) —
ImageData instance with data, mask and tile spatial info.
__attrs_post_init__()
Fetch productInfo and get bounds.
get_geometry()
Fetch geometry info for the scene.
Utils¶
rio_tiler_pds.landsat.utils.sceneid_parser(sceneid)
Parse Landsat id.
Author @perrygeo - www.perrygeo.com
sceneid(str) — Landsat sceneid.
dictionary with metadata constructed from the sceneid.
InvalidLandsatSceneId— Ifsceneiddoesn't match the regex schema.
>>> sceneid_parser('LC08_L1TP_016037_20170813_20170814_01_RT')