- Catch and expand error message when GDAL cannot encode data using specified image driver (#767)
- add official support for floating point values in ColorMap
- cast data to
uint8
datatype when applying linear colormap
-
Ensure compatibility between XarrayReader and other Readers by adding
**kwargs
on class methods (#762) -
add
STACReader.get_asset_list()
method to enable easier customization of the asset listing/validation (#762)
-
Add
preview()
andstatistics()
methods to XarrayReader (#755) -
Add output size (
max_size
|width
,height
) options for XarrayReader'spreview()
,part()
andfeature()
methods (#755) -
Add half X/Y resolution on bounds before checking the geographic bounds in XarrayReader (#755)
-
Check if the Y bounds are inverted and flip the image on the Y axis in XarrayReader (#756)
-
Add support for 2D arrays in XarrayReader (#755)
-
Cast Xarray
attrs
values in XarrayReader'sinfo()
response to avoid JSON encoding issues (#755) -
Refactor XarrayReader's
feature()
method to use thepart
method (#755) -
Allow
op
parameter forcreate_cutline
and_convert_to_raster_space
functions to better control rasterio'srowcol
behaviour (author @Martenz, #759)
- Add
CRS_to_urn
method and update internals forCRS_to_uri
(author @AndrewAnnex, #752)
-
Enable dynamic definition of Asset reader in
MultiBaseReader
(#711, #728) -
Adding
default_assets
for MultiBaseReader and STACReader (author @mccarthyryanc, #722) -
Adding
default_bands
for MultiBandReader (#722) -
Adding support for the STAC
Projection
extension to derive thebounds
,crs
,minzoom
andmaxzoom
properties breaking change -
Refactor internal function and base classes for the
minzoom/maxzoom
calculation breaking change -
Adding
transform
,height
andwidth
attributes (outside init) forSpatialMixin
class -
Moved
_dst_geom_in_tms_crs
from Reader toSpatialMixin
class breaking change -
Removed use of rasterio's
is_tiled
method -
Enable Alternate asset's HREF for STAC by using
RIO_TILER_STAC_ALTERNATE_KEY
environment variable -
Adding support for GDAL VRT Connection string for STAC Assets
-
Improve type hint definition
-
make
ImageData.rescale
andImageData.apply_color_formula
to returnself
-
add support for
.json
colormap files -
do no
lowercase
colormap name inColorMaps.get
method breaking changefrom rio_tiler.colormap import cmap # before assert cmap.get("Viridis") # now assert cmap.get("Viridis") >> InvalidColorMapName: Invalid colormap name: Viridis
-
removed
geographic_crs
attribute inSpatialMixin
class breaking change -
removed
geographic_bounds
property inSpatialMixin
class breaking change -
add
get_geographic_bounds(crs: CRS)
method inSpatialMixin
classfrom 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 bounds
with 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: str
property inInfo
model -
remove
minzoom
andmaxzoom
properties inInfo
model breaking change -
update
morecantile
dependency to allow6.x
version -
remove deprecated method and attributes
-
round
xarray dataset's bounds to avoid precision errors when checking for valid geographic bounding box -
fix
bounds
type information
-
Enable Alternate asset's HREF for STAC by using
RIO_TILER_STAC_ALTERNATE_KEY
environment variable [Backported from7.0
] -
Adding support for GDAL VRT Connection string for STAC Assets [Backported from
7.0
]
- raise
MissingCRS
orInvalidGeographicBounds
errors when Xarray datasets have wrong geographic metadata - better error message for
TileOutsideBounds
errors (author @abarciauskas-bgse, #712) - handle of inverted latitude in
reader.point
(author @georgespill, #716)
- fix/support
scale/offset
indexes selection (author @jddeal, #709)
-
fix type hint for
ImageData.band_names
(author @n8sty, #704) -
enable
per-band
scale/offset rescaling (co-author @jddeal, #707) -
replace
scale
andoffset
byscales
andoffsets
inrio_tiler.models.Info
model# 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]
- Revert #648 and refactor
get_vrt_transform
method to better handle over-zooming a dataset
- Better handle dataset with inverted origin
- make sure datatype is forwarded to the WarpedVRT
- Ignore STAC statistics object when they contain invalid type (author @emmanuelmathot, #695)
- add python 3.12 official support
- change code formatter to
ruff-format
- better handler
NaN
nodata values for masking (author @cerolinx, #691)
- make sure
scale
andoffset
are set inInfo
even whenoffset=0.
orscale=1.0
(#687)
- better account for coverage in statistics (#684)
- add
CountMethod
mosaic method (author @mccarthyryanc, #676)
-
deprecate
resampling_method
inrio_tiler.io.xarray.XarrayReader
method and addreproject_method
(to match therio_tiler.io.Reader
options)# 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")
- When overriding nodata, do not mix mask and only use the provided nodata value
-
do not use
warpedVRT
when overwriting the dataset nodata value -
add
align_bounds_with_dataset
option inrio_tiler.reader.part
to align input bounds with the dataset resolution
- remove default Endpoint URL in AWS S3 Client for STAC Reader
- fix AWS endpoint credential for STAC
fetch
function, using same defaults as GDAL vsis3 configuration
- apply
discrete
colormap when the provided colormap does not have 256 values
- Adjusting dataset latitude for WarpedVRT parameters calculation when EPSG:4326 dataset latitudes overflows EPSG:3857 min/max latitude (#660)
- validate
shape
inImageData.get_coverage_array
to avoid rasterio error when re-projecting the geometry
- avoid
indexes
collision inMultiBaseReader
-
fix issue with
WarpedVRT
when doing re-projection (ref: #648) -
move benchmark outside pytest suite
-
add GET/HEAD request tests using tilebench (outside pytest suite) (ref: #649)
- validate
shape
inImageData.get_coverage_array
to avoid rasterio error when re-projecting the geometry [Backported from 6.2.6] - avoid
indexes
collision inMultiBaseReader
[Backported from 6.2.5]
This release was made while we waited on a fix for #654
- in
STACReader
usehref
ifget_absolute_href()
returnsNone
- add list of assets in
InvalidAssetName
message inSTACReader
- allow GeoJSON
Feature
inImageData.get_coverage_array
method
-
allow area-weighted statistics by adding
coverage
option 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_array
method to create acoverage %
array -
add
cmocean
colormaps -
allow uppercase in
cmap.get
methodfrom rio_tiler.colormap import cmap # Before cm = cmap.get("greys") # Now cm = cmap.get("Greys")
- add
width
,height
andcount
properties inMosaicMethodBase
- make sure we mosaic ImageData/PointData with same number of bands
- resize
ImageData.array
to the first asset's width/height inmosaic_reader
- return a 1x1 image when bbox is smaller than a single pixel (author @JackDunnNZ, #637)
- Update
data_as_image
to return masked values (author @JackDunnNZ, #635)
- fix
key
access forInfo
andBandStatistics
models forextra
attributes - update deprecation notice to
7.0
- update
morecantile
requirement to>=5.0,<6.0
- delete
rio_tiler.models.NodataTypes
(replaced with Literal within theInfo
model)
- Filter useless
NotGeoreferencedWarning
warnings inReader.feature()
andImageData.from_bytes()
methods - Ensure that dataset is still open when reading tags (author @JackDunnNZ, #628)
- fix
ImageData.apply_color_formula()
method
- raise
InvalidExpression
when passing invalidasset
orband
in an expression
-
Fix potential issue when getting statistics for non-valid data
-
add
rio-tiler.mosaic.methods.PixelSelectionMethod
enums with all defaults methods -
Add
rio-tiler.utils._validate_shape_input
function to check geojson feature inputs -
Change cutline handling in the
rio-tiler.io.rasterio.Reader.feature
method. 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_mask
attribute, which are used inrio-tiler.mosaic.methods.base.MosaicMethodBase
to stop mosaic building as soon as all pixels in a feature are populated -
Fix missing
nodata/alpha/mask
forwarding for dataset with internal GCPS -
in
rio_tiler.io.XarrayReader
, addauto_expand
options to avoid returning 1D array (incompatible with rio-tiler) (author @abarciauskas-bgse, #608) -
handle internal and user provided
nodata
values inrio_tiler.io.XarrayReader
to create mask -
add
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,AWS_SESSION_TOKEN
,AWS_PROFILE
andAWS_REGION
environnement overrides forrio_tiler.io.stac.aws_get_object
function
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 (#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_array
method (because we now support MaskedArray directly) -
rio_tiler.expression.apply_expression
input/output type change tonumpy.ma.MaskedArray
-
rio-tiler
mosaic
methods returnnumpy.ma.MaskedArray
-
reader's
post_process
should be a Callable withnumpy.ma.MaskedArray
input/output -
add
reproject_method
option inrio_tiler.reader
's method to select theresampling
method 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
MosaicMethodBase
to use python's dataclass -
changed variable names in
MosaicMethodBase
(tile
->mosaic
) -
rio_tiler.mosaic.methods.defaults.LastBandHigh
renamedLastBandHighMethod
-
rio_tiler.mosaic.methods.defaults.LastBandLow
renamedLastBandLowMethod
-
move
aws_get_object
fromrio_tiler.utils
torio_tiler.io.stac
-
make
boto3
an optional dependency (python -m pip install rio-tiler["s3"]
) -
update
morecantile
dependency to>=4.0
-
add
metadata
in 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_masked
methods
- raise InvalidExpression when passing invalid asset or band in an expression (Backported from 5.0.1)
- fix issue with
rio_tiler.utils.get_array_statistics
when passing data with novalid
value
- in
rio_tiler.io.XarrayReader
, addauto_expand
options to avoid returning 1D array (incompatible with rio-tiler) (author @abarciauskas-bgse, #608)
- enable
boundless
geometry for cutline (author @yellowcap, #586)
- Automatically expand 2D numpy array to 3D when creating ImageData
- Fix dtype issue when working with Mosaics Methods. Mask should always been of type
Uint8
. - Fix
ImageData.from_array
method when working with Masked array
- add
from_array
andfrom_bytes
ImageData creation methods - add
statistics
method to ImageData
- add
apply_colormap
method to the ImageData class - fix potential datatype overflow when calculating the intersection of mask and alpha band when using Colormap
- Fix inverted col/row check when doing window read of a non WarpedVRT dataset
- add
rio_tiler.mosaic.mosaic_point_reader
function 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)
- fix invalid definition of
PointData.mask
when mask is not provided. Makes sure it's a one element array.
- raise
InvalidPointDataError
error when trying to create PointData from an empty list inPointData.create_from_list
- fix invalid coordinates slicing for
XArrayReader.point()
method (author @benjaminleighton, #559)
- add
asset_as_band
option inMultiBaseReader
tile, 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"]
- remove deprecated code
asset_expression
in MultiBaseReaderGCPCOGReader
- use of
file:header_size
extension inSTACReader
to setGDAL_INGESTED_BYTES_AT_OPEN
environment variable
breaking changes
- renamed
MultiBaseReader._get_asset_url
toMultiBaseReader._get_asset_info
and change the output to return a dictionary in form of{"url": ..., "env": ...}
- 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-color
bycolor-operations
module
-
add python 3.10 support
-
add
apply_expression
method inrio_tiler.models.ImageData
class -
update
rio-tiler.reader.read/part
to avoid using WarpedVRT when no reprojection or nodata override is needed -
add
rio_tiler.io.rasterio.ImageReader
to 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.XarrayReader
to work withxarray.DataArray
import 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:
xarray
andrioxarray
optional dependencies are needed for the reader
breaking changes
-
remove python 3.7 support
-
update rasterio requirement to
>=1.3
to allow python 3.10 support -
rename
rio_tiler.io.cogeo
torio_tiler.io.rasterio
-
rename
COGReader
toReader
. We addedrio_tiler.io.COGReader
alias torio_tiler.io.Reader
backwards 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
minzoom
andmaxzoom
attribute inrio_tiler.io.SpatialMixin
base class -
remove
minzoom
andmaxzoom
attribute inrio_tiler.io.Reader
(now defined as properties) -
use
b
prefix for band names inrio_tiler.models.ImageData
class (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_expression
in MultiBaseReader. Use of expression is now possible -
expression
for 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.preview
function and updatedrio_tiler.reader.read
to allow width/height/max_size options -
reordered keyword options in all
rio_tiler.reader
function for consistency -
removed
AlphaBandWarning
warning when automatically excluding alpha band from data -
remove
nodata
,unscale
,resampling_method
,vrt_options
andpost_process
options toReader
init 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()
- Hide
NotGeoreferencedWarning
warnings inutils.render
andutils.resize_array
- update
MultiBaseReader
andMultiBandReader
points
method to prepare for numpy changes.
- Deprecate
rio_tiler.io.GCPCOGReader
and 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.rescale
to rescale the array in place - add
ImageData.apply_color_formula
to apply color formula in place
- Fix cutline creation for MultiPolygon (author @Fernigithub, #493)
- Switch to
pyproject.toml
andflit
for packaging (#490) - Catch discrete colormap with negative values (#492)
- avoid calculating statistics for non-finite values (#489)
- forward
band names
to ImageData output inmosaic_reader
(#486)
- add support for setting the S3 endpoint url scheme via the
AWS_HTTPS
environment variables inaws_get_object
function using boto3 (#476) - Add semicolon
;
support for multi-blocks expression (#479) - add
rio_tiler.expression.get_expression_blocks
method to split expression (#479) - add
merged_statistics
method forMultiBaseReader
to get statistics using between assets expression (#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.
- make sure we raise an HTTP exception when using an invalid STAC url (#475)
- switch from
functools.lru_cache
tocachetools.LRUCache
to allow unashable options inrio_tiler.io.stac.fetch
function (#471)
- avoid useless call to
transform_bounds
if input/output CRS are equals (#466) - make sure
geographic_bounds
don't return inf or nan values (#467)
- no change since
3.0.0a6
- add
rio_tiler.utils.resize_array
to resize array to a given width/height (#463) - use
resize_array
inImageData.create_from_list
to avoid trying merging array of different sizes (#463)
breaking changes
- update
MultiBaseReader
andMultiBandReader
to be their own abstract classes instead of being subclass ofBaseReader
. - put
reader
attribute outside of the__init__
method forMultiBaseReader
andMultiBandReader
.
- allow the definition of
geographic_crs
used in thegeographic_bounds
property (#458) - use
contextlib.ExitStack
to better manager opening/closing rasterio dataset (#459) - moves
BBox, ColorTuple, Indexes, NoData, NumType
type definitions inrio_tiler.types
(#460) - better types definition for ColorMap objects (#460)
- fix some types issues (#460)
- refactor
SpatialMixin.tile_exists
to 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) (#455)
- Reader's
info
andstatistics
methods to default to availablebands
orassets
if not provided (#451)
- Allow
rio_tiler.utils.get_array_statistics
to return0
for unfound category, instead of raising an error (#443)
breaking changes
-
add
input
in BaseReader class definition to avoid type mismatch (#450)Note:
input
replacesfilepath
attribute in STACReader and COGReader.
removed
-
rio_tiler.models.ImageStatistics
model
- add
crs
property inrio_tiler.io.base.SpatialMixin
(#429) - add
geographic_bounds
inrio_tiler.io.base.SpatialMixin
to return bounds in WGS84 (#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
zooms
for 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 (#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_exists
method to allow dataset and TMS not compatible with WGS84 crs (#429) - use
httpx
package instead of requests (author @rodrigoalmeida94, #431) - allow half pixel
tile_buffer
around the tile (e.g 0.5 -> 257x257, 1.5 -> 259x259) (author @bstadlbauer, #405) - add support for intervals colormap (#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 (#418)
- remove python 3.6 support (#418)
- remove
max_size
defaults forCOGReader.part
andCOGReader.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
.statistics
method in base classes (#427) -
remove
rio_tiler.io.base.SpatialMixin.spatial_info
andrio_tiler.io.base.SpatialMixin.center
properties (#429) -
Reader's
.bounds
property should now be in dataset's CRS, not inWGS84
(#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_THREADS
environment variable instead ofMAX_THREADS
(author @rodrigoalmeida94, #432) - remove
band_expression
inrio_tiler.io.base.MultiBandReader
(https://github.com/cogeotiff/rio-tiler/pull/433) - change
asset_expression
input type fromstr
toDict[str, str]
inrio_tiler.io.base.MultiBaseReader
(#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_indexes
inrio_tiler.io.base.MultiBaseReader
, which replacesindexes
. (#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.metadata
andrio_tiler.io.BaseReader.stats
base class methods (#425)rio_tiler.reader.stats
function (#440)rio_tiler.reader.metadata
function (#440)rio_tiler.utils._stats
function (#440)
- Make sure output data is of type
Uint8
when applying a colormap (#423) - Do not auto-rescale data if there is a colormap (#423)
- update type information for mosaics functions (#409)
-
add support for setting the S3 endpoint url via the
AWS_S3_ENDPOINT
environment variables inaws_get_object
function using boto3 (#394) -
make
ImageStatistics.valid_percent
a value between 0 and 100 (instead of 0 and 1) (author @param-thakker, #400) -
add
fetch_options
toSTACReader
to allow custom configuration to the fetch client (#404)with STACReader("s3://...", fetch_options={"request_pays": True}): pass
-
Fix alpha band values when storing
Uint16
data in PNG. (#407)
- add auto-rescaling in
ImageData.render
method to avoid error when datatype is not supported by the output driver (#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_range
option inImageData.render
toSequence[Tuple[NumType, NumType]]
(#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)))
- add warning when dataset doesn't have overviews (#386)
- add
width
,height
,count
andoverviews
infos inCOGReader.info()
(#387) - add
driver
inCOGReader.info()
output (#388) - add
valid_percent
instats
output (#389)
- use importlib.resources
.files
method to resolve the package directory (#379)
- add
read()
method in COGReader (#366) - add
tile_buffer
option toCOGReader.tile()
method to add pixels around a tile request (#365) - use
importlib.resources.path
to find rio-tilercmap_data
directory (#370) - re-use type definitions (#337)
from rio_tiler.profiles import img_profiles
jpeg = img_profiles.get("jpeg")
jpg = img_profiles.get("jpg")
assert jpeg == jpg
- Added pystac.MediaType.COG in supported types by STAC reader
- fix bad type definition in
rio_tiler.colormap.ColorMaps
data (#359) - add
rio_tiler.colormap.parse_color
function to parse HEX color (#361)
- Reduce the number of
.read()
calls for dataset without nodata value (#355) - replace deprecated
numpy.float
bynumpy.float64
- fix bad mask datatype returned by mosaic methods (#353)
- align WarpedVRT with internal blocks when needed. This is to reduce the number of GET requests need for VSI files (#345)
- fix arguments names conflicts between mosaic_reader/tasks and STACReader options (#343)
- update rio-tiler pypi description.
- add MultiPolygon support in
rio_tiler.utils.create_cutline
(#323) - support discrete colormap by default in
apply_cmap
(#321) - delete deprecated
rio_tiler.mercator
submodule - added default factory in
rio_tiler.colormap.ColorMaps
. - fix missing
metadata
forwarding inImageData.post_process
method. - refactor
rio_tiler.io.GCPCOGReader
for better inheritance from COGReader.
breaking change
- renamed input parameter
tile
todata
inrio_tiler.utils.render
. - renamed input parameter
arr
todata
inrio_tiler.utils.mapzen_elevation_rgb
- made
rio_tiler.io.stac.to_pystac_item
private (renamed to_to_pystac_item
) - renamed
rio_tiler.colormap.DEFAULTS_CMAPS
torio_tiler.colormap.DEFAULT_CMAPS_FILES
- made
rio_tiler.reader._read
public (renamed to rio_tiler.reader.read) (ref: #332)
- add
NPZ
output format (#308) - add pystac for STAC item reader (author @emmanuelmathot, #212)
- delete deprecated function:
rio_tiler.reader.tile
,rio_tiler.utils.tile_exits
andrio_tiler.utils.geotiff_options
- deprecated
rio_tiler.mercator
submodule (#315) - update morecantile version to 2.1, which has better
tms.zoom_for_res
definition.
- add
feature
method to reader classes (#306)
- add
data
validation inrio_tiler.models.ImageData
model. Data MUST be a 3 dimensions array in form of (count, height, width). mask
is now optional forrio_tiler.models.ImageData
model, 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
metadata
property torio_tiler.models.ImageData
model
img.metadata
>>> {}
breaking change
rio_tiler.mosaic.reader.mosaic_reader
now raisesEmptyMosaicError
instead of returning an emptyImageData
- Remove
Uint8
data casting before applyingcolor_formula
in ImageData.render (#302)
- added
ImageData
output class for allrio_tiler.io
classes 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_descriptions
and 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._stats
function to replacepc
bypercentiles
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.ColorMap
object immutable. Registering a new colormap will new returns a now instance of ColorMap(#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
.npy
file in a directory, ifCOLORMAP_DIRECTORY
environment variable is set with the name of the directory. -
Update to morecantile 2.0.0
- surface
allowed_exceptions
options inrio_tiler.mosaic.reader.mosaic_reader
(#293) - add SpatialInfoMixin base class to reduce code duplication (co-author with @geospatial-jeff, #295)
- add
AsyncBaseReader
to support async readers (author @geospatial-jeff, #265)
- surface dataset.nodata in COGReader.nodata property (#292)
- fix non-threaded tasks scheduler/filter (#291)
- switch to morecantile for TMS definition (ref: #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
LastBandHigh
andLastBandLow
pixel selection (ref: #270)
Deprecated function
- rio_tiler.reader.tile
- rio_tiler.utils.geotiff_options
- rio_tiler.utils.tile_exists
- rio_tiler.io.multi_*
- 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}
- Fix missing Exception catching when running task outside threads (ref: developmentseed/titiler#130).
- add rio-tiler logger (#277).
- Fix bug in
MultiBandReader
(ref: #275) and add tests.
- add
MultiBandReader
andGCPCOGReader
inrio_tiler.io
init.
- Added back the Conctext Manager methods in
rio_tiler.io.base.BaseReader
but not as@abc.abstractmethod
(ref: #273 (comment)) - Move
rio_tiler_pds.reader.MultiBandReader
andrio_tiler_pds.reader.GCPCOGReader
to rio-tiler (#273)
- remove ContextManager requirement for
rio_tiler.io.base.BaseReader
andrio_tiler.io.base.MultiBaseReader
base classes. - move ContextManager properties definition to
__attrs_post_init__
method inrio_tiler.io.STACReader
andrio_tiler.io.COGReader
(ref: cogeotiff/rio-tiler-pds#21)
- Make sure Alpha band isn't considered as an internal mask by
utils.has_mask_band
- reduce verbosity in
rio_tiler.tasks.filter_tasks
exception logging (#266).
- add
post_process
callback torio_tiler.render._read
andrio_tiler.render.point
to apply specific operation ouput arrays.
- 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
NPY
support inrio_tiler.utils.render
to save tile in numpy binary format (#256) - Remove bare
Exception
and add more detailed errors (#248)
- raise specific
PointOutsideBounds
in rio_tiler.reader.point (#236)
- allow setting default kwargs in COGReader init (#227)
- allow
vrt_options
in COGReader.point - add
rio_tiler.io.base.MultiBaseReader
class (#225) - refactor
rio_tiler.io.stac.STACReader
to use MultiBaseReader (#225) - add
rio_tiler.task
submodule 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)
- add
utils.create_cutline
helper (#218) - remove any mutable default argument
depreciation
warp_vrt_option
is replaced byvrt_options
in rio_tiler.reader.part (#221)
- 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)
- add rio_tiler.io.base.BaseReader abstract class for COGReader and STACReader to inherit from
- STACReader raises
InvalidAssetName
for invalid asset name orMissingAssets
when 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
- add
rio_tiler.mosaic
submodule (ref: cogeotiff/rio-tiler-mosaic#16)
- add boto3 in the dependency (#201)
- 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
masked
option inrio_tiler.reader.point
to 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).
- refactor
rio_tiler.utils.tile_exists
to allow raster bounds latitude == -90,90
- Change default resampling to nearest for
_read
(#187) - add
rio_tiler.reader.stats
(return only array statistics) - remove default
dst_crs
inrio_tiler.reader.part
to to fallback to dataset CRS.
- Refactor colormap and add method to register custom colormap
- add
preview
method torio_tiler.io.cogeo
- allow reading high resolution part of a raster (by making height, width args optional)
- add
max_size
option inrio_tiler.reader.part
to 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 ofwindow
in rio_tiler.reader._read
- fix unwanted breacking change with
img_profiles.get
not allowing default values
- make
rio_tiler.io.landsat8.tile
return Uint16 data and not float32 (#173) rio_tiler.profiles.img_profiles
item access returncopy
of the items (#177)- better colormap docs (#176, author @kylebarron)
- add
rio_tiler.io.cogeo.info
to retrieve simple file metadata (no image statistics) - add band metadata tag info in
rio_tiler.render.metadata
output - add
rio_tiler.io.stac
STAC compliant rio_tiler.colormap.apply_discrete_cmap
- only use
transform_bounds
when 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.
- Fall back to gdal/rasterio calculate_default_transform for dateline separation crossing dataset (ref #164)
- added
reader.preview
,reader.point
methods - added multi_* functions to rio_tiler.reader to support multiple assets addresses
- added
rio_tiler.utils.has_mask_band
function - added
rio_tiler.utils.get_overview_level
to 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.colormap
submodule - added
unscale
options 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
tominimum_overlap
- renamed
tile_edge_padding
topadding
- padding is set to 0 by default.
- use terracotta calculate_default_transform (see #56 (comment))
- colormaps are now have an alpha value
rio_tiler.utils.get_colormap
replaced byrio_tiler.colormap.get_colormap
- new
rio_tiler.colormap.get_colormap
supports only GDAL like colormap - replaced
rio_tiler.utils.array_to_image
byrio_tiler.utils.render
- replaced
rio_tiler.utils.apply_cmap
byrio_tiler.colormap.apply_cmap
- replaced
rio_tiler.utils._apply_discrete_colormap
byrio_tiler.colormap.apply_discrete_cmap
- removed
histogram_bins
andhistogram_range
in options in metadata reader. Should now be passed inhist_options
(e.g: hist_options={bins=10, range=(0, 10)}) - remove alpha band value from output data array in tile/preview/metadata #127
- Add Sentinel2-L2A support (#137)
- Update Sentinel-2 sceneid schema (S2A_tile_20170323_07SNC_0 -> S2A_L1C_20170323_07SNC_0)
- Add
warp_vrt_option
option forutils.raster_get_stats
andutils.tile_read
to allow more custom VRT Warping. (ref: OSGeo/gdal#1989 (comment)) - Add
rio_tiler.utils.non_alpha_indexes
to find non-alpha band indexes (ref #127)
- Allow
DatasetReader
,DatasetWriter
,WarpedVRT
input forutils.raster_get_stats
andutils.tile_read
- add
minimum_tile_cover
option to filter dataset not covering a certain amount of the tile. - add Sentinel-1 submodule
Breaking Changes:
- need rasterio>=1.1
- reduce memory footprint of expression tiler
- fix wrong calculation for overview size in
raster_get_stats
(#116) - Add Landsat 8 QA Band (#117).
- add more colormap options (from matplotlib) and switch from txt files to numpy binaries (#115)
- fix issue #113, adds depreciation warning for
bounds_crs
in favor ofdst_crs
inrio_tiler.utils.get_vrt_transform
- Add kwargs options in landsat8.tile, sentinel2.tile and cbers.tile functions to
allow
resampling_method
andtile_edge_padding
options forwarding to utils._tile_read. - Add Input (bounds_crs) and Output (dst_crs) option to
utils._tile_read
function (#108)
- Revert changes introduced in #106 (see #105)
- Refactor tests
- Use same resampling method for mask and for data (#105)
- add tile_edge_padding option to be passed to rio_tiler.utils._tile_read to reduce sharp edges that occur due to resampling (#104)
- add histogram_range options to be passed to rio_tiler.{module}.metadata function (#102)
- add histogram_bins options to be passed to rio_tiler.{module}.metadata function (#98)
Bug fixes:
- return index number with band descriptions (#99)
- 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)
- 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).
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 inrio_tiler.utils.expression
. (#88)
- Add 'rplumbo' colormap (#90 by @DanSchoppe)
Bug fixes:
- Fix casting to integer for MAX_THREADS environment variable.
- 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
- Allow options forwarding to
tile_read
frommain.tile
function (#86) - Add
resampling_method
options inrio_tiler.utils.tile_read
to 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 inrio_tiler.utils.tile_read
. Default will now be the dataset indexes.
- 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)
- 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_stats
andutils._get_stats
to 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_image
function to replace PIL tools (#29) - add GDAL format output from
utils.get_colormap
to 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 bylandsat8.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
torio_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
torio_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
torio_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)
- add test case for pix4d nodata+alpha band data
- rasterio 1.0.0
- add schwarzwald color palette
- fix nodata (#48)
- 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
- Fix rasterio version to 1.0b1 (#46 and #44)
- Support for additional CBERS instruments (fredliporace)
- Fixes sentinel-2 band 8A regex bug in
rio_tiler.utils.expression
- adds DatasetReader input option for utils.tile_read (do not close the dataset on each read)
Breaking Changes:
utils.tile_band_worker
renamed toutils.tile_read
main.tile
rgb option renamed indexessentinel2.tile
,landsat8.tile
,cbers.tile
rgb option renamed bandsmain.tile
default nodata mask is handled by rasterio
- adds utils.b64_encode_img function to encode an image object into a base64 string
- add tiles profiles (jpeg, png, webp) based on https://github.com/mapnik/mapnik/wiki/Image-IO#default-output-details
Breaking Changes:
- Refactor
rio_tiler.utils.array_to_img
to return PIL image object
- only using
read_masks
for mask creation when it's needed.
- 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)
- remove aws.py sub-module (replaced by main.py)
- no default bands value for main.py tiles.
- 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
andsentinel2.tile
- fix wrong lat/grid_square value in
utils.sentinel_parse_scene_id
- rename
utils.sentinel_min_max_worker
toutils.band_min_max_worker
- Fix Sentinel-2 bad AWS url
- Fix python 2/3 compatibilities in rio_tiler.utils.landsat_get_mtl
- Initial release. Requires Rasterio >= 1.0a10.