rio_tiler.reader
rio_tiler.reader ¶
rio-tiler.reader: low level reader.
Options ¶
Bases: TypedDict
Reader Options.
_apply_buffer ¶
_apply_buffer(buffer: float, bounds: BBox, height: int, width: int) -> tuple[BBox, int, int]
Apply buffer on bounds.
part ¶
part(src_dst: DatasetReader | DatasetWriter | WarpedVRT, bounds: BBox, height: int | None = None, width: int | None = None, max_size: int | None = None, dst_crs: CRS | None = None, bounds_crs: CRS | None = None, indexes: Indexes | None = None, minimum_overlap: float | None = None, padding: int | None = None, buffer: float | None = None, nodata: NoData | None = None, vrt_options: dict | None = None, out_dtype: str | dtype | None = None, align_bounds_with_dataset: bool = False, resampling_method: RIOResampling = 'nearest', reproject_method: WarpResampling = 'nearest', unscale: bool = False, post_process: Callable[[MaskedArray], MaskedArray] | None = None) -> ImageData
Read part of a dataset.
Parameters:
-
src_dst(DatasetReader or DatasetWriter or WarpedVRT) –Rasterio dataset.
-
bounds(tuple) –Output bounds (left, bottom, right, top). By default the coordinates are considered to be in either the dataset CRS or in the
dst_crsif set. Usebounds_crsto set a specific CRS. -
height(int, default:None) –Output height of the image.
-
width(int, default:None) –Output width of the image.
-
max_size(int, default:None) –Limit output size image if not width and height.
-
dst_crs(CRS, default:None) –Target coordinate reference system.
-
bounds_crs(CRS, default:None) –Overwrite bounds Coordinate Reference System.
-
indexes(sequence of int or int, default:None) –Band indexes.
-
minimum_overlap(float, default:None) –Minimum % overlap for which to raise an error with dataset not covering enough of the tile.
-
padding(int, default:None) –Padding to apply to each bbox edge. Helps reduce resampling artefacts along edges. Defaults to
0. -
buffer(float, default:None) –Buffer to apply to each bbox edge. Defaults to
0.. -
nodata(int or float, default:None) –Overwrite dataset internal nodata value.
-
vrt_options(dict, default:None) –Options to be passed to the rasterio.warp.WarpedVRT class.
-
align_bounds_with_dataset(bool, default:False) –Align input bounds with dataset transform. Defaults to
False. -
resampling_method(RIOResampling, default:'nearest') –RasterIO resampling algorithm. Defaults to
nearest. -
reproject_method(WarpResampling, default:'nearest') –WarpKernel resampling algorithm. Defaults to
nearest. -
unscale(bool, default:False) –Apply 'scales' and 'offsets' on output data value. Defaults to
False. -
post_process(callable, default:None) –Function to apply on output data and mask values.
Returns:
-
ImageData–ImageData
point ¶
point(src_dst: DatasetReader | DatasetWriter | WarpedVRT, coordinates: tuple[float, float], indexes: Indexes | None = None, coord_crs: CRS = WGS84_CRS, nodata: NoData | None = None, vrt_options: dict | None = None, out_dtype: str | dtype | None = None, resampling_method: RIOResampling = 'nearest', reproject_method: WarpResampling = 'nearest', interpolate: bool = False, unscale: bool = False, post_process: Callable[[MaskedArray], MaskedArray] | None = None) -> PointData
Read a pixel value for a point.
Parameters:
-
src_dst(DatasetReader or DatasetWriter or WarpedVRT) –Rasterio dataset.
-
coordinates(tuple) –Coordinates in form of (X, Y).
-
indexes(sequence of int or int, default:None) –Band indexes.
-
coord_crs(CRS, default:WGS84_CRS) –Coordinate Reference System of the input coords. Defaults to
epsg:4326. -
nodata(int or float, default:None) –Overwrite dataset internal nodata value.
-
vrt_options(dict, default:None) –Options to be passed to the rasterio.warp.WarpedVRT class.
-
resampling_method(RIOResampling, default:'nearest') –RasterIO resampling algorithm. Only used when
interpolate=True. Defaults tonearest. -
reproject_method(WarpResampling, default:'nearest') –WarpKernel resampling algorithm. Defaults to
nearest. -
interpolate(bool, default:False) –Interpolate pixels around the coordinates. Defaults to
False. -
unscale(bool, default:False) –Apply 'scales' and 'offsets' on output data value. Defaults to
False. -
post_process(callable, default:None) –Function to apply on output data and mask values.
Returns:
-
PointData–PointData
read ¶
read(src_dst: DatasetReader | DatasetWriter | WarpedVRT, dst_crs: CRS | None = None, height: int | None = None, width: int | None = None, max_size: int | None = None, indexes: Indexes | None = None, window: Window | None = None, nodata: NoData | None = None, vrt_options: dict | None = None, out_dtype: str | dtype | None = None, resampling_method: RIOResampling = 'nearest', reproject_method: WarpResampling = 'nearest', unscale: bool = False, post_process: Callable[[MaskedArray], MaskedArray] | None = None) -> ImageData
Low level read function.
Parameters:
-
src_dst(DatasetReader or DatasetWriter or WarpedVRT) –Rasterio dataset.
-
dst_crs(CRS, default:None) –Target coordinate reference system.
-
height(int, default:None) –Output height of the image.
-
width(int, default:None) –Output width of the image.
-
max_size(int, default:None) –Limit output size image if not width and height.
-
indexes(sequence of int or int, default:None) –Band indexes.
-
window(Window, default:None) –Window to read.
-
nodata(int or float, default:None) –Overwrite dataset internal nodata value.
-
vrt_options(dict, default:None) –Options to be passed to the rasterio.warp.WarpedVRT class.
-
resampling_method(RIOResampling, default:'nearest') –RasterIO resampling algorithm. Defaults to
nearest. -
reproject_method(WarpResampling, default:'nearest') –WarpKernel resampling algorithm. Defaults to
nearest. -
unscale(bool, default:False) –Apply 'scales' and 'offsets' on output data value. Defaults to
False. -
post_process(callable, default:None) –Function to apply on output data and mask values.
Returns:
-
ImageData–ImageData