rio_tiler.io.stac
rio_tiler.io.stac ¶
rio_tiler.io.stac: STAC reader.
STACReader ¶
Bases: MultiBaseReader
STAC Reader.
Attributes:
-
input
(str
) –STAC Item path, URL or S3 URL.
-
item
((dict or Item, STAC)
) –Stac Item.
-
tms
(TileMatrixSet
) –TileMatrixSet grid definition. Defaults to
WebMercatorQuad
. -
minzoom
(int
) –Set minzoom for the tiles.
-
maxzoom
(int
) –Set maxzoom for the tiles.
-
include_assets
(set of string
) –Only Include specific assets.
-
exclude_assets
(set of string
) –Exclude specific assets.
-
include_asset_types
(set of string
) –Only include some assets base on their type.
-
exclude_asset_types
(set of string
) –Exclude some assets base on their type.
-
default_assets
(list of string
) –Default assets to use if none are defined.
-
reader
(BaseReader
) –rio-tiler Reader. Defaults to
rio_tiler.io.Reader
. -
reader_options
(dict
) –Additional option to forward to the Reader. Defaults to
{}
. -
fetch_options
(dict
) –Options to pass to
rio_tiler.io.stac.fetch
function fetching the STAC Items. Defaults to{}
.
Examples:
>>> with STACReader(stac_path) as stac:
stac.tile(...)
>>> with STACReader(stac_path, reader=MyCustomReader, reader_options={...}) as stac:
stac.tile(...)
>>> my_stac = {
"type": "Feature",
"stac_version": "1.0.0",
...
}
with STACReader(None, item=my_stac) as stac:
# the dict will be translated to a pystac item
assert isinstance(stac.item, pystac.Item)
stac.tile(...)
_get_assets ¶
_get_assets(stac_item: Item, include: Optional[Set[str]] = None, exclude: Optional[Set[str]] = None, include_asset_types: Optional[Set[str]] = None, exclude_asset_types: Optional[Set[str]] = None) -> Iterator
Get valid asset list.
Parameters:
-
stac_item
(Item
) –STAC Item.
-
include
(Optional[Set[str]]
, default:None
) –Only Include specific assets.
-
exclude
(Optional[Set[str]]
, default:None
) –Exclude specific assets.
-
include_asset_types
(Optional[Set[str]]
, default:None
) –Only include some assets base on their type.
-
exclude_asset_types
(Optional[Set[str]]
, default:None
) –Exclude some assets base on their type.
Yields str: valid STAC asset name.
_to_pystac_item ¶
aws_get_object ¶
AWS s3 get object content.