- fix(algorithm): handle mask type compatibility in contours algorithm by @machov in #1327
- add openapi parameters for tile dependencies in WMTS endpoints by @vincentsarago in #1349
- change: internal of the WMTS extension to increase performance
- add openapi parameters for tile dependencies in WMTS endpoints by @vincentsarago in #1349
- change: internal of the WMTS extension to increase performance
- Fix command syntax in AWS Lambda deployment guide by @hamishcampbell in #1346
- ci: harden github actions workflows against zizmor findings by @lhoupert in #1354
- ci: setup trusted publishing and update xarray upstream test by @vincentsarago in #1355
- ci: add conventional commit check and release please by @lhoupert in #1356
- ci: add security audtit and ossf scorecard by @lhoupert in #1359
Full Changelog: https://github.com/developmentseed/titiler/compare/2.0.0...2.0.1
- change: rio-tiler requirement to
>=9.0,<10.0
- fix: allow
:characters in xarray reader'sselparameter (e.g. for timestamps) (#1336)
- fix:
pixel-selectionmethod initialization to avoid FastAPI caching (author @raster-blaster, #1334) - fix: make the point query feature in map.html work for MosaicTilerFactory (#1338)
- fix: render expression adapter
- change: rio-tiler requirement to
>=9.0.0b1,<10.0 - add: asset's options parsing in
AssetsParamsdependency
- render:
- change: make
assetsoptional inRenderItemmodel - change: add
valid: True|Falsekey to theRenderItemWithLinksmodel - add: convert old
asset_bixandasset_expressionkeys to{asset}|indexes=...&expression=...
- change: make
- fix: tilesize for
/map.htmlendpoint
- remove: 256x256 tilesize default
- remove:
MultiBandTilerFactoryfactory - remove:
@{scale}xsuffix for tile endpoints - remove:
tile_scaleoption in/tilejson.jsonand/map.htmlendpoints - change: default to TileMatrix's
tileHeight x tileWidthfor tile endpoints - change: set
tilesize=512for/tilejson.jsonendpoints - change: set
tilesize=256for/map.htmlendpoints - change: use
band_descriptionsinstead ofband_names - add:
tilesizeoptional query-parameter for tile and tilejson endpoints - remove: titiler-xarray in docker-compose file
- remove: titiler-xarray single application deployement in AWS lambda deployement
- change: rio-tiler requirement to
>=9.0.0a4,<10.0
- change:
bidxoption is now ignored byMultiBaseFactoryendpoints - change:
assetsoption is now required forMultiBaseFactoryendpoints - change: users can use
assets=:all:inMultiBaseFactory's/infoand/statisticsendpoints - change:
expressioncannot be used to declareassetsinMultiBaseFactoryendpoints. Useassets=Red&assets=Green&expression=b1/b2. - remove:
asset_indexesandasset_expressionoptions independencies.py - rename:
dependencies.AssetsBidxExprParamstodependencies.AssetsExprParams - remove: methods or classes:
titiler.core.dependencies.AssetsBidxParamstitiler.core.dependencies.AssetsBidxExprParamsOptionaltitiler.core.dependencies.BandsParamstitiler.core.dependencies.BandsExprParamsOptionaltitiler.core.dependencies.BandsExprParamstitiler.core.dependencies.parse_asset_indexes()titiler.core.dependencies.parse_asset_expression()titiler.core.routing.apiroute_factory()
- change: force
tilesize=256incogandstacviewers - remove:
tile_scaleoption in/WMTSCapabilities.xmlendpoints
- remove:
tile_scaleoption in/WMTSCapabilities.xmlendpoints
- add: titiler.xarray dependency
- add:
/zarrendpoints
- fix: allow
:characters in xarray reader'sselparameter (e.g. for timestamps) (#1336) [Backported from 2.0.0]
- fix:
pixel-selectionmethod initialization to avoid FastAPI caching (author @raster-blaster, #1334) [Backported from 2.0.0]
- fix: address several instances of validation failures returning 500 instead of 4xx HTTP responses
- add: support for
float16,int64anduint64datatype in viewers - fix: make sure TMS have ids in WMTS XML documents
- fix: make sure TMS have ids in WMTS XML documents
- fix: add
h5pyin optional dependency
- add
get_rendersattribute towmtsExtensionextensions - refactor WMTS endpoints to enable renders metadata (e.g STAC renders)
- update
wmts.xmltemplate breaking change
- Improve
demalgorithms by using numpy functions (author @manand881, #1294)
- add more TMS utilities
- remove
bump-my-versionfrom dev dependencies
- add
utils.tms_limitsoptions to avoid code duplication
- update rio-tiler requirement to
>=8.0,<9.0 - return
UINT8datatype JPEG/PNG when no output format is specified breaking change - remove
/{tileMatrixSetId}/WMTSCapabilities.xmlendpoints from factories breaking change - add python 3.14 support
- add
linux/arm64docker image - update/fix type hints
- add arm64 docker image
- add titiler-xarray docker image in ghcr.io
- add
band_descriptionattribute toPointoutput model (returned by /point endpoints) breaking change
- update rio-cogeo requirement to
7.0,<8.0 - add
wmtsExtensionwhich adds/WMTSCapabilities.xmlto factories WMTSCapabilities.xmlresponse now support all TileMatrixSets as separate layers breaking change
-
change Response model for
/pointendpoint breaking change# before class Point(BaseModel): coordinates: List[float] values: List[Tuple[str, List[Optional[float]], List[str]]] # now class AssetPoint(BaseModel): name: str values: list[float | None] band_names: list[str] band_descriptions: list[str] | None = None class Point(BaseModel): coordinates: list[float] assets: list[AssetPoint]
-
add
/feature,/bboxand/statisticsoptional endpoints -
make
cogeo-mosaican optional dependency breaking change -
remove default for
MosaicTilerFactory.backendattribute breaking change -
add
titiler.mosaic.extensions.mosaicjson.MosaicJSONExtensionwhich adds MosaicJSON specific/and/validateendpoints -
add
titiler.mosaic.extension.wmts.wmtsExtensionwhich adds/WMTSCapabilities.xmlendpoint -
add optional OGC Maps API
/mapendpoint
-
use
sel={dim}={method}::{value}notation to specify selector method instead ofsel-methodquery-parameter breaking change# before .../info?tore.zarr?sel=time=2023-01-01&sel_method=nearest` # now .../info?tore.zarr?sel=time=nearest::2023-01-01`
-
add
/validateendpoint viaValidateExtensionextension -
add
LatitudeandLongitudeas compatible spatial dimensions (@abarciauskas-bgse, #1268)
- remove usage of
mosaic_def.centerand calculate from bounds
- remove
/boundsendpoints breaking change - update docker image to python:3.13
- switch to
uvfor development - switch to
hatchfor python package build-system - remove
titilermetapackage breaking change - bump minimum python version to 3.11
- add
opener_optionsarg totitiler.xarray.io.Readerto allow users to pass args through to a custom opener function ([#1248(#1248)]) - add
obstoreandzarr-pythonas dependency and addopen_zarrdataset opener - default to
titiler.xarray.io.open_zarrfortitiler.xarray.io.Reader.dataset_openerattribute - rename
titiler.xarray.io.xarray_open_datasettofs_open_dataset - add
FsReaderwhich usefs_open_datasetasdataset_opener - create offical application
titiler.xarray.main:app
- move
/and/validateto aMosaicJSONExtension
- update
TileJSONspec from 2.2.0 to 3.0.0 - fix OpenAPI spec for
histogram_rangeexamples (@guillemc23, #1239)
- add
grayscaleandbitonalalgorithms - add
transformandcrsfortiffoutputs
- add attribution in
/tilejson.jsonresponse. Controled withTITILER_DEFAULT_ATTRIBUTIONenvironment variable. - enable
jinja2.autoescapefor HTML/XML templates (ref: https://jinja.palletsprojects.com/en/stable/api/#autoescaping) - remove python 3.9 support
- update rio-stac requirement
- add
descriptioninApiSettings
- delete
titiler.core.templatingsubmodule breaking change - move
create_html_responsefunction totitiler.core.utilssubmodule - move all HTML templates in
titiler/core/templatesdirectory breaking change - add HTML responses for tilesets, tilematrixsets, algorithms and colormaps endpoints
- rename response model
ColorMapsList->ColorMapListand change it's attibutes tocolormapsbreaking change - add
templatesin theBaseFactoryclass definition
- add
sumalgorithm
- add OpenTelemetry instrumentation to the tiler factory classes
- add
OGC Maps APIsupport (/mapendpoint)
- add OpenTelemetry tracing to the FastAPI application
- update
starlette-cramjamrequirement to>=0.4,<0.6
- add
add_previewin factory attribute (default toFalse)
- Add otel-collector and jaeger to the docker network
- fix layer's bounds for non-wgs84 CRS in WMTS document
- switch from bitnami to official python:3.12 docker image
- fix
relvalues for tiling scheme link (OGC Tiles specification)
- use dimension's
dtypeto cast user selection
- remove unused templates
- fix
xarray_open_datasetfor cloud hosted files
- update
readerandpath_dependencytype informations
- rename
/mapendpoint to/map.htmlbreaking change - add
nameattribute toBaseFactoryto define endpoint'soperationId - add
operationIdon all endpoints - add
/preview/{width}x{height}.{format}endpoints - update rio-tiler requirement to
>=7.7,<8.0 - allow users to pass only one of
widthorheighsize parameters forpreview,partandfeaturerequests - use
minZoominstead ofminNativeZoomin the/map.htmlhtml template - update geojson-pydantic requirement to
>=1.1.2,<3.0and change featureCollection iteration
- fix Landing page links when app is behind proxy
- use
titiler.coretemplates for Landing page - enable JSON and HTML rendering of the
/landing page - add OGC Common
/conformanceendpoint
-
add
conforms_toattribute toBaseFactoryto indicate which conformance the TileFactory implement -
remove deprecated
ColorFormulaParamsandRescalingParamsdependencies breaking change -
remove deprecated
DefaultDependencydict-unpacking feature breaking change -
add
min,max,mean,median,stdandvaralgorithms -
Fix TerrainRGB algorithm and param user-controlled nodata-height (@jo-chemla, #1116)
-
add
output_minandoutput_maxmetadata attributes toslopealgorithm (@tayden, #1089) -
add point value query on right-click to map viewer (@hrodmn, #1100)
-
refactor middlewares to use python's dataclasses
-
update
LoggerMiddlewareoutput format and options breaking changefrom fastapi import FastAPI from titiler.core.middlewares import LoggerMiddleware # before app = FastAPI() app.add_middlewares(LoggerMiddleware, querystrings=True, headers=True) # now app = FastAPI() app.add_middlewares( LoggerMiddleware, # custom Logger logger=logging.getLogger("mytiler.requests"), # default to logging.getLogger("titiler.requests") )
Note: logger needs then to be
configuredat runtime. e.g :from logging import config config.dictConfig( { "version": 1, "disable_existing_loggers": False, "formatters": { "detailed": { "format": "%(asctime)s - %(levelname)s - %(name)s - %(message)s" }, "request": { "format": ( "%(asctime)s - %(levelname)s - %(name)s - %(message)s " + json.dumps( { k: f"%({k})s" for k in [ "method", "referer", "origin", "route", "path", "path_params", "query_params", "headers", ] } ) ), }, }, "handlers": { "console_request": { "class": "logging.StreamHandler", "level": "DEBUG", "formatter": "request", "stream": "ext://sys.stdout", }, }, "loggers": { "mytiler.requests": { "level": "INFO", "handlers": ["console_request"], "propagate": False, }, }, } )
- update
wmsextension to remove usage ofColorFormulaParamsandRescalingParamsdependencies - update
renderextension to better validate query-parameters from render expression
-
update
rio-tilerrequirement to>=7.6.1 -
add
selandsel_methodoptions to select dimension# before https://.../0/0/0.png?url=dataset.zarr&drop_dim=time=2023-01-01 # now https://.../0/0/0.png?url=dataset.zarr&sel=time=2023-01-01 # method https://.../0/0/0.png?url=dataset.zarr&sel=time=2023-01-02&sel_method=nearest # Can use `slice` when providing 2 values https://.../0/0/0.png?url=dataset.zarr&sel=time=2023-01-01&time=2023-01-31 -
add support for
bidxparameter -
remove
firsttime dim selection breaking change -
add support for 3D dataset
-
remove
drop_dimoption breaking change -
remove
datetimeoption breaking change -
deprecate
VariablesExtensionextension -
add
DatasetMetadataExtensionextension (/dataset/keys,/dataset/and/dataset/dictendpoints)
- add
/bboxprefix to/{minx},{miny},{maxx},{maxy}/assetsendpoint ->/bbox/{minx},{miny},{maxx},{maxy}/assetsbreaking change - add
/pointprefix to{lon},{lat}/assetsendpoint ->/point/{lon},{lat}/assetsbreaking change - add
/tilesprefix to/{tileMatrixSetId}/{z}/{x}/{y}/assetsendpoint ->/tiles/{tileMatrixSetId}/{z}/{x}/{y}/assetsbreaking change - add
assets_accessor_dependencydependency to the MosaicTileFactory to pass options to the backend'sget_assetsmethod.
- add
slopealgorithm (@tayden, #1088)
- Support Zarr-Python >=3 (author @maxrjones, #1082)
-
use
URNstyle CRS notation in WMTS document -
Unify Docker images (deprecate
titiler-uvicorn)# Uvicorn # before docker run \ --platform=linux/amd64 \ -p 8000:8000 \ --env PORT=8000 \ --rm -it ghcr.io/developmentseed/titiler-uvicorn:latest # now docker run \ --platform=linux/amd64 \ -p 8000:8000 \ --rm -it ghcr.io/developmentseed/titiler:latest \ uvicorn titiler.application.main:app --host 0.0.0.0 --port 8000 --workers 1 # Gunicorn # before docker run \ --platform=linux/amd64 \ -p 8000:8000 \ --env PORT=8000 \ --rm -it ghcr.io/developmentseed/titiler:latest # now docker run \ --platform=linux/amd64 \ -p 8000:8000 \ --rm -it ghcr.io/developmentseed/titiler:latest \ gunicorn -k uvicorn.workers.UvicornWorker titiler.application.main:app --bind 0.0.0.0:8000 --workers 1
- pin python
zarrto>2,<3.0to avoid zarr 3.0 breaking changes
- add layer control to map viewer template (author @hrodmn, #1051)
- improve query string handling in LowerCaseQueryStringMiddleware using urlencode (author @pratapvardhan, #1050)
- add
titiler.core.utils.bounds_to_geometryand reduce code duplication in factories (author @PratapVardhan, #1047) - simplify image format dtype validation in
render_image(author @PratapVardhan, #1046) - remove
rescale_dependencyandcolor_formula_dependencyattributes inTilerFactoryclass breaking change - move
rescaleandcolor_formulaQueryParameters dependencies inImageRenderingParamsclass breaking change - handle image rescaling and color_formula within
titiler.core.utils.render_imagefunction breaking change - add
render_func: Callable[..., Tuple[bytes, str]] = render_imageattribute inTilerFactoryclass - add
castToInt,Floor,Ceilalgorithms
- update
/healthzendpoint to return dependencies versions (titiler, rasterio, gdal, ...) (author @scottyhq, #1056) - migrate
templates/index.htmlto bootstrap5, remove unused css, reuse bs classes (author @PratapVardhan, #1048)
- remove
rescale_dependencyandcolor_formula_dependencyattributes inMosaicTilerFactoryclass breaking change - add
render_func: Callable[..., Tuple[bytes, str]] = render_imageattribute inMosaicTilerFactoryclass breaking change
- use
factory.render_funcas render function inwmsExtensionendpoints - add
stacRenderExtensionwhich adds two endpoints:/renders(lists all renders) and/renders/<render_id>(render metadata and links) (author @alekzvik, #1038)
- Updated WMTS Capabilities template to avoid inserting extra new lines (author @AndrewAnnex, #1052).
- Updated WMTS endpoint in titiler.mosaic and titiler.core to return layer bounds in coordinate ordering matching CRS order if WGS84 is not used (author @AndrewAnnex, #1052).
- Remove
python3.8support (author @pratapvardhan, #1058) - Add
python3.13support (author @pratapvardhan, #1058)
- pin python zarr to >2,<3.0 to avoid zarr 3.0 breaking changes [Backported from 0.20.1]
-
drop python 3.8 and add python 3.13 support (author @pratapvardhan, #1058)
-
Update package build backend from
pdm-pep517topdm-backend(https://backend.pdm-project.org/#migrate-from-pdm-pep517) -
Update namespace package from using
.to-as separator to comply with PEP-625 (https://peps.python.org/pep-0625/)
- Define variable (
MOSAIC_CONCURRENCYandMOSAIC_STRICT_ZOOM) from env-variable outside endpoint code
- Add
titilerlinks in Map attributions
-
Remove default
WebMercatorQuadtile matrix set in/tiles,/tilesjson.json,/mapand/WMTSCapabilities.xmlendpoints breaking change# Before /tiles/{z}/{x}/{y} /tilejson.json /map /WMTSCapabilities.xml # Now /tiles/WebMercatorQuad/{z}/{x}/{y} /WebMercatorQuad/tilejson.json /WebMercatorQuad/map /WebMercatorQuad/WMTSCapabilities.xml -
Use
@attrs.defineinstead of dataclass for factories breaking change -
Use
@attrs.defineinstead of dataclass for factory extensions breaking change -
Handle
numpytypes in JSON/GeoJSON response -
In the
map.htmltemplate, use the tilejson'sminzoomandmaxzoomto populateminNativeZoomandmaxNativeZoomparameters in leaflettileLayerinstead ofminZoomandmaxZoom
-
Update
rio-tilerdependency to>=7.0,<8.0 -
Update
geojson-pydanticdependency to>=1.1.2,<2.0which better handle antimeridian crossing dataset -
handle
antimeridiancrossing bounds in/info.geojsonendpoints (returning MultiPolygon instead of Polygon) -
Improve XSS security for HTML templates (author @jcary741, #953)
-
Remove all default values to the dependencies breaking change
DatasetParams.unscale:False->None(default toFalsein rio-tiler)DatasetParams.resampling_method:nearest->None(default tonearestin rio-tiler)DatasetParams.reproject_method:nearest->None(default tonearestin rio-tiler)ImageRenderingParams.add_mask:True->None(default toTruein rio-tiler)StatisticsParams.categorical:False->None(default toFalsein rio-tiler)
-
Add
as_dict(exclude_none=True/False)method to theDefaultDependencyclass.from typing import Optional from titiler.core.dependencies import DefaultDependency from dataclasses import dataclass @dataclass class Deps(DefaultDependency): value: Optional[int] = None print({**Deps().__dict__.items()}) >> {'value': None} Deps().as_dict() # `exclude_none` defaults to True >> {} Deps(value=1).as_dict() >> {'value': 1}
-
Fix Hillshade algorithm (bad
azimuthangle) -
Set default
azimuthandaltitudeangles to 45º for the Hillshade algorithm breaking change -
Use
.as_dict()method when passing option to rio-tiler Reader's methods to avoid parameter conflicts when using custom Readers. -
Rename
BaseTilerFactorytoBaseFactorybreaking change -
Remove useless attribute in
BaseFactory(and moved them toTilerFactory) breaking change -
Add
crsoption to/boundsendpoints to enable geographic_crs selection by the user -
/boundsendpoints now return acrs: strattribute in the response -
update
wmts.xmltemplate to support multiple layers -
re-order endpoints parameters
-
avoid
lat/lonoverflow inmapviewer -
add OGC Tiles
/tilesand/tiles/{tileMatrixSet}endpoints -
add
gifmedia type -
/pointendpoint returned masked values (Noneis nodata)
-
Rename
readerattribute tobackendinMosaicTilerFactorybreaking change -
Add
crsoption to/boundsendpoints to enable geographic_crs selection by the user -
/boundsendpoints now return acrs: strattribute in the response -
Update
cogeo-mosaicdependency to>=8.0,<9.0 -
re-order endpoints parameters
-
add OGC Tiles
/tilesand/tiles/{tileMatrixSet}endpoints -
/pointendpoint returned masked values (Noneis nodata)
-
Encode URL for cog_viewer and stac_viewer (author @guillemc23, #961)
-
Add links for render parameters and
/maplink to viewer dashboard (author @hrodmn, #987) -
Update viewers to use
/info.geojsonendpoint instead of/info
- update
starlette-cramjamdependency and set compression-level default to6
- fix release 0.18.8
- Add links for render parameters and /map link to viewer dashboard (author @hrodmn, #987)
- fix Hillshade algorithm (bad
azimuthangle) (#985) [Backported] - Encode URL for cog_viewer and stac_viewer (author @guillemc23, #961) [Backported]
- Improve XSS security for HTML templates (author @jcary741, #953) [Backported]
- Switch back to
fastapiinstead offastapi-slimand use>=0.109.0version
- Set version requirement for FastAPI to
>=0.111.0
- fix Tiles URL encoding for WMTSCapabilities XML document
- fix
WMTSCapabilities.xmlresponse for ArcMap compatibility- replace
Cloud Optimized GeoTIFFwith dataset URL orTiTilerfor the ows:ServiceIdentification title - replace
cogeowithDatasetfor thelayerows:Identifier
- replace
- move to
fastapi-slimto avoid unwanted dependencies (author @n8sty, #815)
- fix
TerrainRGBalgorithm name (author @JinIgarashi, #804) - add more tests for
RescalingParamsandHistogramParamsdependencies - make sure to return empty content for
204Error code
-
Add
ColorMapFactoryto create colorMap metadata endpoints (#796) -
Deprecation remove default
WebMercatorQuadtile matrix set in/tiles,/tilesjson.json,/mapand/WMTSCapabilities.xmlendpoints (#802)# Before /tiles/{z}/{x}/{y} /tilejson.json /map /WMTSCapabilities.xml # Now /tiles/WebMercatorQuad/{z}/{x}/{y} /WebMercatorQuad/tilejson.json /WebMercatorQuad/map /WebMercatorQuad/WMTSCapabilities.xml -
Deprecation
default_tmsattribute inBaseTilerFactory(becausetileMatrixSetIdis now required in endpoints).
-
Deprecation remove default
WebMercatorQuadtile matrix set in/tiles,/tilesjson.json,/mapand/WMTSCapabilities.xmlendpoints (#802)# Before /tiles/{z}/{x}/{y} /tilejson.json /map /WMTSCapabilities.xml # Now /tiles/WebMercatorQuad/{z}/{x}/{y} /WebMercatorQuad/tilejson.json /WebMercatorQuad/map /WebMercatorQuad/WMTSCapabilities.xml -
Deprecation
default_tmsattribute inMosaicTilerFactory(becausetileMatrixSetIdis now required in endpoints).
- add
requestas first argument inTemplateResponseto adapt with latest starlette version
- Add
extra="ignore"optionApiSettingsto fix pydantic issue when using.envfile (author @imanshafiei540, #800)
- fix OpenAPI metadata for algorithm (author @JinIgarashi, #797)
- add python 3.12 support
- Add
use_epsgparameter to WMTS endpoint to resolve ArcMAP issues and fix XML formating (author @gadomski, #782) - Add more OpenAPI metadata for algorithm (author @JinIgarashi, #783)
- fix invalid url parsing in HTML responses
- update
rio-tilerversion to>6.3.0 - use new
align_bounds_with_dataset=Truerio-tiler option in GeoJSON statistics methods for more precise calculation
- fix leafletjs template maxZoom to great than 18 for
/mapendpoint (author @Firefishy, #749)
- use morecantile
TileMatrixSet.cellSizeproperty instead of deprecated/privateTileMatrixSet._resolutionmethod
- use morecantile
TileMatrixSet.cellSizeproperty instead of deprecated/privateTileMatrixSet._resolutionmethod
- update FastAPI version lower limit to
>=0.107.0 - fix template loading for starlette >= 0.28 by using
jinja2.Environmentargument (author @jasongi, #744)
- fix template loading for starlette >= 0.28 by using
jinja2.Environmentargument (author @jasongi, #744)
- fix template loading for starlette >= 0.28 by using
jinja2.Environmentargument (author @jasongi, #744)
- use morecantile
TileMatrixSet.cellSizeproperty instead of deprecated/privateTileMatrixSet._resolutionmethod [backported from 0.16.1]
- use morecantile
TileMatrixSet.cellSizeproperty instead of deprecated/privateTileMatrixSet._resolutionmethod [backported from 0.16.1]
- update FastAPI version upper limit to
<0.107.0to avoid starlette breaking change (0.28)
- add simple auth (optional) based on
global_access_tokenstring, set withTITILER_API_GLOBAL_ACCESS_TOKENenvironment variable (author @DeflateAwning, #735)
- in
/mapHTML response, add Lat/Lon buffer to AOI to avoid creating wrong AOI (when data covers the whole world).
-
add
algorithmoptions for/statisticsendpoints -
switch from
BaseReader.statistics()method to a combination ofBaseReader.preview()andImageData.statistics()methods to get the statistics
-
update
rio-tilerrequirement to>=6.2.5,<7.0 -
allow
bidxoption intitiler.core.dependencies.AssetsBidxExprParamsandtitiler.core.dependencies.AssetsBidxParams# merge band 1 form asset1 and asset2 # before httpx.get( "/stac/preview", params=( ("url", "stac.json"), ("assets", "asset1"), ("assets", "asset2"), ("asset_bidx", "asset1|1"), ("asset_bidx", "asset2|1"), ) ) # now httpx.get( "/stac/preview", params=( ("url", "stac.json"), ("assets", "asset1"), ("assets", "asset2"), ("bidx", 1), ) )
-
fix openapi examples
- add
dst_crsoptions in/statistics [POST]and/feature [POST]endpoints
- add
dependencies.TileParamsdependency withbufferandpaddingoptions - add
tile_dependencyattribute inTilerFactoryclass (defaults toTileParams) - add
reproject(alias toreproject_method) option inDatasetParamsdependency
- Change
HTTP_404_NOT_FOUNDtoHTTP_204_NO_CONTENTwhen no asset is found or tile is empty (author @simouel, #713) - add
tile_dependencyattribute inMosaicTilerFactoryclass (defaults toTileParams)
- Support non-root paths in AWS API Gateway Lambda handler (author @DanSchoppe, #716)
- Allow a default
color_formulaparameter to be set via a dependency (author @samn, #707) - add
titiler.core.dependencies.create_colormap_dependencyto create ColorMapParams dependency fromrio_tiler.colormap.ColorMapsobject - add
py.typedfiles in titiler submodules (https://peps.python.org/pep-0561)
- added
PartFeatureParamsdependency
breaking changes
-
max_sizeis now set toNonefor/statistics [POST],/bboxand/featureendpoints, meaning the tiler will create image from the highest resolution. -
renamed
titiler.core.dependencies.ImageParamstoPreviewParams -
split TileFactory
img_dependencyattribute in two:-
img_preview_dependency: used in/previewand/statistics [GET], default toPreviewParams(withmax_size=1024) -
img_part_dependency: used in/bbox,/featureand/statistics [POST], default toPartFeatureParams(withmax_size=None)
-
-
renamed
/cropendpoints to/bbox/...or/feature/...-
/crop/{minx},{miny},{maxx},{maxy}.{format}->/bbox/{minx},{miny},{maxx},{maxy}.{format} -
/crop/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}->/bbox/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format} -
/crop [POST]->/feature [POST] -
/crop.{format} [POST]->/feature.{format} [POST] -
/crop/{width}x{height}.{format} [POST]->/feature/{width}x{height}.{format} [POST]
-
-
update
rio-tilerrequirement to>=6.2.1 -
Take coverage weights in account when generating statistics from GeoJSON features
- add
GetFeatureInfocapability inwmsExtension(author @benjaminleighton, #698)
-
replace
-by_in query parameters breaking changecoord-crs->coord_crsdst-crs->dst_crs
-
replace
bufferandcolor_formulaendpoint parameters by external dependencies (BufferParamsandColorFormulaParams) -
add
titiler.core.utils.render_imagewhich allow non-binary alpha band created with custom colormap.render_imagereplaceImageData.rendermethod.# before if cmap := colormap or dst_colormap: image = image.apply_colormap(cmap) if not format: format = ImageType.jpeg if image.mask.all() else ImageType.png content = image.render( img_format=format.driver, **format.profile, **render_params, ) # now # render_image will: # - apply the colormap # - choose the right output format if `None` # - create the binary data content, media_type = render_image( image, output_format=format, colormap=colormap or dst_colormap, **render_params, )
- rename
geom-densify-ptstogeometry_densifybreaking change - rename
geom-precisiontogeometry_precisionbreaking change
- fix Factories
url_formethod and avoid changingRequest.path_paramsobject
- replace mapbox-gl by maplibre
- replace Stamen by OpenStreetMap tiles
- simplify band selection handling (author @tayden, #688)
- fix
LowerCaseQueryStringMiddlewareunexpectedly truncating query parameters (authors @jthetzel and @jackharrhy, @#677)
- add
cors_allow_methodsinApiSettingsto control the CORS allowed methods (author @ubi15, #684)
- update core requirements to libraries using pydantic ~=2.0
- update requirements:
- fastapi
>=0.95.1-->>=0.100.0 - pydantic
~=1.0-->~=2.0 - rio-tiler
>=5.0,<6.0-->>=6.0,<7.0 - morecantile
>=4.3,<5.0-->>=5.0,<6.0 - geojson-pydantic
>=0.4,<0.7-->>=1.0,<2.0 - typing_extensions
>=4.6.1
- fastapi
- update requirements:
- rio-cogeo
>=4.0,<5.0"-->>=5.0,<6.0"
- rio-cogeo
- update requirements:
- cogeo-mosaic
>=6.0,<7.0-->>=7.0,<8.0
- cogeo-mosaic
- use
/apiand/api.htmlfor documentation (instead of/openapi.jsonand/docs) - update landing page
- use
AnnotatedType for Query/Path parameters - replace variable
TileMatrixSetIdbytileMatrixSetId
- update FastAPI dependency to
>=0.95.1 - set
pydanticdependency to~=1.0 - update
rio-tilerdependency to>=5.0,<6.0 - update TMS endpoints to match OGC Tiles specification
- use TiTiler's custom JSONResponse for the
/validateendpoint to avoid issue when COG hasNaNnodata value - update
rio-cogeodependency to>=4.0,<5.0 - update
rio-stacrequirement to>=0.8,<0.9and addgeom-densify-ptsandgeom-precisionoptions
- update
cogeo-mosaicdependency to>=6.0,<7.0 - remove
titiler.mosaic.resources.enum.PixelSelectionMethodand userio_tiler.mosaic.methods.PixelSelectionMethod - allow more TileMatrixSet (than only
WebMercatorQuad)
- make HTML
templatesconfigurable in the factories - rename
index.htmltomap.html - rename
dependencies.CRSParamstodependencies.CoordCRSParams - add
dst-crsoption for/previewand/cropendpoints to specify the output Coordinate Reference System.
- make HTML
templatesconfigurable in the factories
- make HTML
templatesconfigurable in the factories - rename
cog_index.htmltocog_viewer.html - rename
stac_index.htmltostac_viewer.html - add
zoom to pointinstacandcogviewers (author @dchirst, #614)
- Allow a default
rescaleparameter to be set via a dependency (author @samn, #619) - add
coord-crsparameter for/point,/partand/featureendpoints
- fix
TerrainRGB(change interval from1.0to0.1)
- set FastAPI version lower than 0.95 (fastapi/fastapi#9278)
- handle dateline crossing dataset in COG/STAC Viewer
- update Factories
url_formethod to make sure we return a string (#607)
- Add OSM background in
/mapviewer when using WebMercator TMS
- no change since 0.11.1a0
- switch to
hatchandpdm-pep517as build system and usepyproject.tomlfor python module metadata - switch to
rufffor python linting - update pre-commit configuration
- documentation fixes 🙏 (authors @jthetzel, @neilsh)
- fix documentation about
asset_bidx
- Algorithm change, make terrainrgb interval and baseval floats to support more quantizers (author @AndrewAnnex, #587)
- update
rio-tilerminimum version to4.1.6 - Apply colormap before defining image output format (when not provided)
- Apply colormap before defining image output format (when not provided)
- add
titiler.extensionspackage (cogValidateExtension,stacExtension,cogViewerExtension,stacViewerExtension,wmsExtension)
- update
cogeo-mosaicversion requirement to>=5.0,<5.2(allow usingaz://prefix from uri) - add
MOSAIC_STRICT_ZOOMenvironment variable to control if the application should allow fetching tiles outside mosaic min/max zooms
breaking change
- add
extensionsoption to theBaseTilerFactoryto specify a list of extension we want to register. Each extension will be then registered in the__post_init__object creation step. - remove
BaseHTTPMiddlewareclass inheritance for middleware (write pure ASGI middleware)
- uses Extension to add more endpoints to default
titiler.corefactories - move all
viewercode intotitiler.extensions - add
/cog/stacendpoint fromtitiler.extension.stacExtensionto create STAC Items from raster dataset
- removed deprecated empty path (
/is the correct route path, which enable prefixed and non-prefixed mosaic application)
- fix issue with new morecantile version
- replace path parameter in
router_prefixinBaseTilerFactory.url_for
- update
/mapendpoint and template to support multiple TMS (#560)
breaking change
- Simplify dependency requirements for titiler.mosaic and titiler.application and using
=={currentVersion}
- fix the
wmts.xmltemplate to work with non-epsg based CRS
- fix titiler.application viewer when using dataset with band name in metadata
- add
default_tmsinBaseTilerFactoryto set the default TMS identifier supported by the tiler (e.gWebMercatorQuad)
- remove useless
titiler.core.versionfile
- remove python 3.7 support
- add python 3.10 and 3.11 in CI
- update FastAPI requirement to
>=0.87 - update rio-tiler requirement to
>=4.1,<4.2 - remove
rescaleandcolor_formulafrom thepost_processdependency - add
algorithmsupport and introduce newalgorithmandalgorithm_paramsquery parameters
breaking changes
- remove
timing headersandtitiler.core.utilssubmodule - remove
asset_expression(except in/asset_statisticsendpoint) (see https://cogeotiff.github.io/rio-tiler/v4_migration/#multibasereader-expressions) - update Point output model to include
band_names - histogram and info band names are prefixed with
b(e.gb1) (ref: https://cogeotiff.github.io/rio-tiler/v4_migration/#band-names) - add
/mapendpoint in TilerFactory to display tiles given query-parameters - remove
TMSParamsandWebMercatorTMSParamsdependencies. - replace
TilerFactory.tms_dependencyattribute byTilerFactory.supported_tms. This attribute gets amorecantile.defaults.TileMatrixSetsstore and will create the tms dependencies dynamically - replace
TMSFactory.tms_dependencyattribute byTMSFactory.supported_tms. This attribute gets amorecantile.defaults.TileMatrixSetsstore and will create the tms dependencies dynamically - move
stats_dependencyandhistogram_dependencyfromBaseTilerFactorytoTilerFactory - per rio-tiler changes,
;has be to used in expression to indicate multiple bands.b1*2,b2+b3,b1/b3->b1*2;b2+b3;b1/b3
- update cogeo-mosaic requirement to
>=4.2,<4.3
breaking changes
- remove
timing headers - replace
MosaicTilerFactory.tms_dependencyattribute byMosaicTilerFactory.supported_tms. This attribute gets amorecantile.defaults.TileMatrixSetsstore and will create the tms dependencies dynamically
- code simplification by removing custom code and submodules from endpoints
breaking changes
- remove custom TMS and custom Colormap dependencies
- remove middleware submodule
- add
pixel_selection_dependencyoptions inMosaicTilerFactoryto allow default method override (author @samn, #495)
- allow
intervalcolormaps in titiler.application
- Check Charts workflow added for the Helm charts testing (author @emmanuelmathot, #495)
- add
environment_dependencyoption inBaseTilerFactoryto define GDAL environment at runtime. - remove
gdal_configoption inBaseTilerFactorybreaking
# before
router = TilerFactory(gdal_config={"GDAL_DISABLE_READDIR_ON_OPEN": "FALSE"}).router
# now
router = TilerFactory(environment_dependency=lambda: {"GDAL_DISABLE_READDIR_ON_OPEN": "FALSE"}).router
class ReaddirType(str, Enum):
false = "false"
true = "true"
empty_dir = "empty_dir"
# or at endpoint call. The user could choose between false/true/empty_dir
def gdal_env(disable_read: ReaddirType = Query(ReaddirType.false)):
return {"GDAL_DISABLE_READDIR_ON_OPEN": disable_read.value.upper()}
router = TilerFactory(environment_dependency=gdal_env).router- update
starlette-cramjamrequirement
- no change since
0.6.0a2
- revert to
setup.py+setuptoolsinstead ofpyproject.toml+flitbecause it broke namespace packages (#472)
- remove logging in error
exception_handler_factory - add optional
reader_dependencyto enable passingReader's option defined by Query/Header/Path parameters. - switch to
pyproject.toml - move version definition in
titiler.core.__version__breaking - Include all values for a query param in
LowerCaseQueryStringMiddleware(author @samn, #464)
- add optional
backend_dependencyto enable passingBackend's option defined by Query/Header/Path parameters. - remove
backend_optionsMosaicTilerFactory argument in favor of the use ofbackend_dependencybreaking - switch to
pyproject.toml - move version definition in
titiler.mosaic.__version__breaking
- Fix frontend to handle anti-meridian crossing data
- switch to
pyproject.toml - move version definition in
titiler.application.__version__breaking
- add
cachecontrol_max_http_codeoption toCacheControlMiddlewareto avoid adding cache-control headers for API errors (Author @sharkinsspatial, #444)
- update rio-tiler/morecantile/rio-cogeo/cogeo-mosaic versions
- add MultiBaseTilerFactory
/asset_statisticswhich will return per asset statistics. Returns response in form ofDict[{asset name}, Dict[{band name}, BandStatistics]]
breaking change
- Multi-band expression now uses semicolon
;instead of colon (,) as separator. Note: proper urlencoding might be needed.
# before
expression = "b1+b2,b2"
# new
expression = "b1+b2;b2"- MultiBaseTilerFactory
/statisticsnow returns merged statistics in form ofDict[{asset_band or expression}, BandStatistics](instead ofDict[{asset name}, Dict[{band name}, BandStatistics]])
# before
response = httpx.get(f"/stac/statistics?url=item.json").json()
print(response)
>>> {
"asset1": {
"1": {
"min": ...,
"max": ...,
...
},
"2": {
"min": ...,
"max": ...,
...
}
}
}
# now
response = httpx.get(f"/stac/statistics?url=item.json").json()
print(response)
>>> {
"asset1_1": {
"min": ...,
"max": ...,
...
},
"asset1_2": {
"min": ...,
"max": ...,
...
},
}- add tile
bufferoption to match rio-tiler tile options (#427)
- update minimum FastAPI version to
>=0.73(#425)
- update type information for the factory
colormap_dependency
- Update ingress k8s templates to be compatible with latest resource types versions (#425
- rename
DockerfiletoDockerfile.gunicorn - switch default docker image to python3.9
- add
Dockerfile.uvicorn
- update
rio-tilerversion requirement to>=3.0
- update
cogeo-mosaicversion to>=4.0
- update
rio-tilerversion (>=3.0.0a6) with new colormap types information and base classes - remove
additional_dependencyattribute inBaseTileFactory. This also remove**kwargsin endpoints breaking - remove
reader_optionsattribute inBaseTileFactorybreaking tms_dependencydefault totitiler.core.dependencies.TMSParamswhich should supports all morecantile's TMS.- add
route_dependenciesattribute toBaseTilerFactoryto allow customizing route dependencies (author @alukach, #406)
- update
cogeo-mosaicversion (>=4.0.0a2) with updated Backend type hints information
- fix titiler packages cross dependencies
- remove python 3.6 supports (related to morecantile/pyproj update)
- update
rio-tiler/morecantilerequirement (>=3.0) - remove
utils.bbox_to_feature(replaced by geojson_pydantic native functionFeature(geometry=Polygon.from_bounds(*bounds), properties=info)) - remove
utils.data_stats(replaced by rio-tiler new statistics method) - remove
metadataendpoints breaking API - update
statisticsendpoints with histogram options - update
statisticsendpoint responses breaking API - remove
band_expressioninBandsExprParamsdependency breaking API - remove
morecantilerequirement definition in setup.py and defers to rio-tiler supported version - update
titiler.core.dependencies.DefaultDependency(allows dict unpacking and remove.kwargs) breaking API - use standard for List in QueryParameter (e.g
bidx=1&bidx=2&bidxinstead ofbidx=1,2,3) breaking API - add
asset_bidxquery parameter in replacement ofbidxin MultiBaseFactory dependencies and switch to new format:{asset name}|{bidx,bidx,bidx}breaking API - update
asset_expressionto the new format:{asset name}|{expression}(e.gdata|b1+b2) breaking API - update
assetsQueryParameter to List (e.gassets=COG&assets=Data) breaking API - update
bandsQueryParameter to List (e.gbands=B01&bands=B02) breaking API - split
RenderParamsdependency into:PostProcessParams:rescaleandcolor_formulaparametersImageRenderingParams:return_mask
- add
process_dependencyattribute inBaseTilerFactory(defaults toPostProcessParams) - use
resamplingalias instead ofresampling_methodfor QueryParameter breaking API - defaults to available assets if
assetsoption is not provided forMultiBaseTilerFactoryinfo and statistics endpoints. - defaults to available bands if
bandsoption is not provided forMultiBandsTilerFactoryinfo and statistics endpoints. - better output models definition
- keep
bounds,minzoomandmaxzoomin/inforesponse - remove
datasetin/inforesponse to better follow the Info model - add
/statisticsendpoint by default
- update
cogeo-mosaicrequirement (>=4.0) - update response from
/infoendpoint to match the model.
- update viewers to match changes in titiler.core endpoints
- Update morecantile requirement to stay under
3.0(author @robintw, #389)
- Update rio-cogeo requirement to stay under
3.0
- add custom JSONResponse using simplejson to allow NaN/inf/-inf values (ref: #374)
- use
titiler.core.resources.responses.JSONResponseas default response forinfo,metadata,statisticsandpointendpoints (ref: #374)
- switch to
starlette_cramjamcompression middleware (ref: #369)
- update FastAPI requirements to
>=0.65,<0.68(ref: #366) - surface
asset_expressionandband_expressionin Multi*TilerFactory (ref: #367)
- move
titiler.application.middlewaretotitiler.core.middleware(#365)
- Update the TileJSON model for better validation and to match with the specification (center is optional) (#363)
- fix morecantile related tests (#358)
- fix float parsing when datatype is float32 (developmentseed/rio-viz#39)
- fix morecantile related tests (#358)
- add
/{z}/{x}/{y}/assets,/{lon},{lat}/assets,/{minx},{miny},{maxx},{maxy}/assetsGET endpoints to return a list of assets that intersect a given geometry (author @mackdelany, #351)
0.3.4 (2021-08-02) - Not published on PyPi #355
- add
/cropPOST endpoint to return an image from a GeoJSON feature (#339) - add
/statistics(GET and POST) endpoints to return advanced images statistics (#347)
- add optional
root_pathsetting to specify a url path prefix to use when running the app behind a reverse proxy (#343)
0.3.3 (2021-06-29) - Not published on PyPi #355
- fix possible bug when querystring parameter are case insensitive (#323)
- update
tilejsonandWMTSCapabilities.xmlendpoints to allow list querystrings (as done previously in #319)
- add
titiler.application.middleware.LowerCaseQueryStringMiddlewareto cast all query string parameter to lowercase (author @lorenzori, #321)
- move
titilercode tosrc/titiler
- update rio-tiler dependency to
>=2.1version and updaterescalequery-parameter (#319)
# before
# previously, rio-tiler was splitting a list of input range in tuple of 2
rescale=0,1000,0,1000,0,1000
# now
# rio-tiler 2.1 now expect sequence of tuple in form of Sequence[Tuple[Num, Num]]
rescale=0,1000&rescale=0,1000&rescale=0,1000
- update
cogeo-mosaicversion to>=3.0,<3.1.
- re-order middlewares (#311)
- update rio-cogeo version to
>=2.2and userio_cogeo.modelsinstead of custom ones.
-
add
exclude_pathoptions intitiler.application.middleware.CacheControlMiddlewareto avoid adding cache-control headers to specific paths. -
allow
histogram_binsto be a single value or a,delimited scalar (#307) -
change error status from
404to500forRasterioIOErrorexception (author @kylebarron, #300)Sometimes GDAL/Rasterio can lose track of the file handler (might be related to cache issue + threading) and raise
RasterioIOError: file not found, while the file exists for real. To avoid caching this, we changed the error code to 500 (errors >= 500 do not getcache-controlheader on titiler.application).
- add support for
.jpgand.jpegextensions (#271) - better error message when parsing the colormap value fails (#279)
breaking change
-
split
titilerinto a set of namespaces packages (#284)titiler.core
The
corepackage host the low level tiler factories.# before from titiler.endpoints.factory import TilerFactory # now from titiler.core.factory import TilerFactory
titiler.mosaic
The
mosaicpackage is a plugin totitiler.corewhich adds support for MosaicJSON# before from titiler.endpoints.factory import MosaicTilerFactory # now from titiler.mosaic.factory import MosaicTilerFactory
titiler.application
The
applicationpackage is a fullready to useFastAPI application with support of STAC, COG and MosaicJSON.# before $ pip install titiler $ uvicorn titiler.main:app --reload # now $ pip install titiler.application uvicorn $ uvicorn titiler.application.main:app --reload
- adapt for cogeo-mosaic
3.0.0rc2and addbackend_optionsattribute in MosaicTilerFactory (#247) - update FastAPI requirements
- update minimal python version to 3.6
- add
**render_params.kwargsto pass custom render params inimage.rendermethod (#259) - Changed probe url from
/pingto/healthzin k8s deployment
breaking change
-
renamed
OptionalHeaders,MimeTypesandImageDriversenums to the singular form (#258) -
renamed titiler.dependencies's Enums (
ColorMapName,ResamplingNameandTileMatrixSetName) to the singular form (#260) -
renamed
MimeTypetoMediaType(#258) -
add
ColorMapParamsdependency to ease the creation of custom colormap dependency (#252) -
renamed
PathParamstoDatasetPathParamsand also made it a simple callable (#260) -
renamed
colormapquery-parameter tocolormap_name(#262)# before /cog/preview.png?colormap=viridis # now /cog/preview.png?colormap_name=viridis -
use
colormapquery-parameter to pass custom colormap (#262)/cog/preview.png?colormap={"0": "#FFFF00FF", ...}
- update FastAPI requirements
- add
validateinMosaicTilerFactory(#206, author @drnextgis) - rename
ressourcespackage toresources(#210, author @drnextgis) - renamed environment variables prefixes for API and STACK configurations:
TITILER_STACKas prefix to CDK andTITILER_APIas prefix to API (#211, author @fredliporace) - remove MosaicTilerFactory
createandupdateendpoints (#218) - deleted
titiler.models.mosaicsbecause the models are not used anymore (#221) - update rio-tiler and cogeo-mosaic minimal versions (#220, #213)
- move STAC related dependencies to `titiler.dependencies (#225)
- add
rio_tiler.io.MultiBandReaderbands dependencies (#226) - add
MultiBaseTilerFactoryandMultiBandTilerFactorycustom tiler factories (#230) - Update STAC tiler to use the new
MultiBaseTilerFactoryfactory - depreciate empty GET endpoint for MosaicTilerFactory read (#232)
- better
debugconfiguration and make reponse headers metadata optional (#232)
breaking change
- update
titiler.dependencies.AssetsBidxParamsto makeasseta required parameter (#230 - the STAC
/infoendpoint now expect theassetsparameter to be passed. To ge the list of available assets we added a new/assetsendpoint within the tiler factory - remove
COGReaderas defaultreaderintitiler.endpoints.factory.BaseTilerFactory
- add
rio_tiler.errors.MissingBandsin known errors. - add
titiler.endpoints.factory.TMSFactoryto enable custom TMS endpoints. - breaking rename
BaseFactorytoBaseTilerFactoryintitiler.endpoints.factory
- allow
API_DISABLE_{COG/STAC/MOSAIC}environment variables to control default endpoints in titiler main app (#156) - add
overwriting=False/Trueon MosaicJSON creation (#164) - add
gdal_configoption to Tiler factories to replace customAPIRouteclass (#168) - add
info.geojsonendpoint to return dataset info as a GeoJSON feature (#166) - update
rio-tiler,cogeo-mosaicand optional dependencies
- require
rio-tiler>=2.0.0rc2 - update Enums for Image types. (breaking)
- Add more output datatype (jpeg2000, pngraw)
- add
width/heightin/cropendpoint path
/crop/{minx},{miny},{maxx},{maxy}.{format}
/crop/{minx},{miny},{maxx},{maxy}/{width}x{height}.{format}
- relax version for rio-tiler and cogeo-mosaic
"rio-cogeo~=2.0"
"rio-tiler>=2.0.0rc1,<2.1"
"cogeo-mosaic>=3.0.0a17,<3.1"- split
tile()forMosaicTilerFactorymethod (#147)
- update for rio-tiler==2.0.0rc1, cogeo-mosaic==3.0.0a17 and morecantile==2.0
- split
tile()factory method (#141, author @fredliporace)
- avoid changing mutable TMS and Colormap list by using deepcopy.
- quiet/turn off logs
- add logger middleware (#139)
- update for rio-tiler 2.0.0b17, which now support TMS (morecantile) by default.
- update fastapi minimum version to 0.61
breaking changes
- removed TMSTilerFactory (because default reader built with rio_tiler BaseReader should support TMS).
Note: We changed the versioning scheme to {major}.{minor}.{path}{pre}{prenum}
- remove
pkg_resources(pypa/setuptools#510)
- refactor CacheControl Middleware
- rename headers value
X-Server-TimingstoServer-Timing. - add
total;dur={}in response headerServer-Timing, using newtitiler.middleware.TotalTimeMiddlewaremiddleware (113)
from titiler.middleware import CacheControlMiddleware, TotalTimeMiddleware
from fastapi import FastAPI
app.add_middleware(CacheControlMiddleware, cachecontrol="public, max-age=3600")
app.add_middleware(TotalTimeMiddleware)- Add Brotli compression support (#126, author @kylebarron)
- Numerous fix to CDK app.py (co-author @kylebarron)
- exclude
tests/anstack/in titiler python package. - add
EPSG6933in TMS
breaking changes
-
[FACTORY] the
additional_dependencyshould be a Callable which return a dict.@dataclass # type: ignore class BaseFactory(metaclass=abc.ABCMeta): """BaseTiler Factory.""" ... # provide custom dependency additional_dependency: Callable[..., Dict] = field(default=lambda: dict())
def AssetsParams( assets: Optional[str] = Query( None, title="Asset indexes", description="comma (',') delimited asset names (might not be an available options of some readers)", ) ) -> Dict: """Assets Dependency.""" kwargs = {} if assets: kwargs["assets"] = assets.split(",") return kwargs
-
[FACTORY] remove
_prefix in factory methods (e.g_tile->tile) -
[FACTORY] refactor dependencies to better align with rio_tiler.io.BaseReader method definition.
Example:
In the
metadata, theMetadataParamswill be used to passpminandpmaxbecause they are the only required parameters for the metadata method. All other params will be passed to akwargsdict.@dataclass class MetadataParams(DefaultDependency): """Common Metadada parameters.""" # Required params pmin: float = Query(2.0, description="Minimum percentile") pmax: float = Query(98.0, description="Maximum percentile") # Optional parameters bidx: Optional[str] = Query( None, title="Band indexes", description="comma (',') delimited band indexes", ) ... def __post_init__(self): """Post Init.""" if self.bidx is not None: self.kwargs["indexes"] = tuple( int(s) for s in re.findall(r"\d+", self.bidx) ) ... # metadata method in factory def metadata( src_path=Depends(self.path_dependency), metadata_params=Depends(self.metadata_dependency), kwargs: Dict = Depends(self.additional_dependency), ): """Return metadata.""" reader = src_path.reader or self.reader with reader(src_path.url, **self.reader_options) as src_dst: info = src_dst.metadata( metadata_params.pmin, metadata_params.pmax, **metadata_params.kwargs, **kwargs, ) return info
-
[FACTORY] refactor dependencies definition
@dataclass # type: ignore class BaseFactory(metaclass=abc.ABCMeta): """BaseTiler Factory.""" reader: default_readers_type = field(default=COGReader) reader_options: Dict = field(default_factory=dict) # FastAPI router router: APIRouter = field(default_factory=APIRouter) # Path Dependency path_dependency: Type[PathParams] = field(default=PathParams) # Rasterio Dataset Options (nodata, unscale, resampling) dataset_dependency: default_deps_type = field(default=DatasetParams) # Indexes/Expression Dependencies layer_dependency: default_deps_type = field(default=BidxExprParams) # Image rendering Dependencies render_dependency: default_deps_type = field(default=RenderParams) # TileMatrixSet dependency tms_dependency: Callable[..., TileMatrixSet] = WebMercatorTMSParams # provide custom dependency additional_dependency: Callable[..., Dict] = field(default=lambda: dict())
-
remove
PathParams.readerattribute. This option was not used and would have been technically difficult to use.@dataclass class PathParams: """Create dataset path from args""" url: str = Query(..., description="Dataset URL")
-
Update
.npyoutput format to follow the numpyTile format (#103)import numpy import requests from io import BytesIO endpoint = ... url = "https://opendata.digitalglobe.com/events/mauritius-oil-spill/post-event/2020-08-12/105001001F1B5B00/105001001F1B5B00.tif" r = requests.get(f"{endpoint}/cog/tiles/14/10818/9146.npy", params = { "url": url, } ) data = numpy.load(BytesIO(r.content)) print(data.shape) > (4, 256, 256)
-
Add
titiler.custom.routing.apiroute_factory. This function enable the creation of custom fastapi.routing.APIRoute class withrasterio.Env()block.from fastapi import FastAPI, APIRouter from rasterio._env import get_gdal_config from titiler.custom.routing import apiroute_factory app = FastAPI() route_class = apiroute_factory({"GDAL_DISABLE_READDIR_ON_OPEN": "FALSE"}) router = APIRouter(route_class=route_class) @router.get("/simple") def simple(): """should return FALSE.""" res = get_gdal_config("GDAL_DISABLE_READDIR_ON_OPEN") return {"env": res} app.include_router(router)
Note: This has only be tested for python 3.6 and 3.7.
-
add custom
url_formethod in TilerFactory to retrieveprefixedendpoint URL (#95) -
remove magic
titiler.dependencies.PathParamsmosaicid path translation, where a user could passurl=mosaicid://to the endpoint. -
switch to
pydantic.BaseSettingsfor FastAPI application setting management.List of Settings:
name: str = "titiler" cors_origins: str = "*" cachecontrol: str = "public, max-age=3600"
API Settings can now be set by adding a .env file in your local project or by setting environment variables (e.g API_CORS_ORIGIN="https://mywebsite.com/*")
- add Transform and CRS information in
/partGeoTIFF output - pin rio-tiler-crs to
>=3.0b4,<3.1and cogeo-mosaic to>=3.0a10,<3.1
- rename titiler.models.cog.py to titiler.models.dataset.py
- remove cog* prefix to Bounds, Info and Metadata models
- allow Union[str, int] for key in Metadata.statistics (as defined in rio-tiler-pds)
e.g Create a Landsat 8 Tiler
from titiler.endpoints.factory import TilerFactory, MosaicTilerFactory
from titiler.dependencies import BandsParams
from rio_tiler_pds.landsat.aws.landsat8 import L8Reader # Not in TiTiler dependencies
from fastapi import FastAPI
app = FastAPI(title="Landsat Tiler", openapi_url="/api/v1/openapi.json")
scene = TilerFactory(
reader=L8Reader, additional_dependency=BandsParams, router_prefix="scenes"
)
mosaic = MosaicTilerFactory(
dataset_reader=L8Reader,
additional_dependency=BandsParams,
add_update=False,
add_create=False,
router_prefix="mosaic",
)
app.include_router(scene.router, prefix="/scenes", tags=["Scenes"])
app.include_router(mosaic.router, prefix="/mosaic", tags=["Mosaic"])First release on pypi
For this release we created new Tiler Factories class which handle creation of FastAPI routers for a given rio_tiler Readers.
from titiler.endpoints.factory import TilerFactory
from rio_tiler.io import COGReader, STACReader
from fastapi import FastAPI
app = FastAPI()
cog = TilerFactory()
app.include_router(cog.router, tags=["Cloud Optimized GeoTIFF"])The titiler.endpoints.factory.TilerFactory class will create a tiler with Web Mercator as uniq supported Tile Matrix Set.
For other TMS support, tiler needs to be created with titiler.endpoints.factory.TMSTilerFactory and with a TMS friendly reader (e.g rio_tiler_crs.COGReader).
Simple tiler with only Web Mercator support
from rio_tiler.io import COGReader
from titiler.endpoints import factory
from titiler.dependencies import WebMercatorTMSParams
app = factory.TilerFactory(reader=COGReader)
assert app.tms_dependency == WebMercatorTMSParamsTiler with more TMS support (from morecantile)
from rio_tiler_crs import COGReader
from titiler.endpoints import factory
from titiler.dependencies import TMSParams
app = factory.TMSTilerFactory(reader=COGReader)
assert app.tms_dependency == TMSParams- add mosaic support (#17 author @geospatial-jeff)
- update to rio-tiler-crs>=3.0b* and rio-tiler>=2.0b*
- Pin fastapi version to 0.60.1
- Remove titiler.core in favor of starlette settings (#55, author @geospatial-jeff)
- Add fastapi exception handlers (#56, author @geospatial-jeff)
- Remove intermediary routers (#57, author @geospatial-jeff)
- Remove /titiler/api submodule (e.g titiler.api.utils -> titiler.utils)
- Add Cache-Control middleware. Endpoints do not define any cache-control headers. (part of #43, co-author with @geospatial-jeff)
- Add 'X-Assets' in response headers for mosaic tiles (#51)
- add cog validation via rio-cogeo (co-author with @geospatial-jeff, #37)
- default tiler to Web Mercator only
- removed cache layer for tiles
- updated html templates
template_dir = pkg_resources.resource_filename("titiler", "templates")
templates = Jinja2Templates(directory=template_dir)
cog_template = templates.TemplateResponse(
name="cog_index.html",
context={
"request": request,
"tilejson": request.url_for("cog_tilejson"),
"metadata": request.url_for("cog_metadata"),
},
media_type="text/html",
)
stac_template = templates.TemplateResponse(
name="stac_index.html",
context={
"request": request,
"tilejson": request.url_for("stac_tilejson"),
"metadata": request.url_for("stac_info"),
},
media_type="text/html",
)- add
width&heightparameters in API docs to force output size for part/preview endpoints. - add
resampling_methodin API docs.
link: https://github.com/developmentseed/titiler/commit/725da5fa1bc56d8e192ae8ff0ad107493ca93378
- add minimum fastapi version (0.54.0) and update docker config
link: https://github.com/developmentseed/titiler/commit/95b98a32ffb3274d546dd52f99a3920091029b4c
- add
/preview,/crop,/pointendpoints
link: https://github.com/developmentseed/titiler/commit/8b63fc6b6141b9c9361c95d80897d77b5e2d47c3
- support STAC items (#16)
- better API documentation via response models
- update UI (
/stac/viewer,/cog/viewer) - re-order OpenAPI route tags
- update documentation
link: https://github.com/developmentseed/titiler/commit/fa2cb78906b0fd88506b89bace8174969be8cd4f
Initial release
link: https://github.com/developmentseed/titiler/commit/f4fdc02ea0235470589eeb34a4da8e5aae74e696