Release Notes¶
Unreleased¶
10.0.0a1 (2026-11-27)¶
Misc Breaking changes¶
- remove python 3.11 support
- require
rasterio>=1.5.1andaffine>=3.0 - move readers out of
experimental:rio_tiler.experimental.geotiff->rio_tiler.io.geotiffrio_tiler.experimental.zarr->rio_tiler.io.zarrrio_tiler.experimental.async_stac.AsyncSTACReader->rio_tiler.io.stac.AsyncSTACReader(alsorio_tiler.io.AsyncSTACReader)
ImageData/PointData:- remove
scales,offsetsandcountattributes - mosaic readers no longer forward
band_descriptionsandband_names
- remove
Zarr readers (rio_tiler.io.zarr)¶
-
breaking replace
indexeswith an xarray-likeseloption:sel=[{"dimension": "time", "values": "2025-01-01", "method": "nearest"}]- selects non-spatial dimensions by coordinate labels (or positions when a dimension has no coordinates)
values: a scalar (the dimension is dropped), a list of labels or a slice of labelsmethod: exact (default),nearest,pad/ffill,backfill/bfill- unselected non-spatial dimensions are kept: readers return
(*non-spatial dims, height, width)data - the selected labels are stored in
ImageData.metadata["selected"] - breaking dimensions and coordinates:
- remove
band_namesattribute: band descriptions come from the coordinates of the non-spatial dimensions (fallback to{dim}{n});ImageData.band_descriptionsis{dimension: labels}(alistfor 2D/3D arrays) - add
dimensionsattribute (defaults to the zarrdimension_namesmetadata) - add
spatial_dimsattribute ([y_dim, x_dim], defaults tospatial:dimensionsfrom thespatialzarr-convention): Y/X no longer need to be the last two axes coordinatesnow holds the fullcoords:coordinatesmapping ({dim: {...}}) for all dimensions- add
coordinate_valuesproperty ({dimension: values}) info():dimensionsreturns thedimensionsattribute, per-band metadata is no longer listed, addsdimensions_count(andcoordinateswithwith_coordinates=True)- internal: reads use
get_orthogonal_selection(_read(row_slice=, col_slice=)->_read(y_slice=, x_slice=)) - breaking group readers (
GroupReader,AsyncGroupReader): - variables are stacked along a new
variablesdimension (labeled with the variable names). A single variable is returned as is list_variables()entries includeselectable_dimensions({dimension: coordinates}, usable withsel)spatial_dimsandcoordinatesare forwarded to the Array readers- group metadata (
get_group_metadata) is cached in a cache shared by all readers (keyed by store and group path); concurrent calls share a single request. Configure withRIO_TILER_ZARR_METADATA_CACHE_MAXSIZE(default: 512) andRIO_TILER_ZARR_METADATA_CACHE_TTL(default: 300s) AsyncGroupReader.get_group_metadatafetches the multiscale levels concurrently- add
async-lru>=2.4to thezarroptional dependencies - add
resampling_methodoption to the Array readers'tile()method - Array readers'
part()reads the exact pixel window (no neighbouring chunks); 1 pixel padding is added only forbilinear/cubic/... resampling. Windows outside the array raiseInvalidBounds - fix:
GroupReader.part()accepts and forwardsresampling_method - perf: fixed-step temporal
intervalcoordinates are built with numpy, and labels are only created for the selected positions
N-D data¶
ImageData/PointDatasupport N-D data ((*leading, height, width)), with per-dimensionband_descriptionsandband_names(dict)- expression, colormap, color formula, rescale, statistics,
to_rasterand rendering (exceptNPY/NPZ) raiseValueErrorfor N-D data
- expression, colormap, color formula, rescale, statistics,
- add
ImageData.reduce(dim, func)/PointData.reduce(dim, func)to reduce along a non-spatial dimension (listed inmetadata["reduced"]) - add
stack_on_dimoption toImageData.create_from_list/PointData.create_from_listto stack data along a new leading dimension instead of concatenating along the first one. 2D data ((1, y, x)) are stacked as[stack_on_dim, y, x]
Warping and overview selection (geotiff, zarr, xarray readers)¶
rio_tiler._warp.warpwarps the source pixels onto the output grid in a single pass (previously: reproject at native resolution, then resize). The kernel isreproject_methodwhen the CRS changes,resampling_methodotherwise (gaussstill uses two steps)geotiff.Readerand the zarr group readers select overviews (multiscale levels) with GDAL's rule (rio_tiler._warp.get_overview_level) instead of the aiocogeo 50% rule- pick the most downsampled overview whose factor is lower than
desired factor * threshold(threshold=1.2fornearest,1.0otherwise) - the threshold is configurable with
RIO_TILER_OVERVIEW_OVERSAMPLING_THRESHOLD(rio_tiler.constants.OVERVIEW_OVERSAMPLING_THRESHOLD, defaults toGDAL_OVERVIEW_OVERSAMPLING_THRESHOLDwhen set) - for
bilinear/cubic/... a finer overview is now read and downsampled (instead of a coarser one upsampled) - remove
zoom_level_strategyoption from the internal overview selection methods
- pick the most downsampled overview whose factor is lower than
- fix: use masked array reprojection in
rio_tiler._warp.warp(mask warping with GDAL >= 3.11) - fix:
rio_tiler._warp.warpno longer raisesZeroDivisionErrorwhen the source contains a pole and the output CRS is geographic - fix: run blocking warp/reproject/resize in a worker thread in the async readers (
geotiff.Reader,zarr.AsyncArrayReader)
Other additions¶
- add
rio_tiler.experimental.rasterio.Reader: a rasterio reader withoutWarpedVRT. It reads native pixels from the overview selected with GDAL's rule, then warps them in memory withrio_tiler._warp.warp(same logic asrio_tiler.io.geotiff.Reader) - add
rio_tiler.utils.run_syncto run a blocking function in a worker thread, forwarding the active rasterio environment - add
rio_tiler.utils.has_undefined_extent Reader.tile()emits aZoomOutsideNativeRangeWarningwhen the zoom is below the datasetminzoom(resampling beyond the coarsest overview can be slow)- perf:
rio_tiler.reader.readskips the dataset mask read when the mask only comes from the nodata value (avoids full-resolution mask reads throughWarpedVRT) - docs: new
experimentaldocumentation section (async-geotiff, async-stac, geoxarray, geozarr, vsifile)
Fixes¶
tile_existsreturnsFalsewhen the tile bounds can't be transformed to the dataset CRS (e.g. far outside a UTM zone), sotile()raisesTileOutsideBoundsinstead of returning misplaced dataImageData.reprojectmasks output pixels not covered by the source (previously valid zeros, e.g. antimeridian-crossing datasets reprojected to EPSG:4326)part()of thegeotiff,rasterio(experimental),xarrayandzarrreaders raisesInput BBOX and dataset's bounds do not intersect(instead ofcannot convert float NaN to integer) when the bbox can't be transformed to the dataset CRSgeotiff.Reader.part()raisesValueErrorwhen the bbox is entirely left of or above the dataset (previously a negative-size window)geotiffandzarrreaders return arasterio.crs.CRSas outputcrswhendst_crsis a string- use
@instead of*for affine matrix multiplication - compute cumulative weights in
float64inrio_tiler.utils._weighted_quantiles(wrongmedian/percentile_*withfloat32coverage arrays, cogeotiff/rio-tiler#1045)
9.4.13 (2026-11-02)¶
- fix: compute the cumulative weights in
float64inrio_tiler.utils._weighted_quantilesto avoid wrongmedian/percentile_*statistics withfloat32coverage arrays (cogeotiff/rio-tiler#1045)
9.4.12 (2026-10-08)¶
- fix: make
isochronan optional dependency, required by therio_tiler.experimental.zarr(zarrextra) andrio_tiler.experimental.xarray(newgeoarrayextra) readers
9.4.11 (2026-10-08)¶
- fix: improve performance of
XarrayReader.info()for long time series
9.4.10 (2026-10-04)¶
- fix: bounds-crs/dst-crs for
partmethods in experimental zarr readers - rename:
rio_tiler.experimental.zarr.Reader->rio_tiler.experimental.zarr.AsyncArrayReader - rename:
rio_tiler.experimental.zarr.GeoZarrReader->rio_tiler.experimental.zarr.AsyncGroupReader - add: pure zarr-python sync
rio_tiler.experimental.zarr.ArrayReaderandrio_tiler.experimental.zarr.GroupReader
9.4.9 (2026-10-02)¶
- add: support for coordinates zarr-conventions within experimental xarray.GeoArrayReader and zarr.Reader/GeoZarrReader (cogeotiff/rio-tiler!1004)
- fix: missing
bboxfor multiscale variable selection in GeoZarrReader
9.4.8 (2026-09-30)¶
- add: utility functions to calculate output image size (for part/feature/preview) methods
9.4.7 (2026-09-28)¶
- fix: do not ignore vrt_options passed through the reader options when calling
featuremethod
9.4.6 (2026-09-17)¶
- fix: add catch-all for exceptions in
apply_expressionto raiseInvalidExpression
9.4.5 (2026-09-16)¶
- fix: remove invalid ast nodes for boolean operations and conditional expressions (
and,or,not,if ... else ...)
9.4.4 (2026-09-09)¶
- fix: compare with
math.isclosein the WGS84 bounds check ofXarrayReaderandZarrReader, so a global dataset whose coordinates carry a float residue is no longer rejected (#754)
9.4.3 (2026-08-20)¶
- fix: avoid unnecessary copy and mask work in ImageData.render (author @manand881, cogeotiff/rio-tiler!974)
- fix: avoid unnecessary STAC deepcopy for asset listing (author @Astrareach, cogeotiff/rio-tiler!988)
9.4.2 (2026-07-20)¶
- fix: Explicitly cast weighted quantile results to float so statistics (author @manand881, cogeotiff/rio-tiler!969)
9.4.1 (2026-07-20)¶
- fix
rio_tiler.reader.readmisflagging an edge-aligned window as boundless, which broke point reads in the last row/column whennodatais set (routed through a WarpedVRT) (#966) - fix
PointData.apply_expressiondropping the mask, so an expression over a nodata band is now masked instead of returning a fabricated value (#965) - perf: optimize
utils.get_array_statistics(author @manand881, cogeotiff/rio-tiler!964)
9.4.0 (2026-07-02)¶
-
change:
_variablesattribute inrio_tiler.experimental.zarr.GeoZarrReaderto be a list of dict instead of a list of string# before with GeoZarrReader(input={zarr.AsyncGroup}) as src: print(src._variables) >> ["data:b1", "data:b2", "data:b3"] await src.info() >> { "bounds": ... "variables": ["data:b1", "data:b2", "data:b3"] } # now with GeoZarrReader(input={zarr.AsyncGroup}) as src: print(src._variables) >> [ {"name": "b1", "group": "data", "long_name": "data:b1", "multiscale": False, "nbands": 1}, {"name": "b2", "group": "data", "long_name": "data:b2", "multiscale": False, "nbands": 1}, {"name": "b3", "group": "data", "long_name": "data:b3", "multiscale": False, "nbands": 1} ] await src.info() >> { "bounds": ... "variables": [ {"name": "b1", "group": "data", "long_name": "data:b1", "multiscale": False, "nbands": 1}, {"name": "b2", "group": "data", "long_name": "data:b2", "multiscale": False, "nbands": 1}, {"name": "b3", "group": "data", "long_name": "data:b3", "multiscale": False, "nbands": 1} ] } -
change: change input for
rio_tiler.experimental.zarr.get_group_metadatato accept no inputgroupto get the metadata for the root group.# before with GeoZarrReader(input={zarr.AsyncGroup}) as src: await src.get_group_metadata("root") # now with GeoZarrReader(input={zarr.AsyncGroup}) as src: await src.get_group_metadata()
9.3.0 (2026-06-19)¶
- fix: improve performance in
mosaic.async_mosaic_reader - change: deprecate
chunk_sizeparameter inmosaic.async_mosaic_readerfunction
9.2.1 (2026-06-12)¶
- fix:
GeoZarrReader.info()returnsGeoZarrdriver instead ofZarr-Pythondriver
9.2.0 (2026-06-12)¶
- add:
minmaxattribute ininfo()response to provide dataset's minimum and maximum values
9.1.1 (2026-06-03)¶
- fix: reduce memory usage in
ImageData.get_coverage_arraymethod
9.1.0 (2026-06-01)¶
- change:
rio_tiler.experimental.zarr.ZarrReader->rio_tiler.experimental._zarr.ZarrReader - change:
rio_tiler.experimental._async->rio_tiler.experimental.geotiff - change:
rio_tiler.experimental._async.AsyncBaseReader->rio_tiler.io.base.AsyncBaseReader - change:
rio_tiler.experimental._async.warp->rio_tiler._warp.warp - change:
rio_tiler.io.xarray.MAX_ARRAY_SIZE->rio_tiler.constant.MAX_ARRAY_SIZE - change:
async->geotiffoptional-dependencies - change:
rio_tiler.io.stac.STAC_ALTERNATE_KEY->rio_tiler.constant.STAC_ALTERNATE_KEY - change: move from
httpxtohttpx2 - add:
rio_tiler.experimental.zarr.Reader(async zarr-python reader) - add:
rio_tiler.experimental.zarr.GeoZarrReader(async zarr-python reader for GeoZAR/EOPF product) - add:
rio_tiler.io.base.AsyncMultiBaseReaderabc class - add:
rio_tiler.experimental.async_stac.AsyncSTACReader - add:
rio_tiler.mosaic.reader.async_mosaic_reader - add:
rio_tiler.mosaic.backend.AsyncBaseBackend - add:
SumMethodtorio_tiler.mosaic.methods.defaults - add:
rio_tiler.experimental.xarray.GeoArrayReaderreader for geospatial xarray DataArray with Zarr conventions - fix: better expression validation
9.0.6 (2026-04-08)¶
- fix: typing-extensions dependency for python <3.15
9.0.5 (2026-04-02)¶
- fix: incorect default band descriptions expression
9.0.4 (2026-03-24)¶
- rename
lastbandhight->lastbandhighvalue inrio_tiler.mosaic.methods.PixelSelectionMethodenum
9.0.3 (2026-03-19)¶
- fix: add missing expression check in PointData model
9.0.2 (2026-03-19)¶
- fix: check for malicious
evalin expression
9.0.1 (2026-03-18)¶
- fix: set correct band names when reading a single dataset
9.0.0 (2026-03-11)¶
- No change since 9.0.0rc3
9.0.0rc3 (2026-03-09)¶
- fix: reproject feature shape to dst_crs in mosaic backend
9.0.0rc2 (2026-03-06)¶
- fix: window calculation for async
Reader.part() - change: rename
_async.Readerto_async.AsyncReader - change: improve partial alpha band support and internal mask for non-uint8 datatype
9.0.0rc1 (2026-02-26)¶
- remove: support for
vrt://notation in STACReader - fix: statistics from stac metadata when
bandsoption is used - add:
STACReader._get_options()method to extract reader/method options (used within_get_asset_infomethod) -
add: experimental asynchronous
Readerbuilt on topobstoreandasync-geotifffrom rio_tiler.experimental._async import Reader from obstore.store import LocalStore from async_geotiff import GeoTIFF store = LocalStore("./tests/fixtures/") path = "cog_nodata.tif" geotiff = await GeoTIFF.open(path, store=store) async with Reader(geotiff): img = await src.tile(21, 11, 6)
9.0.0b2 (2026-02-26)¶
- add: support for
bandsoptions inSTACReader._get_asset_infomethods to select band indexes based on band metadata - add: optional
indexes,expressionandbandskeys toAssetWithOptionstypedDict definition
9.0.0b1 (2026-02-22)¶
- add
AssetType = str | AssetWithOptions, withAssetWithOptionsbeeing a typed dict with requirednamekey - change:
assetssignature inMultiBaseReadermethod to be a union ofSequence[AssetType] | AssetType - remove:
assetparsing inSTACReader._get_asset_info()method. Options needs to be passed as dictionary:# 9.0.0a1 with STACReader(stac.json) as stac: _ = stac.tile( 0, 0, 0, assets=[ "asset|indexes=1,2,3", ] ) # 9.0.0b1 with STACReader(stac.json) as stac: _ = stac.tile( 0, 0, 0, assets=[ {"name": "asset", "indexes": [1, 2, 3]}, ] )
9.0.0a6 (2026-02-13)¶
- add: wraps readers within the mosaic Backends with
inherit_rasterio_envdecorator.
9.0.0a5 (2026-02-13)¶
- add: reader's level options for XarrayReader
9.0.0a4 (2026-02-11)¶
- fix: type hint for ImageData/PointData methods
- remove:
typing-extensionsfrom requirements
9.0.0a3 (2026-02-05)¶
- add:
inherit_rasterio_envdecorator toutilsmodule for decorating functions that need to inherit rasterio env settings from a parent thread. - fix: automatically forward rasterio env settings to threads in multibase reader
9.0.0a2 (2026-02-04)¶
- change:
MultiReaderBase._get_readersignature to only returntype[BaseReader] - add:
reader_optionsinAssetInfomodel
9.0.0a1 (2026-02-03)¶
- remove: default tilesize option (
256) fortile()methods and default to TMS tilematrixtileHeightandtileWidth - remove:
parse_expressionmethod inMultiBaseReader - remove:
asset_indexesoption forMultiBaseReader -
change: band indexes in
ImageData.band_namesfor Reader's responses# before with Reader(path) as src: img = src.read(indexes=(1,1,)) print(img.band_names) >> ["b1", "b1"] # now with Reader(path) as src: img = src.read(indexes=(1,1,)) print(img.band_names) >> ["b1", "b2"] -
change: deprecate
MultiBandReader -
change: type informations for
AssetInfomodelclass AssetInfo(TypedDict): """Asset Reader Options.""" url: Any name: str media_type: str | None method_options: dict env: NotRequired[dict] metadata: NotRequired[dict] dataset_statistics: NotRequired[Sequence[tuple[float, float]]] -
change: in
MultiBaseReader, expression are now in form ofb1/b2indicating the band index within the ImageData object returned by thereadmethodwith MultiBaseReader(input) as src: # asset1 and asset2 are both 1-band dataset src.preview(assets=["asset1", "asset2"], expression="b1+b2") # asset1 has 1 band while asset3 has 2 bands src.preview(assets=["asset1", "asset3"], expression="b1+b2/b3") -
change: STACReader now accept
assetsoptions in form ofassets="{asset_name}|some_option=some_value&another_option=another_value"(e.gassets=visual|indexes=1,2,3). Asset's parsing is done in_get_asset_infomethod. -
change: use band name (index) instead of band's description in statistics
# before with Reader(path) as src: img = src.read() print(img.band_names) >> ["b1", "b2", "b3"] >> ["red", "green", "blue"] # or ["", "", ""] if no band description stats = src.statistics(expression="b1+2") print(list(stats)) >> "b1+2" # now with Reader(path) as src: img = src.read() print(img.band_names) >> ["b1", "b2", "b3"] >> ["red", "green", "blue"] # or ["b1", "b2", "b3"] if no band description stats = src.statistics(expression="b1+2") print(list(stats)) >> "b1" print(stats["b1"].description) >> "red+2" # b1+2 if no band description -
add:
method_optionsattribute inAssetInfo. Used inMultiBaseReaderto pass method's options - add:
descriptioninBandStatisticsmodel -
add: infer band description in
ImageData.apply_expression()result's band_descriptions# before with Reader(COG_TAGS) as src: img = src.preview(expression="b1*2") assert img.band_descriptions == [""] # now with Reader(COG_TAGS) as src: img = src.preview(expression="b1*2") assert img.band_descriptions == ["Green*2"]
8.0.9 (2026-06-04)¶
- fix: better expression validation [backported from 9.1]
8.0.8 (2026-03-24)¶
- rename
lastbandhight->lastbandhighvalue inrio_tiler.mosaic.methods.PixelSelectionMethodenum [backported from 9.0.4]
8.0.7 (2026-03-19)¶
- fix: add missing expression check in ImageData model and MultiBaseReader
8.0.6 (2026-03-19)¶
- fix: check for malicious eval in expression [backported from 9.0.2]
8.0.5 (2026-01-05)¶
- improve type hints - part 2: change old Union and
typing.*notations
8.0.4 (2015-12-15)¶
- add support for python 3.14
8.0.3 (2015-12-15)¶
- improve and fix type hints
8.0.2 (2025-12-04)¶
- add arguments to
rio_tiler.mosaic.BaseBackend'sstatisticsandpreviewmethods to avoidunexpected keyword argumenterrors
8.0.1 (2025-11-21)¶
- Better handle mask and alpha band from colormap when rendering images
8.0.0 (2025-11-20)¶
-
remove python 3.9 and 3.10 support breaking change
-
add band_descriptions in ImageData and PointData objects
with Reader("tests/fixtures/cog_tags.tif") as src:
info = src.info()
img = src.preview()
print(info.band_descriptions)
>> [('b1', 'Green')]
print(img.band_names)
>> ['b1']
print(img.band_descriptions)
>> ['Green']
- use
b{idx}as band names inXarrayReaderresult (instead of band descriptions) breaking change
arr = numpy.arange(0.0, 33 * 35 * 2, dtype="float32").reshape(2, 33, 35)
data = xarray.DataArray(
arr,
dims=("time", "y", "x"),
coords={
"x": numpy.arange(-170, 180, 10),
"y": numpy.arange(-80, 85, 5),
"time": [datetime(2022, 1, 1), datetime(2022, 1, 2)],
},
)
data.attrs.update({"valid_min": arr.min(), "valid_max": arr.max()})
data.rio.write_crs("epsg:4326", inplace=True)
# Before
with XarrayReader(data) as dst:
assert info.band_metadata == [("b1", {}), ("b2", {})]
assert info.band_descriptions == [
("b1", "2022-01-01T00:00:00.000000000"),
("b2", "2022-01-02T00:00:00.000000000"),
]
stats = dst.statistics()
assert list(stats) == [
"2022-01-01T00:00:00.000000000",
"2022-01-02T00:00:00.000000000",
]
img = dst.tile(0, 0, 0)
assert img.band_names == [
"2022-01-01T00:00:00.000000000",
"2022-01-02T00:00:00.000000000",
]
# Now
with XarrayReader(data) as dst:
stats = dst.statistics()
assert list(stats) == [
"b1",
"b2",
]
img = dst.tile(0, 0, 0)
assert img.band_names == [
"b1",
"b2",
]
assert img.band_descriptions == [
"2022-01-01T00:00:00.000000000",
"2022-01-02T00:00:00.000000000",
]
-
rename
XarrayReader.band_names->XarrayReader.band_descriptionsbreaking change -
only cast data to
uint8if colormap values are of typeuint8 -
add
alpha_maskattribute toImageDataclass -
allow partial alpha values from alpha band
-
better handle non-uint8 alpha band
-
remove deprecated
force_binary_maskoption inreader.readfunction breaking change -
add
nodata,scalesandoffsetsattributes toImageDataandPointDataclasses -
add
rio_tiler.experimental.zarr.ZarrReaderZarr Dataset experimental reader -
refactor
XarrayReader.partmethod to better handle reprojection and re-usability - move
_get_width_heightand_missing_sizefromrio_tiler.readertorio_tiler.utils - add upper memory limit for Xarray dataset. Controled with
RIO_TILER_MAX_ARRAY_SIZEenv variable. - add Mosaic Backend abstract base class
- update morecantile requirements to
>=5.0,<8.0
7.9.6 (2026-06-04)¶
- fix: better expression validation [backported from 9.1]
7.9.5 (2026-03-24)¶
- rename
lastbandhight->lastbandhighvalue inrio_tiler.mosaic.methods.PixelSelectionMethodenum [backported from 9.0.4]
7.9.4 (2026-03-19)¶
- fix: check for malicious eval in expression [backported from 9.0.2/9.0.3]
7.9.3 (2026-02-12)¶
- add upper memory limit for Xarray dataset. Controled with
RIO_TILER_MAX_ARRAY_SIZEenv variable Backported
7.9.2 (2025-10-09)¶
- fix: bad code logic in XarrayReader
7.9.1 (2025-10-09)¶
- fix: better handler inverted (SouthUp) dataset in XarrayReader
7.9.0 (2025-10-07)¶
- refactor XarrayReader.part method to better handle reprojection and re-usability (cogeotiff/rio-tiler!828) Backported
- move
_get_width_heightand_missing_sizefromrio_tiler.readertorio_tiler.utilsBackported
7.8.1 (2025-06-16)¶
- apply scale/offset to dataset statistics in ImageData object (used for automatic rescaling)
7.8.0 (2025-06-03)¶
- add
to_raster()method toImageDataclass
7.7.4 (2025-05-29)¶
- fix band names for Xarray DataArray
7.7.3.post1 (2025-05-22)¶
- remove unwanted breaking change
7.7.3 (2025-05-22) YANKED¶
- fix Boundless
partread when using GCPs dataset
7.7.2 (2025-05-15)¶
- add
reprmethod to Mosaic Method classes -
add metadata (pixel selection method, assets count, asset used count) on Image/Point object returned by
mosaic_readerfrom rio_tiler.io import Reader from rio_tiler.mosaic import mosaic_reader def tiler(src_path: str, *args, **kwargs): with Reader(src_path) as src: return src.tile(*args, **kwargs) mosaic_assets = ["tests/fixtures/mosaic_value_1.tif", "tests/fixtures/mosaic_value_1.tif", "tests/fixtures/mosaic_value_2.tif"] x = 150 y = 182 z = 9 # Use Default First value method img, _ = mosaic_reader(mosaic_assets, tiler, x, y, z) print(img.metadata) >> {'mosaic_method': 'FirstMethod', 'mosaic_assets_count': 3, 'mosaic_assets_used': 1}
7.7.1 (2025-05-13)¶
- add
max,min,med,q1andq3resampling methods toWarpResamplingliteral
7.7.0 (2025-05-05)¶
- fix size estimation when using
windowanreader.readmethod - add
widthorheightestimation when passing only one size
7.6.1 (2025-04-22)¶
- fix Xarray indexes check when passing a list
7.6.0 (2025-03-31)¶
-
add
interpolate=True/Falseto.point()methods to allow interpolation of surrounding pixelswith Reader("tests/fixtures/cog.tif") as src: pt = src.point(-57.566, 73.68856) print(pt.data[0]) >> 2800 pt = src.point(-57.566, 73.68856, interpolate=True, resampling_method="bilinear") print(pt.data[0]) >> 2819 -
add
pixel_locationproperty toPointDatamodelwith Reader("tests/fixtures/cog.tif") as src: pt = src.point(-57.566, 73.68856) print(pt.pixel_location) >> (1090, 1086) with Reader("tests/fixtures/cog.tif") as src: pt = src.point(-57.566, 73.68856, interpolate=True) print(pt.pixel_location) >> (1090.5924744641266, 1086.2541429827688) -
add
out_dtypeto reader's methods to allow user setting the output data typefrom rio_tiler.io import Reader with Reader("tests/fixtures/cog.tif") as src: img = src.preview() print(img.array.dtype) >> uint16 img = src.preview(out_dtype="float32") print(img.array.dtype) >> float32 -
update pystac dependency to
>=1.9,<2.0
7.5.1 (2025-03-19)¶
- fix
utils.get_array_statisticsmethod to avoidZeroDivisionErrorwhen there is no valid pixel - use
GDAL_MEM_ENABLE_OPEN=TRUEwhen opening a numpy array with rasterio
7.5.0 (2025-02-26)¶
- add
rio_tiler.experimentalsubmodule - add
rio_tiler.experimental.vsifile.VSIReaderVSIFile based experimental reader
7.4.0 (2025-01-28)¶
-
update rasterio dependency to
>=1.4.0 -
add
reprojectmethod forImageDataobjects (author @emmanuelmathot, cogeotiff/rio-tiler!782)from rio_tiler.models import ImageData img = ImageData(numpy.zeros((3, 256, 256), crs=CRS.from_epsg(4326), dtype="uint8")) img_3857 = img.reproject("epsg:3857") -
add
indexesparameter forXarrayReadermethods. As for Rasterio, the indexes values start at1.data = ... # DataArray of shape (2, x, y) # before with XarrayReader(data) as dst: img = dst.tile(0, 0, 0) assert img.count == 2 # now with XarrayReader(data) as dst: # Select the first `band` within the data array img = dst.tile(0, 0, 0, indexes=1) assert img.count == 1 -
better define
band namesforXarrayReaderobjects -
band_name for
2Ddataset is extracted form the firstnon-geocoordinates value```python data = xarray.DataArray( numpy.arange(0.0, 33 * 35 * 2).reshape(2, 33, 35), dims=("time", "y", "x"), coords={ "x": numpy.arange(-170, 180, 10), "y": numpy.arange(-80, 85, 5), "time": [datetime(2022, 1, 1), datetime(2022, 1, 2)], }, ) da = data[0] print(da.coords["time"].data) >> array('2022-01-01T00:00:00.000000000', dtype='datetime64[ns]')) # before with XarrayReader(data) as dst: img = dst.info() print(img.band_descriptions)[0] >> ("b1", "value") # now with XarrayReader(data) as dst: img = dst.info() print(img.band_descriptions)[0] >> ("b1", "2022-01-01T00:00:00.000000000") ``` -
default
band_namesis changed to DataArray's name orarray(when no available coordinates value)```python data = ... # DataArray of shape (x, y) # before with XarrayReader(data) as dst: img = dst.info() print(img.band_descriptions)[0] >> ("b1", "value") # now with XarrayReader(data) as dst: img = dst.info() print(img.band_descriptions)[0] >> ("b1", "array") ```
7.3.1 (2025-01-23)¶
- make sure
STACReader.transformis an Affine object
7.3.0 (2025-01-07)¶
- drop python 3.8 support
- add python 3.13 support
- fix: use coverage array for calculation of valid_percent (author @MarcelCode, cogeotiff/rio-tiler!775)
7.2.2 (2024-11-18)¶
- Catch and expand error message when GDAL cannot encode data using specified image driver (cogeotiff/rio-tiler!767)
7.2.1 (2024-11-14)¶
- add official support for floating point values in ColorMap
- cast data to
uint8datatype when applying linear colormap
7.2.0 (2024-11-05)¶
-
Ensure compatibility between XarrayReader and other Readers by adding
**kwargson class methods (cogeotiff/rio-tiler!762) -
add
STACReader.get_asset_list()method to enable easier customization of the asset listing/validation (cogeotiff/rio-tiler!762)
7.1.0 (2024-10-29)¶
-
Add
preview()andstatistics()methods to XarrayReader (cogeotiff/rio-tiler!755) -
Add output size (
max_size|width,height) options for XarrayReader'spreview(),part()andfeature()methods (cogeotiff/rio-tiler!755) -
Add half X/Y resolution on bounds before checking the geographic bounds in XarrayReader (cogeotiff/rio-tiler!755)
-
Check if the Y bounds are inverted and flip the image on the Y axis in XarrayReader (cogeotiff/rio-tiler!756)
-
Add support for 2D arrays in XarrayReader (cogeotiff/rio-tiler!755)
-
Cast Xarray
attrsvalues in XarrayReader'sinfo()response to avoid JSON encoding issues (cogeotiff/rio-tiler!755) -
Refactor XarrayReader's
feature()method to use thepartmethod (cogeotiff/rio-tiler!755) -
Allow
opparameter forcreate_cutlineand_convert_to_raster_spacefunctions to better control rasterio'srowcolbehaviour (author @Martenz, cogeotiff/rio-tiler!759)
7.0.1 (2024-10-22)¶
- Add
CRS_to_urnmethod and update internals forCRS_to_uri(author @AndrewAnnex, cogeotiff/rio-tiler!752)
7.0.0 (2024-10-21)¶
-
Enable dynamic definition of Asset reader in
MultiBaseReader(cogeotiff/rio-tiler!711, cogeotiff/rio-tiler!728) -
Adding
default_assetsfor MultiBaseReader and STACReader (author @mccarthyryanc, cogeotiff/rio-tiler!722) -
Adding
default_bandsfor MultiBandReader (cogeotiff/rio-tiler!722) -
Adding support for the STAC
Projectionextension to derive thebounds,crs,minzoomandmaxzoomproperties breaking change -
Refactor internal function and base classes for the
minzoom/maxzoomcalculation breaking change -
Adding
transform,heightandwidthattributes (outside init) forSpatialMixinclass -
Moved
_dst_geom_in_tms_crsfrom Reader toSpatialMixinclass breaking change -
Removed use of rasterio's
is_tiledmethod -
Enable Alternate asset's HREF for STAC by using
RIO_TILER_STAC_ALTERNATE_KEYenvironment variable -
Adding support for GDAL VRT Connection string for STAC Assets
-
Improve type hint definition
-
make
ImageData.rescaleandImageData.apply_color_formulato returnself -
add support for
.jsoncolormap files -
do no
lowercasecolormap name inColorMaps.getmethod breaking changefrom rio_tiler.colormap import cmap # before assert cmap.get("Viridis") # now assert cmap.get("Viridis") >> InvalidColorMapName: Invalid colormap name: Viridis -
removed
geographic_crsattribute inSpatialMixinclass breaking change -
removed
geographic_boundsproperty inSpatialMixinclass breaking change -
add
get_geographic_bounds(crs: CRS)method inSpatialMixinclassfrom rasterio.crs import CRS from rio_tiler.io import Reader # before with Reader("cog.tif", geographic_crs=CRS.from_epsg(4326)) as src: bounds = src.geographic_bounds # now with Reader("cog.tif") as src: bounds = src.get_geographic_bounds(CRS.from_epsg(4326)) -
replace
geographic boundswith dataset bounds inReader.info()method's response breaking changefrom rio_tiler.io import Reader # before with Reader("cog.tif") as src: assert src.geographic_bounds == src.info().bounds # now with Reader("cog.tif") as src: assert src.bounds == src.info().bounds -
add
crs: strproperty inInfomodel -
remove
minzoomandmaxzoomproperties inInfomodel breaking change -
update
morecantiledependency to allow6.xversion -
remove deprecated method and attributes
-
roundxarray dataset's bounds to avoid precision errors when checking for valid geographic bounding box -
fix
boundstype information
6.8.0 (2024-10-23)¶
-
Enable Alternate asset's HREF for STAC by using
RIO_TILER_STAC_ALTERNATE_KEYenvironment variable [Backported from7.0] -
Adding support for GDAL VRT Connection string for STAC Assets [Backported from
7.0]
6.7.0 (2024-09-05)¶
- raise
MissingCRSorInvalidGeographicBoundserrors when Xarray datasets have wrong geographic metadata - better error message for
TileOutsideBoundserrors (author @abarciauskas-bgse, cogeotiff/rio-tiler!712) - handle of inverted latitude in
reader.point(author @georgespill, cogeotiff/rio-tiler!716)
6.6.1 (2024-05-17)¶
- fix/support
scale/offsetindexes selection (author @jddeal, cogeotiff/rio-tiler!709)
6.6.0 (2024-05-16)¶
- fix type hint for
ImageData.band_names(author @n8sty, cogeotiff/rio-tiler!704) - enable
per-bandscale/offset rescaling (co-author @jddeal, cogeotiff/rio-tiler!707) -
replace
scaleandoffsetbyscalesandoffsetsinrio_tiler.models.Infomodel# before with Reader("tests/fixtures/cog_scale.tif") as src: info = src.info() print(info.scale, info.offset) >> 0.0001 1000.0 # now with Reader("tests/fixtures/cog_scale.tif") as src: info = src.info() print(info.scales, info.offsets) >> [0.0001, 0.001] [1000.0, 2000.0]
6.5.0 (2024-05-03)¶
- Revert #648 and refactor
get_vrt_transformmethod to better handle over-zooming a dataset
6.4.7 (2024-04-17)¶
- Better handle dataset with inverted origin
- make sure datatype is forwarded to the WarpedVRT
6.4.6 (2024-04-09)¶
- Ignore STAC statistics object when they contain invalid type (author @emmanuelmathot, cogeotiff/rio-tiler!695)
6.4.5 (2024-04-05)¶
- add python 3.12 official support
- change code formatter to
ruff-format
6.4.4 (2024-04-02)¶
- better handler
NaNnodata values for masking (author @cerolinx, cogeotiff/rio-tiler!691)
6.4.3 (2024-03-22)¶
- make sure
scaleandoffsetare set inInfoeven whenoffset=0.orscale=1.0(cogeotiff/rio-tiler!687)
6.4.2 (2024-03-22)¶
- better account for coverage in statistics (cogeotiff/rio-tiler!684)
6.4.1 (2024-02-19)¶
- add
CountMethodmosaic method (author @mccarthyryanc, cogeotiff/rio-tiler!676)
6.4.0 (2024-01-24)¶
-
deprecate
resampling_methodinrio_tiler.io.xarray.XarrayReadermethod and addreproject_method(to match therio_tiler.io.Readeroptions)# before with XarrayReader(data) as dst: img = dst.tile(0, 0, 1, resampling_method="cubic") # now with XarrayReader(data) as dst: img_cubic = dst.tile(0, 0, 1, reproject_method="cubic")
6.3.1 (2024-01-22)¶
- When overriding nodata, do not mix mask and only use the provided nodata value
6.3.0 (2024-01-16)¶
-
do not use
warpedVRTwhen overwriting the dataset nodata value -
add
align_bounds_with_datasetoption inrio_tiler.reader.partto align input bounds with the dataset resolution
6.2.10 (2024-01-08)¶
- remove default Endpoint URL in AWS S3 Client for STAC Reader
6.2.9 (2023-12-21)¶
- fix AWS endpoint credential for STAC
fetchfunction, using same defaults as GDAL vsis3 configuration
6.2.8 (2023-12-11)¶
- apply
discretecolormap when the provided colormap does not have 256 values
6.2.7 (2023-11-29)¶
- Adjusting dataset latitude for WarpedVRT parameters calculation when EPSG:4326 dataset latitudes overflows EPSG:3857 min/max latitude (cogeotiff/rio-tiler!660)
6.2.6 (2023-11-10)¶
- validate
shapeinImageData.get_coverage_arrayto avoid rasterio error when re-projecting the geometry
6.2.5 (2023-11-06)¶
- avoid
indexescollision inMultiBaseReader
6.2.4 (2023-10-19)¶
-
fix issue with
WarpedVRTwhen doing re-projection (ref: cogeotiff/rio-tiler!648) -
move benchmark outside pytest suite
-
add GET/HEAD request tests using tilebench (outside pytest suite) (ref: cogeotiff/rio-tiler!649)
6.2.3.post1 (2023-11-16)¶
- validate
shapeinImageData.get_coverage_arrayto avoid rasterio error when re-projecting the geometry [Backported from 6.2.6] - avoid
indexescollision inMultiBaseReader[Backported from 6.2.5]
This release was made while we waited on a fix for cogeotiff/rio-tiler#654
6.2.3 (2023-10-11)¶
- in
STACReaderusehrefifget_absolute_href()returnsNone
6.2.2 (2023-10-05)¶
- add list of assets in
InvalidAssetNamemessage inSTACReader
6.2.1 (2023-09-28)¶
- allow GeoJSON
FeatureinImageData.get_coverage_arraymethod
6.2.0 (2023-09-27)¶
-
allow area-weighted statistics by adding
coverageoption inrio_tiler.utils.get_array_statistics# Data Array # 1, 2 # 3, 4 data = numpy.ma.array((1, 2, 3, 4)).reshape((1, 2, 2)) # Coverage Array # 0.5, 0 # 1, 0.25 coverage = numpy.array((0.5, 0, 1, 0.25)).reshape((2, 2)) stats = utils.get_array_statistics(data, coverage=coverage) assert len(stats) == 1 assert stats[0]["min"] == 1 assert stats[0]["max"] == 4 assert stats[0]["mean"] == 1.125 # (1 * 0.5 + 2 * 0.0 + 3 * 1.0 + 4 * 0.25) / 4 assert stats[0]["count"] == 1.75 # (0.5 + 0 + 1 + 0.25) sum of the coverage array stats = utils.get_array_statistics(data) assert len(stats) == 1 assert stats[0]["min"] == 1 assert stats[0]["max"] == 4 assert stats[0]["mean"] == 2.5 assert stats[0]["count"] == 4 -
add
rio_tiler.utils.get_coverage_arraymethod to create acoverage %array -
add
cmoceancolormaps
-
allow uppercase in
cmap.getmethodfrom rio_tiler.colormap import cmap # Before cm = cmap.get("greys") # Now cm = cmap.get("Greys")
6.1.0 (2023-09-15)¶
- add
width,heightandcountproperties inMosaicMethodBase - make sure we mosaic ImageData/PointData with same number of bands
- resize
ImageData.arrayto the first asset's width/height inmosaic_reader
6.0.3 (2023-09-13)¶
- return a 1x1 image when bbox is smaller than a single pixel (author @JackDunnNZ, cogeotiff/rio-tiler!637)
6.0.2 (2023-08-21)¶
- Update
data_as_imageto return masked values (author @JackDunnNZ, cogeotiff/rio-tiler!635)
6.0.1 (2023-07-25)¶
- fix
keyaccess forInfoandBandStatisticsmodels forextraattributes - update deprecation notice to
7.0
6.0.0 (2023-07-25)¶
- update
morecantilerequirement to>=5.0,<6.0 - delete
rio_tiler.models.NodataTypes(replaced with Literal within theInfomodel)
5.0.3 (2023-07-18)¶
- Filter useless
NotGeoreferencedWarningwarnings inReader.feature()andImageData.from_bytes()methods - Ensure that dataset is still open when reading tags (author @JackDunnNZ, cogeotiff/rio-tiler!628)
5.0.2 (2023-07-11)¶
- fix
ImageData.apply_color_formula()method
5.0.1 (2023-06-22)¶
- raise
InvalidExpressionwhen passing invalidassetorbandin an expression
5.0.0 (2023-06-01)¶
-
Fix potential issue when getting statistics for non-valid data
-
add
rio-tiler.mosaic.methods.PixelSelectionMethodenums with all defaults methods -
Add
rio-tiler.utils._validate_shape_inputfunction to check geojson feature inputs -
Change cutline handling in the
rio-tiler.io.rasterio.Reader.featuremethod. Feature cutlines are now rasterized into numpy arrays and applied as masks instead of using the cutline vrt_option. These masks are tracked in therio-tiler.models.ImageData.cutline_maskattribute, which are used inrio-tiler.mosaic.methods.base.MosaicMethodBaseto stop mosaic building as soon as all pixels in a feature are populated -
Fix missing
nodata/alpha/maskforwarding for dataset with internal GCPS -
in
rio_tiler.io.XarrayReader, addauto_expandoptions to avoid returning 1D array (incompatible with rio-tiler) (author @abarciauskas-bgse, cogeotiff/rio-tiler!608) -
handle internal and user provided
nodatavalues inrio_tiler.io.XarrayReaderto create mask -
add
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN,AWS_PROFILEandAWS_REGIONenvironnement overrides forrio_tiler.io.stac.aws_get_objectfunction
breaking changes
-
remove support for non-binary mask values (e.g non-binary alpha bands, ref: rasterio/rasterio#1721)
-
switch from PER-DATASET to PER-BAND mask (cogeotiff/rio-tiler!580)
# before with COGReader("cog.tif") as src: img = src.preview(width=128, height=128, max_size=None) assert img.data.shape == (3, 128, 128) assert img.mask.shape == (128, 128) # now with COGReader("cog.tif") as src: img = src.preview(width=128, height=128, max_size=None) assert isinstance(img.array, numpy.ma.MaskedArray) assert img.array.data.shape == (3, 128, 128) assert img.array.mask.shape == (3, 128, 128)) -
use numpy masked array in ImageData and PointData to store the data
# before arr = numpy.zeros((1, 256, 256), dtype="uint16") img = ImageData(arr) assert isintance(img.data, numpy.ndarray) # Attribute # now arr = numpy.zeros((1, 256, 256), dtype="uint16") img = ImageData(arr) assert isintance(img.array, numpy.ma.MaskedArray) # Attribute assert isintance(img.data, numpy.ndarray) # property assert isintance(img.mask, numpy.ndarray) # property -
remove
ImageData.from_arraymethod (because we now support MaskedArray directly) -
rio_tiler.expression.apply_expressioninput/output type change tonumpy.ma.MaskedArray -
rio-tiler
mosaicmethods returnnumpy.ma.MaskedArray -
reader's
post_processshould be a Callable withnumpy.ma.MaskedArrayinput/output -
add
reproject_methodoption inrio_tiler.reader's method to select theresamplingmethod used during reprojection# before with Reader("cog.tif") as src: im = src.preview( dst_crs="epsg:4326", resampling_method="bilinear", # use `bilinear` for both resizing and reprojection ) # now with Reader("cog.tif") as src: im = src.preview( dst_crs="epsg:4326", resampling_method="cubic", # use `cubic` for resizing reproject_method="bilinear", # use `bilinear` for reprojection ) -
refactored the
MosaicMethodBaseto use python's dataclass -
changed variable names in
MosaicMethodBase(tile->mosaic) -
rio_tiler.mosaic.methods.defaults.LastBandHighrenamedLastBandHighMethod -
rio_tiler.mosaic.methods.defaults.LastBandLowrenamedLastBandLowMethod -
move
aws_get_objectfromrio_tiler.utilstorio_tiler.io.stac -
make
boto3an optional dependency (python -m pip install rio-tiler["s3"]) -
update
morecantiledependency to>=4.0 -
add
metadatain ImageData/PointData from rasterio datasettags -
forward statistics from the raster STAC extension to the ImageData object
with STACReader(STAC_RASTER_PATH) as stac: info = stac._get_asset_info("green") assert info["dataset_statistics"] == [(6883, 62785)] assert info["metadata"] assert "raster:bands" in info["metadata"] img = stac.preview(assets=("green", "red")) assert img.dataset_statistics == [(6883, 62785), (6101, 65035)] assert img.metadata["green"] # extra_fields from the STAC assets (e.g `"raster:bands"`) assert img.metadata["red"] -
add Deprecation warning for
ImageData.from_array,ImageData.as_masked,PointData.as_maskedmethods
4.1.13 (2023-06-22)¶
- raise InvalidExpression when passing invalid asset or band in an expression (Backported from 5.0.1)
4.1.12 (2023-06-16)¶
- fix issue with
rio_tiler.utils.get_array_statisticswhen passing data with novalidvalue
4.1.11 (2023-05-18)¶
- in
rio_tiler.io.XarrayReader, addauto_expandoptions to avoid returning 1D array (incompatible with rio-tiler) (author @abarciauskas-bgse, cogeotiff/rio-tiler!608)
4.1.10 (2023-03-24)¶
- enable
boundlessgeometry for cutline (author @yellowcap, cogeotiff/rio-tiler!586)
4.1.9 (2023-02-28)¶
- Automatically expand 2D numpy array to 3D when creating ImageData
4.1.8 (2023-02-15)¶
- Fix dtype issue when working with Mosaics Methods. Mask should always been of type
Uint8. - Fix
ImageData.from_arraymethod when working with Masked array
4.1.7 (2023-02-07)¶
- add
from_arrayandfrom_bytesImageData creation methods - add
statisticsmethod to ImageData
4.1.6 (2023-01-18)¶
- add
apply_colormapmethod to the ImageData class - fix potential datatype overflow when calculating the intersection of mask and alpha band when using Colormap
4.1.5 (2022-12-20)¶
- Fix inverted col/row check when doing window read of a non WarpedVRT dataset
4.1.4 (2022-12-16)¶
-
add
rio_tiler.mosaic.mosaic_point_readerfunction to create Point value from multiple observationdef reader(asset: str, *args, **kwargs) -> PointData: with Reader(asset) as src: return src.point(*args, **kwargs) pt: PointData = mosaic_point_reader(["cog.tif", "cog2.tif"], reader, 0, 0)
4.1.3 (2022-12-15)¶
- fix invalid definition of
PointData.maskwhen mask is not provided. Makes sure it's a one element array.
4.1.2 (2022-12-15)¶
- raise
InvalidPointDataErrorerror when trying to create PointData from an empty list inPointData.create_from_list
4.1.1 (2022-12-12)¶
- fix invalid coordinates slicing for
XArrayReader.point()method (author @benjaminleighton, cogeotiff/rio-tiler!559)
4.1.0 (2022-11-24)¶
- add
asset_as_bandoption inMultiBaseReadertile, part, preview, feature and point methods
with STACReader(STAC_PATH) as stac:
img = stac.tile(71, 102, 8, assets="green")
assert img.band_names == ["green_b1"]
with STACReader(STAC_PATH) as stac:
img = stac.tile(71, 102, 8, assets="green", asset_as_band=True)
assert img.band_names == ["green"]
# For expression, without `asset_as_band` tag, users have to pass `_b{n}` suffix to indicate the band index
with STACReader(STAC_PATH) as stac:
img = stac.tile(71, 102, 8, expression="green_b1/red_b1")
assert img.band_names == ["green_b1/red_b1"]
with STACReader(STAC_PATH) as stac:
img = stac.tile(71, 102, 8, expression="green/red", asset_as_band=True)
assert img.band_names == ["green/red"]
4.0.0 (2022-11-21)¶
- remove deprecated code
asset_expressionin MultiBaseReaderGCPCOGReader
4.0.0a2 (2022-11-15)¶
- use of
file:header_sizeextension inSTACReaderto setGDAL_INGESTED_BYTES_AT_OPENenvironment variable
breaking changes
- renamed
MultiBaseReader._get_asset_urltoMultiBaseReader._get_asset_infoand change the output to return a dictionary in form of{"url": ..., "env": ...}
4.0.0a1 (2022-11-10)¶
- assign ColorInterp.alpha to rendered image when we add the mask band
- add
.clip(bbox: BBox)and.resize(height: int, width: int)methods to ImageData object - add python 3.11 support
- replace
rio-colorbycolor-operationsmodule
4.0.0a0 (2022-10-20)¶
- add python 3.10 support
- add
apply_expressionmethod inrio_tiler.models.ImageDataclass - update
rio-tiler.reader.read/partto avoid using WarpedVRT when no reprojection or nodata override is needed -
add
rio_tiler.io.rasterio.ImageReaderto work either with Non-geo or Geo images in a Non-geo manner (a.k.a: in the pixel coordinates system)with ImageReader("image.jpg") as src: im = src.part((0, 100, 100, 0)) with ImageReader("image.jpg") as src: im = src.tile(0, 0, src.maxzoom) print(im.bounds) >>> BoundingBox(left=0.0, bottom=256.0, right=256.0, top=0.0) -
add
rio_tiler.io.xarray.XarrayReaderto work withxarray.DataArrayimport xarray from rio_tiler.io import XarrayReader with xarray.open_dataset( "https://ncsa.osn.xsede.org/Pangeo/pangeo-forge/noaa-coastwatch-geopolar-sst-feedstock/noaa-coastwatch-geopolar-sst.zarr", engine="zarr", decode_coords="all" ) as src: ds = src["analysed_sst"][:1] ds.rio.write_crs("epsg:4326", inplace=True) with XarrayReader(ds) as dst: img = dst.tile(1, 1, 2)note:
xarrayandrioxarrayoptional dependencies are needed for the reader
breaking changes
- remove python 3.7 support
- update rasterio requirement to
>=1.3to allow python 3.10 support - rename
rio_tiler.io.cogeotorio_tiler.io.rasterio -
rename
COGReadertoReader. We addedrio_tiler.io.COGReaderalias torio_tiler.io.Readerbackwards compatibility# before from rio_tiler.io import COGReader from rio_tiler.io.cogeo import COGReader # now from rio_tiler.io import Reader from rio_tiler.io.rasterio import Reader -
rio_tiler.readers.read(),rio_tiler.readers.part(),rio_tiler.readers.preview()now return a ImageData object - remove
minzoomandmaxzoomattribute inrio_tiler.io.SpatialMixinbase class - remove
minzoomandmaxzoomattribute inrio_tiler.io.Reader(now defined as properties) -
use
bprefix for band names inrio_tiler.models.ImageDataclass (and in rio-tiler's readers)# before with COGReader("cog.tif") as cog: img = cog.read() print(cog.band_names) >>> ["1", "2", "3"] print(cog.info().band_metadata) >>> [("1", {}), ("2", {}), ("3", {})] print(cog.info().band_descriptions) >>> [("1", ""), ("2", ""), ("3", "")] print(list(cog.statistics())) >>> ["1", "2", "3"] # now with Reader("cog.tif") as cog: img = cog.read() print(img.band_names) >>> ["b1", "b2", "b3"] print(cog.info().band_metadata) >>> [("b1", {}), ("b2", {}), ("b3", {})] print(cog.info().band_descriptions) >>> [("b1", ""), ("b2", ""), ("b3", "")] print(list(cog.statistics())) >>> ["b1", "b2", "b3"] with STACReader("stac.json") as stac: print(stac.tile(701, 102, 8, assets=("green", "red")).band_names) >>> ["green_b1", "red_b1"] -
depreciate
asset_expressionin MultiBaseReader. Use of expression is now possible -
expressionfor MultiBaseReader must be in form of{asset}_b{index}# before with STACReader("stac.json") as stac: stac.tile(701, 102, 8, expression="green/red") # now with STACReader("stac.json") as stac: stac.tile(701, 102, 8, expression="green_b1/red_b1") -
rio_tiler.reader.point()(and all Reader's point methods) now return a rio_tiler.models.PointData object# before with rasterio.open("cog.tif") as src:: v = rio_tiler.reader.point(10.20, -42.0) print(v) >>> [0, 0, 0] with COGReader("cog.tif") as cog: print(cog.point(10.20, -42.0)) >>> [0, 0, 0] # now with rasterio.open("cog.tif") as src:: v = rio_tiler.reader.point(src, (10.20, -42)) print(v) >>> PointData( data=array([3744], dtype=uint16), mask=array([255], dtype=uint8), band_names=['b1'], coordinates=(10.20, -42), crs=CRS.from_epsg(4326), assets=['cog.tif'], metadata={} ) with Reader("cog.tif") as cog: print(cog.point(10.20, -42.0)) >>> PointData( data=array([3744], dtype=uint16), mask=array([255], dtype=uint8), band_names=['b1'], coordinates=(10.20, -42), crs=CRS.from_epsg(4326), assets=['cog.tif'], metadata={} ) -
deleted
rio_tiler.reader.previewfunction and updatedrio_tiler.reader.readto allow width/height/max_size options - reordered keyword options in all
rio_tiler.readerfunction for consistency - removed
AlphaBandWarningwarning when automatically excluding alpha band from data -
remove
nodata,unscale,resampling_method,vrt_optionsandpost_processoptions toReaderinit method and replaced withoptions# before with COGReader("cog.tif", nodata=1, resampling_method="bilinear") as cog: data = cog.preview() # now with Reader(COGEO, options={"nodata": 1, "resampling_method": "bilinear"}) as cog: data = cog.preview()
3.1.6 (2022-07-22)¶
- Hide
NotGeoreferencedWarningwarnings inutils.renderandutils.resize_array - update
MultiBaseReaderandMultiBandReaderpointsmethod to prepare for numpy changes.
3.1.5 (2022-07-06)¶
- Deprecate
rio_tiler.io.GCPCOGReaderand allow GPCS dataset to be opened byrio_tiler.io.COGReader
# before
with GCPCOGReader("my.tif") as cog:
...
# now, COGReader will find the gcps and create an internal WarpedVRT using the gpcs and crs
with COGReader("my.tif") as cog:
...
- add
ImageData.rescaleto rescale the array in place - add
ImageData.apply_color_formulato apply color formula in place
3.1.4 (2022-04-14)¶
- Fix cutline creation for MultiPolygon (author @Fernigithub, cogeotiff/rio-tiler!493)
3.1.3 (2022-04-08)¶
- Switch to
pyproject.tomlandflitfor packaging (cogeotiff/rio-tiler!490) - Catch discrete colormap with negative values (cogeotiff/rio-tiler!492)
3.1.2 (2022-03-25)¶
- avoid calculating statistics for non-finite values (cogeotiff/rio-tiler!489)
3.1.1 (2022-03-17)¶
- forward
band namesto ImageData output inmosaic_reader(cogeotiff/rio-tiler!486)
3.1.0 (2022-02-21)¶
- add support for setting the S3 endpoint url scheme via the
AWS_HTTPSenvironment variables inaws_get_objectfunction using boto3 (cogeotiff/rio-tiler!476) - Add semicolon
;support for multi-blocks expression (cogeotiff/rio-tiler!479) - add
rio_tiler.expression.get_expression_blocksmethod to split expression (cogeotiff/rio-tiler!479) - add
merged_statisticsmethod forMultiBaseReaderto get statistics using between assets expression (cogeotiff/rio-tiler!478)
future deprecation
- using a comma
,in an expression to define multiple blocks will be replaced by semicolon;
# before
expression = "b1+b2,b2"
# new
expression = "b1+b2;b2"
breaking changes
- update morecantile requirement to
>=3.1,<4.0. WebMercatorQuad TMS is now aligned with GDAL and Mercantile TMS definition.
3.0.3 (2022-01-18)¶
- make sure we raise an HTTP exception when using an invalid STAC url (cogeotiff/rio-tiler!475)
3.0.2 (2022-01-03)¶
- switch from
functools.lru_cachetocachetools.LRUCacheto allow unashable options inrio_tiler.io.stac.fetchfunction (cogeotiff/rio-tiler!471)
3.0.1 (2021-12-03)¶
- avoid useless call to
transform_boundsif input/output CRS are equals (cogeotiff/rio-tiler!466) - make sure
geographic_boundsdon't return inf or nan values (cogeotiff/rio-tiler!467)
3.0.0 (2021-11-29)¶
- no change since
3.0.0a6
3.0.0a6 (2021-11-22)¶
- add
rio_tiler.utils.resize_arrayto resize array to a given width/height (cogeotiff/rio-tiler!463) - use
resize_arrayinImageData.create_from_listto avoid trying merging array of different sizes (cogeotiff/rio-tiler!463)
breaking changes
- update
MultiBaseReaderandMultiBandReaderto be their own abstract classes instead of being subclass ofBaseReader. - put
readerattribute outside of the__init__method forMultiBaseReaderandMultiBandReader.
3.0.0a5 (2021-11-18)¶
- allow the definition of
geographic_crsused in thegeographic_boundsproperty (cogeotiff/rio-tiler!458) - use
contextlib.ExitStackto better manager opening/closing rasterio dataset (cogeotiff/rio-tiler!459) - moves
BBox, ColorTuple, Indexes, NoData, NumTypetype definitions inrio_tiler.types(cogeotiff/rio-tiler!460) - better types definition for ColorMap objects (cogeotiff/rio-tiler!460)
- fix some types issues (cogeotiff/rio-tiler!460)
3.0.0a4 (2021-11-10)¶
- refactor
SpatialMixin.tile_existsto compare the bounds in the dataset's coordinate system to avoid coordinates overflow (a TMS CRS bounds can be smaller than the dataset CRS bounds) (cogeotiff/rio-tiler!455)
3.0.0a3 (2021-11-03)¶
- Reader's
infoandstatisticsmethods to default to availablebandsorassetsif not provided (cogeotiff/rio-tiler!451)
3.0.0a2 (2021-10-21)¶
- Allow
rio_tiler.utils.get_array_statisticsto return0for unfound category, instead of raising an error (cogeotiff/rio-tiler!443)
3.0.0a1 (2021-10-20)¶
breaking changes
-
add
inputin BaseReader class definition to avoid type mismatch (cogeotiff/rio-tiler!450)Note:
inputreplacesfilepathattribute in STACReader and COGReader.
removed
-
rio_tiler.models.ImageStatisticsmodel
3.0.0a0 (2021-10-19)¶
- add
crsproperty inrio_tiler.io.base.SpatialMixin(cogeotiff/rio-tiler!429) - add
geographic_boundsinrio_tiler.io.base.SpatialMixinto return bounds in WGS84 (cogeotiff/rio-tiler!429)
from rio_tiler.io import COGReader
with COGReader("https://rio-tiler-dev.s3.amazonaws.com/data/fixtures/cog.tif") as cog:
print(cog.bounds)
>> (373185.0, 8019284.949381611, 639014.9492102272, 8286015.0)
print(cog.crs)
>> "EPSG:32621"
print(cog.geographic_bounds)
>> (-61.28762442711404, 72.22979795551834, -52.301598718454485, 74.66298001264106)
- Allow errors to be ignored when trying to find
zoomsfor dataset inrio_tiler.io.COGReader. If we're not able to find the zooms in selected TMS, COGReader will defaults to the min/max zooms of the TMS (cogeotiff/rio-tiler!429)
from pyproj import CRS
from morecantile import TileMatrixSet
from rio_tiler.io import COGReader
# For a non-earth dataset there is no available transformation from its own CRS and the default WebMercator TMS CRS.
with COGReader("https://rio-tiler-dev.s3.amazonaws.com/data/fixtures/cog_nonearth.tif") as cog:
>> UserWarning: Cannot determine min/max zoom based on dataset information, will default to TMS min/max zoom.
print(cog.minzoom)
>> 0
print(cog.maxzoom)
>> 24
# if we use a `compatible TMS` then we don't get warnings
europa_crs = CRS.from_authority("ESRI", 104915)
europa_tms = TileMatrixSet.custom(
crs=europa_crs,
extent=europa_crs.area_of_use.bounds,
matrix_scale=[2, 1],
)
with COGReader(
"https://rio-tiler-dev.s3.amazonaws.com/data/fixtures/cog_nonearth.tif",
tms=europa_tms,
) as cog:
print(cog.minzoom)
>> 4
print(cog.maxzoom)
>> 6
- compare dataset bounds and tile bounds in TMS crs in
rio_tiler.io.base.SpatialMixin.tile_existsmethod to allow dataset and TMS not compatible with WGS84 crs (cogeotiff/rio-tiler!429) - use
httpxpackage instead of requests (author @rodrigoalmeida94, cogeotiff/rio-tiler!431) - allow half pixel
tile_bufferaround the tile (e.g 0.5 -> 257x257, 1.5 -> 259x259) (author @bstadlbauer, cogeotiff/rio-tiler!405) - add support for intervals colormap (cogeotiff/rio-tiler!439))
from rio_tiler.colormap import apply_cmap, apply_intervals_cmap
data = numpy.random.randint(0, 255, size=(1, 256, 256))
cmap = [
# ([min, max], [r, g, b, a])
([0, 1], [0, 0, 0, 0]),
([1, 10], [255, 255, 255, 255]),
([10, 100], [255, 0, 0, 255]),
([100, 256], [255, 255, 0, 255]),
]
data, mask = apply_intervals_cmap(data, cmap)
# or
data, mask = apply_cmap(data, cmap)
breaking changes
- update morecantile requirement to version >=3.0 (cogeotiff/rio-tiler!418)
- remove python 3.6 support (cogeotiff/rio-tiler!418)
- remove
max_sizedefaults forCOGReader.partandCOGReader.feature, which will now default to full resolution reading.
# before
with COGReader("my.tif") as cog:
img = cog.part(*cog.dataset.bounds, dst_crs=cog.dataset.crs, bounds_crs=cog.dataset.crs)
# by default image should be max 1024x1024
assert max(img.width, 1024) # by default image should be max 1024x1024
assert max(img.height, 1024)
# now (there is no more max_size default)
with COGReader("my.tif") as cog:
img = cog.part(*cog.dataset.bounds, dst_crs=cog.dataset.crs, bounds_crs=cog.dataset.crs)
assert img.width == cog.dataset.width
assert img.height == cog.dataset.height
-
add
.statisticsmethod in base classes (cogeotiff/rio-tiler!427) -
remove
rio_tiler.io.base.SpatialMixin.spatial_infoandrio_tiler.io.base.SpatialMixin.centerproperties (cogeotiff/rio-tiler!429) -
Reader's
.boundsproperty should now be in dataset's CRS, not inWGS84(cogeotiff/rio-tiler!429)
# before
with COGReader("my.tif") as cog:
print(cog.bounds)
>>> (-61.287001876638215, 15.537756794450583, -61.27877967704677, 15.542486503997608)
# now
with COGReader("my.tif") as cog:
print(cog.bounds)
>>> (683715.3266400001, 1718548.5702, 684593.2680000002, 1719064.90736)
print(cog.crs)
>>> EPSG:32620
print(cog.geographic_bounds)
>>> (-61.287001876638215, 15.537756794450583, -61.27877967704677, 15.542486503997608)
- Use
RIO_TILER_MAX_THREADSenvironment variable instead ofMAX_THREADS(author @rodrigoalmeida94, cogeotiff/rio-tiler!432) - remove
band_expressioninrio_tiler.io.base.MultiBandReader(cogeotiff/rio-tiler!433) - change
asset_expressioninput type fromstrtoDict[str, str]inrio_tiler.io.base.MultiBaseReader(cogeotiff/rio-tiler!434)
# before
with STACReader("mystac.json") as stac:
img = stac.preview(
assets=("data1", "data2"),
asset_expression="b1*2", # expression was applied to each asset
)
# now
with STACReader("mystac.json") as stac:
img = stac.preview(
assets=("data1", "data2"),
asset_expression={"data1": "b1*2", "data2": "b2*100"}, # we can now pass per asset expression
)
- add
asset_indexesinrio_tiler.io.base.MultiBaseReader, which replacesindexes. (cogeotiff/rio-tiler!434)
# before
with STACReader("mystac.json") as stac:
img = stac.preview(
assets=("data1", "data2"),
indexes=(1,), # indexes was applied to each asset
)
# now
with STACReader("mystac.json") as stac:
img = stac.preview(
assets=("data1", "data2"),
asset_indexes={"data1": 1, "data2": 2}, # we can now pass per asset indexes
)
removed
rio_tiler.io.BaseReader.metadataandrio_tiler.io.BaseReader.statsbase class methods (cogeotiff/rio-tiler!425)rio_tiler.reader.statsfunction (cogeotiff/rio-tiler!440)rio_tiler.reader.metadatafunction (cogeotiff/rio-tiler!440)rio_tiler.utils._statsfunction (cogeotiff/rio-tiler!440)
2.1.3 (2021-09-14)¶
- Make sure output data is of type
Uint8when applying a colormap (cogeotiff/rio-tiler!423) - Do not auto-rescale data if there is a colormap (cogeotiff/rio-tiler!423)
2.1.2 (2021-08-10)¶
- update type information for mosaics functions (cogeotiff/rio-tiler!409)
2.1.1 (2021-07-29)¶
- add support for setting the S3 endpoint url via the
AWS_S3_ENDPOINTenvironment variables inaws_get_objectfunction using boto3 (cogeotiff/rio-tiler!394) - make
ImageStatistics.valid_percenta value between 0 and 100 (instead of 0 and 1) (author @param-thakker, cogeotiff/rio-tiler!400) -
add
fetch_optionstoSTACReaderto allow custom configuration to the fetch client (cogeotiff/rio-tiler!404)with STACReader("s3://...", fetch_options={"request_pays": True}): pass -
Fix alpha band values when storing
Uint16data in PNG. (cogeotiff/rio-tiler!407)
2.1.0 (2021-05-17)¶
- add auto-rescaling in
ImageData.rendermethod to avoid error when datatype is not supported by the output driver (cogeotiff/rio-tiler!391)
# before - exit with error
with open("img.png", "wb") as f:
f.write(ImageData(numpy.zeros((3, 256, 256), dtype="float32")).render())
>>> (ERROR) CPLE_NotSupportedError: "PNG driver doesn't support data type Float32. Only eight bit (Byte) and sixteen bit (UInt16) bands supported".
# now - print a warning
with open("img.png", "wb") as f:
f.write(ImageData(numpy.zeros((3, 256, 256), dtype="float32")).render())
>>> (WARNING) InvalidDatatypeWarning: "Invalid type: `float32` for the `PNG` driver. Data will be rescaled using min/max type bounds".
breaking changes
- change type of
in_rangeoption inImageData.rendertoSequence[Tuple[NumType, NumType]](cogeotiff/rio-tiler!391)
img = ImageData(numpy.zeros((3, 256, 256), dtype="uint16"))
# before - Tuple[NumType, NumType]
buff = img.render(in_range=(0, 1000, 0, 1000, 0, 1000))
# now - Sequence[Tuple[NumType, NumType]]
buff = img.render(in_range=((0, 1000), (0, 1000), (0, 1000)))
2.0.8 (2021-04-26)¶
- add warning when dataset doesn't have overviews (cogeotiff/rio-tiler!386)
- add
width,height,countandoverviewsinfos inCOGReader.info()(cogeotiff/rio-tiler!387) - add
driverinCOGReader.info()output (cogeotiff/rio-tiler!388) - add
valid_percentinstatsoutput (cogeotiff/rio-tiler!389)
2.0.7 (2021-04-01)¶
- use importlib.resources
.filesmethod to resolve the package directory (cogeotiff/rio-tiler!379)
2.0.6 (2021-03-25)¶
- add
read()method in COGReader (cogeotiff/rio-tiler!366) - add
tile_bufferoption toCOGReader.tile()method to add pixels around a tile request (cogeotiff/rio-tiler#365) - use
importlib.resources.pathto find rio-tilercmap_datadirectory (cogeotiff/rio-tiler!370) - re-use type definitions (cogeotiff/rio-tiler#337)
2.0.5 (2021-03-17)¶
- make sure
py.typedis included in the package (cogeotiff/rio-tiler!363) - add
jpgalias inimg_profiles(cogeotiff/rio-tiler!364)
from rio_tiler.profiles import img_profiles
jpeg = img_profiles.get("jpeg")
jpg = img_profiles.get("jpg")
assert jpeg == jpg
2.0.4 (2021-03-09)¶
- Added pystac.MediaType.COG in supported types by STAC reader
- fix bad type definition in
rio_tiler.colormap.ColorMapsdata (cogeotiff/rio-tiler#359) - add
rio_tiler.colormap.parse_colorfunction to parse HEX color (cogeotiff/rio-tiler#361)
2.0.3 (2021-02-19)¶
- Reduce the number of
.read()calls for dataset without nodata value (cogeotiff/rio-tiler!355) - replace deprecated
numpy.floatbynumpy.float64
2.0.2 (2021-02-17)¶
- fix bad mask datatype returned by mosaic methods (cogeotiff/rio-tiler!353)
- align WarpedVRT with internal blocks when needed. This is to reduce the number of GET requests need for VSI files (cogeotiff/rio-tiler!345)
2.0.1 (2021-02-04)¶
- fix arguments names conflicts between mosaic_reader/tasks and STACReader options (cogeotiff/rio-tiler!343)
- update rio-tiler pypi description.
2.0.0 (2021-01-27)¶
- add MultiPolygon support in
rio_tiler.utils.create_cutline(cogeotiff/rio-tiler#323) - support discrete colormap by default in
apply_cmap(cogeotiff/rio-tiler#321) - delete deprecated
rio_tiler.mercatorsubmodule - added default factory in
rio_tiler.colormap.ColorMaps. - fix missing
metadataforwarding inImageData.post_processmethod. - refactor
rio_tiler.io.GCPCOGReaderfor better inheritance from COGReader.
breaking change
- renamed input parameter
tiletodatainrio_tiler.utils.render. - renamed input parameter
arrtodatainrio_tiler.utils.mapzen_elevation_rgb - made
rio_tiler.io.stac.to_pystac_itemprivate (renamed to_to_pystac_item) - renamed
rio_tiler.colormap.DEFAULTS_CMAPStorio_tiler.colormap.DEFAULT_CMAPS_FILES - made
rio_tiler.reader._readpublic (renamed to rio_tiler.reader.read) (ref: cogeotiff/rio-tiler#332)
2.0.0rc4 (2020-12-18)¶
- add
NPZoutput format (cogeotiff/rio-tiler#308) - add pystac for STAC item reader (author @emmanuelmathot, cogeotiff/rio-tiler#212)
- delete deprecated function:
rio_tiler.reader.tile,rio_tiler.utils.tile_exitsandrio_tiler.utils.geotiff_options - deprecated
rio_tiler.mercatorsubmodule (cogeotiff/rio-tiler#315) - update morecantile version to 2.1, which has better
tms.zoom_for_resdefinition.
2.0.0rc3 (2020-11-24)¶
- add
featuremethod to reader classes (cogeotiff/rio-tiler#306)
2.0.0rc2 (2020-11-17)¶
- add
datavalidation inrio_tiler.models.ImageDatamodel. Data MUST be a 3 dimensions array in form of (count, height, width). maskis now optional forrio_tiler.models.ImageDatamodel, but will be initialized to a default full valid (255) array.
import numpy
from rio_tiler.models import ImageData
data = numpy.random.rand(3, 10, 10)
img = ImageData(data)
assert img.mask.all()
- add
metadataproperty torio_tiler.models.ImageDatamodel
img.metadata
>>> {}
breaking change
rio_tiler.mosaic.reader.mosaic_readernow raisesEmptyMosaicErrorinstead of returning an emptyImageData
2.0.0rc1.post1 (2020-11-12)¶
- Remove
Uint8data casting before applyingcolor_formulain ImageData.render (cogeotiff/rio-tiler#302)
2.0.0rc1 (2020-11-09)¶
- added
ImageDataoutput class for allrio_tiler.ioclasses returning numpy array-like types (tile, mask = method())
from rio_tiler.io import COGReader
from rio_tiler.models import ImageData
with COGReader("/Users/vincentsarago/S-2_20200422_COG.tif") as cog:
r = cog.preview()
assert isinstance(r, ImageData)
data, mask = r
assert data.shape == (3, 892, 1024)
Note: the class keeps the compatibility with previous notation: tile, mask = ImageData
-
add pydantic models for IO outputs (Metadata, Info, ...)
-
change output form for
band_metadata,band_descriptionsand do not add band description when not found.
# Before
with COGReader("/Users/vincentsarago/S-2_20200422_COG.tif") as cog:
i = cog.info()
print(i["band_metadata"])
print(i["band_descriptions"])
[(1, {}), (2, {}), (2, {})]
[(1, 'band1'), (2, 'band2'), (2, 'band3')]
# Now
with COGReader("/Users/vincentsarago/S-2_20200422_COG.tif") as cog:
i = cog.info()
print(i.band_metadata)
print(i.band_descriptions)
[('1', {}), ('2', {}), ('3', {})]
[('1', ''), ('2', ''), ('3', '')]
- change output form for
stats
# Before
with COGReader("/Users/vincentsarago/S-2_20200422_COG.tif") as cog:
print(cog.stats())
{
1: {...},
2: {...},
3: {...}
}
# Now
with COGReader("/Users/vincentsarago/S-2_20200422_COG.tif") as cog:
print(cog.stats())
{
"1": {...},
"2": {...},
"3": {...}
}
- updated
rio_tiler.utils._statsfunction to replacepcbypercentiles
with COGReader("/Users/vincentsarago/S-2_20200422_COG.tif") as cog:
print(cog.stats()["1"].json())
{"percentiles": [19.0, 168.0], "min": 0.0, "max": 255.0, ...}
- make
rio_tiler.colormap.ColorMapobject immutable. Registering a new colormap will new returns a now instance of ColorMap(cogeotiff/rio-tiler#289). - changed the
rio_tiler.colormap.ColorMap.register()method to take a dictionary as input (instead of name + dict).
from rio_tiler.colormap import cmap # default cmap
# previous
cmap.register("acmap", {0: [0, 0, 0, 0], ...})
# Now
cmap = cmap.register({"acmap": {0: [0, 0, 0, 0], ...}})
-
added the possibility to automatically register colormaps stored as
.npyfile in a directory, ifCOLORMAP_DIRECTORYenvironment variable is set with the name of the directory. -
Update to morecantile 2.0.0
2.0.0b19 (2020-10-26)¶
- surface
allowed_exceptionsoptions inrio_tiler.mosaic.reader.mosaic_reader(cogeotiff/rio-tiler#293) - add SpatialInfoMixin base class to reduce code duplication (co-author with @geospatial-jeff, cogeotiff/rio-tiler!295)
- add
AsyncBaseReaderto support async readers (author @geospatial-jeff, cogeotiff/rio-tiler!265)
2.0.0b18 (2020-10-22)¶
- surface dataset.nodata in COGReader.nodata property (cogeotiff/rio-tiler!292)
- fix non-threaded tasks scheduler/filter (cogeotiff/rio-tiler!291)
2.0.0b17 (2020-10-13)¶
- switch to morecantile for TMS definition (ref: cogeotiff/rio-tiler#283)
- add tms options in Readers (breaking change if you create custom Reader from BaseReader)
- add tile_bounds vs bounds check in tile methods for MultiBands and MultiBase classes
- add tile_exists method in BaseReader (take tms in account)
- adapt zooms calculation in COGReader
- add
LastBandHighandLastBandLowpixel selection (ref: cogeotiff/rio-tiler!270)
Deprecated function
- rio_tiler.reader.tile
- rio_tiler.utils.geotiff_options
- rio_tiler.utils.tile_exists
- rio_tiler.io.multi_*
2.0.0b16 (2020-10-07)¶
- remove
pkg_resources(pypa/setuptools#510) - refactor default colormap lookup to use pathlib instead of pkg_resources.
Note: We changed the versioning scheme to {major}.{minor}.{path}{pre}{prenum}
2.0b15 (2020-10-05)¶
- Fix missing Exception catching when running task outside threads (ref: developmentseed/titiler#130).
- add rio-tiler logger (cogeotiff/rio-tiler#277).
2.0b14.post2 (2020-10-02)¶
- Fix bug in
MultiBandReader(ref: cogeotiff/rio-tiler#275) and add tests.
2.0b14.post1 (2020-10-02)¶
- add
MultiBandReaderandGCPCOGReaderinrio_tiler.ioinit.
2.0b14 (2020-10-02)¶
- Added back the Conctext Manager methods in
rio_tiler.io.base.BaseReaderbut not as@abc.abstractmethod(ref: github.com/cogeotiff/rio-tiler/pull/273#discussion_r498937943) - Move
rio_tiler_pds.reader.MultiBandReaderandrio_tiler_pds.reader.GCPCOGReaderto rio-tiler (cogeotiff/rio-tiler!273)
2.0b13 (2020-10-01)¶
- remove ContextManager requirement for
rio_tiler.io.base.BaseReaderandrio_tiler.io.base.MultiBaseReaderbase classes. - move ContextManager properties definition to
__attrs_post_init__method inrio_tiler.io.STACReaderandrio_tiler.io.COGReader(ref: cogeotiff/rio-tiler-pds#21)
2.0b12 (2020-09-28)¶
- Make sure Alpha band isn't considered as an internal mask by
utils.has_mask_band
2.0b11 (2020-09-24)¶
- reduce verbosity in
rio_tiler.tasks.filter_tasksexception logging (#266).
2.0b10 (2020-09-15)¶
- add
post_processcallback torio_tiler.render._readandrio_tiler.render.pointto apply specific operation ouput arrays.
2.0b9 (2020-09-09)¶
- restore Mkdocs search bar (#255)
- Allow class (not just instance) to be passed to pixel_selection (#250)
- Add Binder link/badge to README (#254)
- Add mkdocs-jupyter to show notebooks in website (#253)
- Remove deprecated functions (#247)
- Export modules from top-level package (#246)
- Allow overwriting colormap with force=True (#249)
- Pin black version (#251)
- Add contributing.md (#242)
- Add mkdocs config (#240)
- Add
NPYsupport inrio_tiler.utils.renderto save tile in numpy binary format (#256) - Remove bare
Exceptionand add more detailed errors (#248)
2.0b8 (2020-08-24)¶
- raise specific
PointOutsideBoundsin rio_tiler.reader.point (#236)
2.0b7 (2020-08-21)¶
- allow setting default kwargs in COGReader init (#227)
- allow
vrt_optionsin COGReader.point - add
rio_tiler.io.base.MultiBaseReaderclass (#225) - refactor
rio_tiler.io.stac.STACReaderto use MultiBaseReader (#225) - add
rio_tiler.tasksubmodule to share tools for handling rio-tiler's future tasks. - fix regex parsing for rio-tiler expression
- add warnings when assets/indexes is passed with expression option (#233)
Breaking Changes: * replace dataclass wiht attr to support more flexible class definition (see #225)
2.0b6 (2020-08-04)¶
- add
utils.create_cutlinehelper (#218) - remove any mutable default argument
depreciation
* warp_vrt_option is replaced by vrt_options in rio_tiler.reader.part (#221)
2.0b5 (2020-07-31)¶
- add more verbosity to mosaic error (#214)
Breaking Changes:
* rio_tiler.mosaic.reader.mosaic_reader return ((tile, mask), assets_used)
* COGReader.info is now a method instead of a property to align with other reader (#211)
2.0b4 (2020-07-30)¶
- add rio_tiler.io.base.BaseReader abstract class for COGReader and STACReader to inherit from
- STACReader raises
InvalidAssetNamefor invalid asset name orMissingAssetswhen no assets is passed (#208) - update rio_tiler.mosaic.reader.mosaic_reader to not use threadPool if threads <= 1 (#207)
Breaking Changes: * Reader.spatial_info is a property (#203) * assets is a keyword argument in STACReader stats/info/metadata
2.0b3 (2020-07-27)¶
- add
rio_tiler.mosaicsubmodule (ref: cogeotiff/rio-tiler-mosaic#16)
2.0b2 (2020-07-23)¶
- add boto3 in the dependency (#201)
2.0b1 (2020-07-22)¶
- switch to ContextManager for COG and STAC (rio_cogeo.io.COGReader, rio_cogeo.io.STACReader).
- COGReader.part and STACReader.part return data in BBOX CRS by default.
- STACReader now accept URL (https, s3).
- add more method for STAC (prewiew/point/part/info/stats).
- add expression for COG/STAC preview/point/part.
- add
maskedoption inrio_tiler.reader.pointto control weither or not it should return None or a value. - remove mission specific tilers (#195).
- remove
rio_tiler.reader.multi_*functions (replaced by rio_tiler.io.cogeo.multi_*). - remove
rio_tiler.utils.expression(replaced by expression options in tilers).
2.0a11 (2020-05-29)¶
- refactor
rio_tiler.utils.tile_existsto allow raster bounds latitude == -90,90
2.0a10 (2020-05-29)¶
- Change default resampling to nearest for
_read(#187) - add
rio_tiler.reader.stats(return only array statistics) - remove default
dst_crsinrio_tiler.reader.partto to fallback to dataset CRS.
2.0a9 (2020-05-27)¶
- Refactor colormap and add method to register custom colormap
2.0a8 (2020-05-25)¶
- add
previewmethod torio_tiler.io.cogeo
2.0a7 (2020-05-17)¶
- allow reading high resolution part of a raster (by making height, width args optional)
- add
max_sizeoption inrio_tiler.reader.partto set a maximum output size when height and width are not set - add point and area function in rio_tiler.io.cogeo
- fix width-height height-widht bug in
rio_tiler.reader.part
depreciation
* deprecated out_window option in favor of window in rio_tiler.reader._read
2.0a6 (2020-05-06)¶
- fix unwanted breacking change with
img_profiles.getnot allowing default values
2.0a5 (2020-05-06)¶
- make
rio_tiler.io.landsat8.tilereturn Uint16 data and not float32 (#173) rio_tiler.profiles.img_profilesitem access returncopyof the items (#177)- better colormap docs (#176, author @kylebarron)
2.0a4 (2020-04-08)¶
- add
rio_tiler.io.cogeo.infoto retrieve simple file metadata (no image statistics) - add band metadata tag info in
rio_tiler.render.metadataoutput - add
rio_tiler.io.stacSTAC compliant rio_tiler.colormap.apply_discrete_cmap
2.0a3 (2020-03-25)¶
- only use
transform_boundswhen needed in rio_tiler.reader.part
Breaking Changes:
* switch back to gdal/rasterio calculate_default_transform (#164). Thanks to Terracotta core developper @dionhaefner.
* refactor rio_tiler.utils.get_vrt_transform to get width and height input.
2.0a2 (2020-03-20)¶
- Fall back to gdal/rasterio calculate_default_transform for dateline separation crossing dataset (ref #164)
2.0a1 (2020-03-19)¶
- added
reader.preview,reader.pointmethods - added multi_* functions to rio_tiler.reader to support multiple assets addresses
- added
rio_tiler.utils.has_mask_bandfunction - added
rio_tiler.utils.get_overview_levelto calculate the overview level needed for partial reading. - added type hints
- added scale, offsets, colormap, datatype and colorinterp in reader.metadata output (#158)
- new
rio_tiler.colormapsubmodule - added
unscaleoptions to rio_tiler.reader._read function apply internal scale/offset (#157)
Breaking Changes:
* removed python 2 support
* new package architecture (.io submodule)
* introduced new rio_tiler.reader functions (part, preview, metadata...)
* renamed rio_tiler.main to rio_tiler.io.cogeo
* bucket and prefixes are defined in rio_tiler.io.dataset.{dataset}_parse function from
AWS supported Public Dataset
* renamed minimum_tile_cover to minimum_overlap
* renamed tile_edge_padding to padding
* padding is set to 0 by default.
* use terracotta calculate_default_transform (see github.com/cogeotiff/rio-tiler/issues/56#issuecomment-442484999)
* colormaps are now have an alpha value
* rio_tiler.utils.get_colormap replaced by rio_tiler.colormap.get_colormap
* new rio_tiler.colormap.get_colormap supports only GDAL like colormap
* replaced rio_tiler.utils.array_to_image by rio_tiler.utils.render
* replaced rio_tiler.utils.apply_cmap by rio_tiler.colormap.apply_cmap
* replaced rio_tiler.utils._apply_discrete_colormap by rio_tiler.colormap.apply_discrete_cmap
* removed histogram_bins and histogram_range in options in metadata reader.
Should now be passed in hist_options (e.g: hist_options={bins=10, range=(0, 10)})
* remove alpha band value from output data array in tile/preview/metadata #127
1.4.0 (2020-02-19)¶
- Add Sentinel2-L2A support (#137)
- Update Sentinel-2 sceneid schema (S2A_tile_20170323_07SNC_0 -> S2A_L1C_20170323_07SNC_0)
1.3.1 (2019-11-06)¶
- Add
warp_vrt_optionoption forutils.raster_get_statsandutils.tile_readto allow more custom VRT Warping. (ref: github.com/OSGeo/gdal/issues/1989#issue-518526399) - Add
rio_tiler.utils.non_alpha_indexesto find non-alpha band indexes (ref #127)
1.3.0 (2019-10-07)¶
- Allow
DatasetReader,DatasetWriter,WarpedVRTinput forutils.raster_get_statsandutils.tile_read - add
minimum_tile_coveroption to filter dataset not covering a certain amount of the tile. - add Sentinel-1 submodule
Breaking Changes: * need rasterio>=1.1
1.2.11 (2019-09-18)¶
- reduce memory footprint of expression tiler
- fix wrong calculation for overview size in
raster_get_stats(#116) - Add Landsat 8 QA Band (#117).
1.2.10 (2019-07-18)¶
- add more colormap options (from matplotlib) and switch from txt files to numpy binaries (#115)
1.2.9 (2019-07-11)¶
- fix issue #113, adds depreciation warning for
bounds_crsin favor ofdst_crsinrio_tiler.utils.get_vrt_transform
1.2.8 (2019-07-08)¶
- Add kwargs options in landsat8.tile, sentinel2.tile and cbers.tile functions to
allow
resampling_methodandtile_edge_paddingoptions forwarding to utils._tile_read. - Add Input (bounds_crs) and Output (dst_crs) option to
utils._tile_readfunction (#108)
1.2.7 (2019-05-14)¶
- Revert changes introduced in #106 (see #105)
- Refactor tests
1.2.6 (2019-05-10) - DELETED¶
- Use same resampling method for mask and for data (#105)
1.2.5 (2019-05-08)¶
- add tile_edge_padding option to be passed to rio_tiler.utils._tile_read to reduce sharp edges that occur due to resampling (#104)
1.2.4 (2019-04-16)¶
- add histogram_range options to be passed to rio_tiler.{module}.metadata function (#102)
1.2.3 (2019-04-04)¶
- add histogram_bins options to be passed to rio_tiler.{module}.metadata function (#98)
Bug fixes: * return index number with band descriptions (#99)
1.2.2 (2019-04-03)¶
- add mercator min/max zoom info in metadata output from rio_tiler.utils.raster_get_stats (#96)
- add band description (band name) in metadata output from rio_tiler.utils.raster_get_stats (#96)
1.2.1 (2019-03-26)¶
- Replace rio-pansharpen dependency with a fork of the brovey function directly
into
rio_tiler.utils(rio-pansharpen is unmaintened and not compatible with rasterio>=1) (#94).
1.2.0 (2019-03-26)¶
rio_tiler.utils.array_to_image's color_map arg can be a dictionary of discrete values (#91)
Breaking Changes:
* expr argument is now a required option in rio_tiler.utils.expression. (#88)
1.1.4 (2019-03-11)¶
- Add 'rplumbo' colormap (#90 by @DanSchoppe)
1.1.3 (2019-03-06)¶
Bug fixes: * Fix casting to integer for MAX_THREADS environment variable.
1.1.1 (2019-02-21)¶
- Minor typo correction and harmonization of the use of src/src_dst/src_path in
rio_tiler.utils
Bug fixes:
* Fix nodata handling in utils.raster_get_stats
1.1.0 (2019-02-15)¶
- Allow options forwarding to
tile_readfrommain.tilefunction (#86) - Add
resampling_methodoptions inrio_tiler.utils.tile_readto allow user set resampling. Default is now bilinear (#85)
Bug fixes: * Fix nodata option forwarding to tile_read when source is a path (#83)
Refactoring:
* Refactor rio_tiler.utils.tile_read to reduce code complexity (#84)
Breaking Changes:
* indexes options is now set to None in rio_tiler.utils.tile_read.
Default will now be the dataset indexes.
1.0.1 (2019-02-14)¶
- Fix mask datatype bug in
rio_tiler.utils.array_to_image(#79) - Fix nodata handling and better test for the nodata/mask main module (#81)
1.0.0 (2019-02-11)¶
- add missing Landsat panchromatic band (08) min/max fetch in
rio_tiler.landsat8.metadata(#58) - add pre-commit for commit validation (#64)
- code formatting using Black (the uncompromising Python code formatter) (#64)
- update documentation (Sentinel-2 cost) (#68)
- add
utils.raster_get_statsandutils._get_statsto replacemin_max*function and to return more statistics (#66) - add overview level selection to statistical functions to reduce the data download (#59)
- add pure GDAL
array_to_imagefunction to replace PIL tools (#29) - add GDAL format output from
utils.get_colormapto be used inarray_to_image(#29) - add GDAL compatible Image creation profile (#29)
- add max threads number settings via "MAX_THREADS" environment variable (#71)
Breaking Changes:
* update metadata structure returned by landsat8.metadata, sentinel2.metadata, cbers.metadata
* force sentinel, landsat and cbers band names to be string and add validation (#65)
* moved landsat utility functions from rio_tiler.utils to rio_tiler.landsat8
* rio_tiler.utils.landsat_get_mtl -> rio_tiler.landsat8._landsat_get_mtl
* rio_tiler.utils.landsat_parse_scene_id -> rio_tiler.landsat8._landsat_parse_scene_id
* rio_tiler.utils.landsat_get_stats -> rio_tiler.landsat8._landsat_stats
* moved cbers utility functions from rio_tiler.utils to rio_tiler.cbers
* rio_tiler.utils.cbers_parse_scene_id -> rio_tiler.cbers._cbers_parse_scene_id
* moved sentinel-2 utility functions from rio_tiler.utils to rio_tiler.sentinel2
* rio_tiler.utils.sentinel_parse_scene_id -> rio_tiler.sentinel2._sentinel_parse_scene_id
* removed deprecated PIL support as well as base64 encoding function in rio_tiler.utils
* rio_tiler.utils.img_to_buffer
* rio_tiler.utils.array_to_img
* rio_tiler.utils.b64_encode_img
* removed deprecated min_max* functions (landsat_min_max_worker and band_min_max_worker)
1.0rc2 (2018-08-22)¶
- add test case for pix4d nodata+alpha band data
1.0rc1 (2018-07-16)¶
- rasterio 1.0.0
1.0b3 (2018-07-02)¶
- add schwarzwald color palette
1.0b2 (2018-06-26)¶
- fix nodata (#48)
1.0b1 (2018-06-23)¶
- adapt to rasterio 1.0b4
- fix mask (internal/external) fetching 🙏
- fix boundless read with new rasterio 1.0b2
- fix custom nodata handling
- fix performances issue
Breaking Changes: * removed alpha band options to select a custom alpha band number
1.0a8 (2018-06-20)¶
- Fix rasterio version to 1.0b1 (#46 and #44)
1.0a7 (2018-05-14)¶
- Support for additional CBERS instruments (fredliporace)
1.0a6 (2018-03-29)¶
- Fixes sentinel-2 band 8A regex bug in
rio_tiler.utils.expression
1.0a5 (2018-03-26)¶
- adds DatasetReader input option for utils.tile_read (do not close the dataset on each read)
Breaking Changes:
* utils.tile_band_worker renamed to utils.tile_read
* main.tile rgb option renamed indexes
* sentinel2.tile, landsat8.tile, cbers.tile rgb option renamed bands
* main.tile default nodata mask is handled by rasterio
1.0a4 (2018-03-07)¶
- adds utils.b64_encode_img function to encode an image object into a base64 string
- add tiles profiles (jpeg, png, webp) based on github.com/mapnik/mapnik/wiki/Image-IO#default-output-details
Breaking Changes:
* Refactor rio_tiler.utils.array_to_img to return PIL image object
1.0a3 (2018-02-05)¶
- only using
read_masksfor mask creation when it's needed.
1.0a2 (2018-02-05)¶
- add "expression" utility function
- better nodata/mask/alpha band definition and support
Breaking Changes: * tile functions now return an associated mask (Landsat, Sentinel, CBERS, main) * remove nodata support in utils.image_to_array function * add mask support in utils.image_to_array function * utils.tile_band_worker will always return a (Band, Width, Height) array (e.g 1x256x256 or 3x256x256)
1.0a1 (2018-01-04)¶
- remove aws.py sub-module (replaced by main.py)
- no default bands value for main.py tiles.
1.0a.0 (2018-01-03)¶
- add colormap option in
utils.array_to_img - add TIR (brightness temps) support
- add CBERS support
- add global file support
- add elevation encoding for mapzen
- removing internal caching
- update to rasterio 1.0a12
Breaking Changes:
* remove data value rescaling in landsat8.tile and sentinel2.tile
* fix wrong lat/grid_square value in utils.sentinel_parse_scene_id
* rename utils.sentinel_min_max_worker to utils.band_min_max_worker
0.0.3 (2017-11-14)¶
- Fix Sentinel-2 bad AWS url
0.0.2 (2017-10-17)¶
- Fix python ⅔ compatibilities in rio_tiler.utils.landsat_get_mtl
0.0.1 (2017-10-05)¶
- Initial release. Requires Rasterio >= 1.0a10.