MODIS
MODIS PDS¶
rio_tiler_pds.modis.aws.modis_pds.
MODISReader
(
input
, tms=<TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>
, minzoom=4
, maxzoom=9
, reader=<class 'rio_tiler.io.rasterio.Reader'>
, reader_options=NOTHING
, bucket='modis-pds'
, prefix_pattern='{product}.{version}/{horizontal_grid}/{vertical_grid}/{date}'
)
AWS Public Dataset MODIS reader.
tms
(TileMatrixSet, optional) —input
(str) —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 (default is defined for each sensor).bounds
—crs
—input
(any) — input data.maxzoom
(int, optional) — Set dataset's maxzoom.minzoom
(int, optional) — Set dataset's minzoom.reader_options
(dict, option) — options to forward to the reader. Defaults to{}
.scene_params
(dict) — scene id parameters.tms
(morecantile.TileMatrixSet, optional) — TileMatrixSet grid definition. Defaults toWebMercatorQuad
.
>>> with MODISReader('MCD43A4.A2017006.h21v11.006.2017018074804') as scene:
print(scene.bounds)
__attrs_post_init__
(
)
— Parse Sceneid and get grid 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.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__
(
)
Parse Sceneid and get grid bounds.
MODIS ASTRAEA¶
rio_tiler_pds.modis.aws.modis_astraea.
MODISReader
(
input
, tms=<TileMatrixSet title='Google Maps Compatible for the World' id='WebMercatorQuad' crs='http://www.opengis.net/def/crs/EPSG/0/3857>
, minzoom=4
, maxzoom=9
, reader=<class 'rio_tiler.io.rasterio.Reader'>
, reader_options=NOTHING
, bucket='astraea-opendata'
, prefix_pattern='{product}.{version}/{horizontal_grid}/{vertical_grid}/{date}'
)
AWS Public Dataset MODIS reader.
tms
(TileMatrixSet, optional) —input
(str) —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 (default is defined for each sensor).bounds
—crs
—input
(any) — input data.maxzoom
(int, optional) — Set dataset's maxzoom.minzoom
(int, optional) — Set dataset's minzoom.reader_options
(dict, option) — options to forward to the reader. Defaults to{}
.scene_params
(dict) — scene id parameters.tms
(morecantile.TileMatrixSet, optional) — TileMatrixSet grid definition. Defaults toWebMercatorQuad
.
>>> with MODISReader('MCD43A4.A2017006.h21v11.006.2017018074804') as scene:
print(scene.bounds)
__attrs_post_init__
(
)
— Parse Sceneid and get grid 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.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__
(
)
Parse Sceneid and get grid bounds.
Utils¶
rio_tiler_pds.modis.utils.
sceneid_parser
(
sceneid
)
Parse MODIS scene id.
sceneid
(str) — Sentinel-2 sceneid.
dictionary with metadata constructed from the sceneid.
InvalidMODISSceneId
— Ifsceneid
doesn't match the regex schema.
>>> sceneid_parser('MCD43A4.A2017006.h21v11.006.2017018074804')