-
replace
-
by_
in query parameters breaking changecoord-crs
->coord_crs
dst-crs
->dst_crs
-
replace
buffer
andcolor_formula
endpoint parameters by external dependencies (BufferParams
andColorFormulaParams
) -
add
titiler.core.utils.render_image
which allow non-binary alpha band created with custom colormap.render_image
replaceImageData.render
method.# 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-pts
togeometry_densify
breaking change - rename
geom-precision
togeometry_precision
breaking change
- fix Factories
url_for
method and avoid changingRequest.path_params
object
- replace mapbox-gl by maplibre
- replace Stamen by OpenStreetMap tiles
- simplify band selection handling (author @tayden, developmentseed#688)
- fix
LowerCaseQueryStringMiddleware
unexpectedly truncating query parameters (authors @jthetzel and @jackharrhy, @developmentseed#677)
- add
cors_allow_methods
inApiSettings
to control the CORS allowed methods (author @ubi15, developmentseed#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
/api
and/api.html
for documentation (instead of/openapi.json
and/docs
) - update landing page
- use
Annotated
Type for Query/Path parameters - replace variable
TileMatrixSetId
bytileMatrixSetId
- update FastAPI dependency to
>=0.95.1
- set
pydantic
dependency to~=1.0
- update
rio-tiler
dependency to>=5.0,<6.0
- update TMS endpoints to match OGC Tiles specification
- use TiTiler's custom JSONResponse for the
/validate
endpoint to avoid issue when COG hasNaN
nodata value - update
rio-cogeo
dependency to>=4.0,<5.0
- update
rio-stac
requirement to>=0.8,<0.9
and addgeom-densify-pts
andgeom-precision
options
- update
cogeo-mosaic
dependency to>=6.0,<7.0
- remove
titiler.mosaic.resources.enum.PixelSelectionMethod
and userio_tiler.mosaic.methods.PixelSelectionMethod
- allow more TileMatrixSet (than only
WebMercatorQuad
)
- make HTML
templates
configurable in the factories - rename
index.html
tomap.html
- rename
dependencies.CRSParams
todependencies.CoordCRSParams
- add
dst-crs
option for/preview
and/crop
endpoints to specify the output Coordinate Reference System.
- make HTML
templates
configurable in the factories
- make HTML
templates
configurable in the factories - rename
cog_index.html
tocog_viewer.html
- rename
stac_index.html
tostac_viewer.html
- add
zoom to point
instac
andcog
viewers (author @dchirst, developmentseed#614)
- Allow a default
rescale
parameter to be set via a dependency (author @samn, developmentseed#619) - add
coord-crs
parameter for/point
,/part
and/feature
endpoints
- fix
TerrainRGB
(change interval from1.0
to0.1
)
- set FastAPI version lower than 0.95 (fastapi/fastapi#9278)
- handle dateline crossing dataset in COG/STAC Viewer
- update Factories
url_for
method to make sure we return a string (developmentseed#607)
- Add OSM background in
/map
viewer when using WebMercator TMS
- no change since 0.11.1a0
- switch to
hatch
andpdm-pep517
as build system and usepyproject.toml
for python module metadata - switch to
ruff
for 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, developmentseed#587)
- update
rio-tiler
minimum 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.extensions
package (cogValidateExtension
,stacExtension
,cogViewerExtension
,stacViewerExtension
,wmsExtension
)
- update
cogeo-mosaic
version requirement to>=5.0,<5.2
(allow usingaz://
prefix from uri) - add
MOSAIC_STRICT_ZOOM
environment variable to control if the application should allow fetching tiles outside mosaic min/max zooms
breaking change
- add
extensions
option to theBaseTilerFactory
to specify a list of extension we want to register. Each extension will be then registered in the__post_init__
object creation step. - remove
BaseHTTPMiddleware
class inheritance for middleware (write pure ASGI middleware)
- uses Extension to add more endpoints to default
titiler.core
factories - move all
viewer
code intotitiler.extensions
- add
/cog/stac
endpoint fromtitiler.extension.stacExtension
to 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_prefix
inBaseTilerFactory.url_for
- update
/map
endpoint and template to support multiple TMS (developmentseed#560)
breaking change
- Simplify dependency requirements for titiler.mosaic and titiler.application and using
=={currentVersion}
- fix the
wmts.xml
template to work with non-epsg based CRS
- fix titiler.application viewer when using dataset with band name in metadata
- add
default_tms
inBaseTilerFactory
to set the default TMS identifier supported by the tiler (e.gWebMercatorQuad
)
- remove useless
titiler.core.version
file
- 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
rescale
andcolor_formula
from thepost_process
dependency - add
algorithm
support and introduce newalgorithm
andalgorithm_params
query parameters
breaking changes
- remove
timing headers
andtitiler.core.utils
submodule - remove
asset_expression
(except in/asset_statistics
endpoint) (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
/map
endpoint in TilerFactory to display tiles given query-parameters - remove
TMSParams
andWebMercatorTMSParams
dependencies. - replace
TilerFactory.tms_dependency
attribute byTilerFactory.supported_tms
. This attribute gets amorecantile.defaults.TileMatrixSets
store and will create the tms dependencies dynamically - replace
TMSFactory.tms_dependency
attribute byTMSFactory.supported_tms
. This attribute gets amorecantile.defaults.TileMatrixSets
store and will create the tms dependencies dynamically - move
stats_dependency
andhistogram_dependency
fromBaseTilerFactory
toTilerFactory
- 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_dependency
attribute byMosaicTilerFactory.supported_tms
. This attribute gets amorecantile.defaults.TileMatrixSets
store 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_dependency
options inMosaicTilerFactory
to allow default method override (author @samn, developmentseed#495)
- allow
interval
colormaps in titiler.application
- Check Charts workflow added for the Helm charts testing (author @emmanuelmathot, developmentseed#495)
- add
environment_dependency
option inBaseTilerFactory
to define GDAL environment at runtime. - remove
gdal_config
option inBaseTilerFactory
breaking
# 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-cramjam
requirement
- no change since
0.6.0a2
- revert to
setup.py
+setuptools
instead ofpyproject.toml
+flit
because it broke namespace packages (developmentseed#472)
- remove logging in error
exception_handler_factory
- add optional
reader_dependency
to 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, developmentseed#464)
- add optional
backend_dependency
to enable passingBackend
's option defined by Query/Header/Path parameters. - remove
backend_options
MosaicTilerFactory argument in favor of the use ofbackend_dependency
breaking - 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_code
option toCacheControlMiddleware
to avoid adding cache-control headers for API errors (Author @sharkinsspatial, developmentseed#444)
- update rio-tiler/morecantile/rio-cogeo/cogeo-mosaic versions
- add MultiBaseTilerFactory
/asset_statistics
which 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
/statistics
now 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
buffer
option to match rio-tiler tile options (developmentseed#427)
- update minimum FastAPI version to
>=0.73
(developmentseed#425)
- update type information for the factory
colormap_dependency
- Update ingress k8s templates to be compatible with latest resource types versions (developmentseed#425
- rename
Dockerfile
toDockerfile.gunicorn
- switch default docker image to python3.9
- add
Dockerfile.uvicorn
- update
rio-tiler
version requirement to>=3.0
- update
cogeo-mosaic
version to>=4.0
- update
rio-tiler
version (>=3.0.0a6) with new colormap types information and base classes - remove
additional_dependency
attribute inBaseTileFactory
. This also remove**kwargs
in endpoints breaking - remove
reader_options
attribute inBaseTileFactory
breaking tms_dependency
default totitiler.core.dependencies.TMSParams
which should supports all morecantile's TMS.- add
route_dependencies
attribute toBaseTilerFactory
to allow customizing route dependencies (author @alukach, developmentseed#406)
- update
cogeo-mosaic
version (>=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/morecantile
requirement (>=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
metadata
endpoints breaking API - update
statistics
endpoints with histogram options - update
statistics
endpoint responses breaking API - remove
band_expression
inBandsExprParams
dependency breaking API - remove
morecantile
requirement 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&bidx
instead ofbidx=1,2,3
) breaking API - add
asset_bidx
query parameter in replacement ofbidx
in MultiBaseFactory dependencies and switch to new format:{asset name}|{bidx,bidx,bidx}
breaking API - update
asset_expression
to the new format:{asset name}|{expression}
(e.gdata|b1+b2
) breaking API - update
assets
QueryParameter to List (e.gassets=COG&assets=Data
) breaking API - update
bands
QueryParameter to List (e.gbands=B01&bands=B02
) breaking API - split
RenderParams
dependency into:PostProcessParams
:rescale
andcolor_formula
parametersImageRenderingParams
:return_mask
- add
process_dependency
attribute inBaseTilerFactory
(defaults toPostProcessParams
) - use
resampling
alias instead ofresampling_method
for QueryParameter breaking API - defaults to available assets if
assets
option is not provided forMultiBaseTilerFactory
info and statistics endpoints. - defaults to available bands if
bands
option is not provided forMultiBandsTilerFactory
info and statistics endpoints. - better output models definition
- keep
bounds
,minzoom
andmaxzoom
in/info
response - remove
dataset
in/info
response to better follow the Info model - add
/statistics
endpoint by default
- update
cogeo-mosaic
requirement (>=4.0) - update response from
/info
endpoint to match the model.
- update viewers to match changes in titiler.core endpoints
- Update morecantile requirement to stay under
3.0
(author @robintw, developmentseed#389)
- Update rio-cogeo requirement to stay under
3.0
- add custom JSONResponse using simplejson to allow NaN/inf/-inf values (ref: developmentseed#374)
- use
titiler.core.resources.responses.JSONResponse
as default response forinfo
,metadata
,statistics
andpoint
endpoints (ref: developmentseed#374)
- switch to
starlette_cramjam
compression middleware (ref: developmentseed#369)
- update FastAPI requirements to
>=0.65,<0.68
(ref: developmentseed#366) - surface
asset_expression
andband_expression
in Multi*TilerFactory (ref: developmentseed#367)
- move
titiler.application.middleware
totitiler.core.middleware
(developmentseed#365)
- Update the TileJSON model for better validation and to match with the specification (center is optional) (developmentseed#363)
- fix morecantile related tests (developmentseed#358)
- fix float parsing when datatype is float32 (developmentseed/rio-viz#39)
- fix morecantile related tests (developmentseed#358)
- add
/{z}/{x}/{y}/assets
,/{lon},{lat}/assets
,/{minx},{miny},{maxx},{maxy}/assets
GET endpoints to return a list of assets that intersect a given geometry (author @mackdelany, developmentseed#351)
0.3.4 (2021-08-02) - Not published on PyPi #355
- add
/crop
POST endpoint to return an image from a GeoJSON feature (developmentseed#339) - add
/statistics
(GET and POST) endpoints to return advanced images statistics (developmentseed#347)
- add optional
root_path
setting to specify a url path prefix to use when running the app behind a reverse proxy (developmentseed#343)
0.3.3 (2021-06-29) - Not published on PyPi #355
- fix possible bug when querystring parameter are case insensitive (developmentseed#323)
- update
tilejson
andWMTSCapabilities.xml
endpoints to allow list querystrings (as done previously in developmentseed#319)
- add
titiler.application.middleware.LowerCaseQueryStringMiddleware
to cast all query string parameter to lowercase (author @lorenzori, developmentseed#321)
- move
titiler
code tosrc/titiler
- update rio-tiler dependency to
>=2.1
version and updaterescale
query-parameter (developmentseed#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-mosaic
version to>=3.0,<3.1
.
- re-order middlewares (developmentseed#311)
- update rio-cogeo version to
>=2.2
and userio_cogeo.models
instead of custom ones.
-
add
exclude_path
options intitiler.application.middleware.CacheControlMiddleware
to avoid adding cache-control headers to specific paths. -
allow
histogram_bins
to be a single value or a,
delimited scalar (developmentseed#307) -
change error status from
404
to500
forRasterioIOError
exception (author @kylebarron, developmentseed#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-control
header on titiler.application).
- add support for
.jpg
and.jpeg
extensions (developmentseed#271) - better error message when parsing the colormap value fails (developmentseed#279)
breaking change
-
split
titiler
into a set of namespaces packages (developmentseed#284)titiler.core
The
core
package host the low level tiler factories.# before from titiler.endpoints.factory import TilerFactory # now from titiler.core.factory import TilerFactory
titiler.mosaic
The
mosaic
package is a plugin totitiler.core
which adds support for MosaicJSON# before from titiler.endpoints.factory import MosaicTilerFactory # now from titiler.mosaic.factory import MosaicTilerFactory
titiler.application
The
application
package is a fullready to use
FastAPI 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.0rc2
and addbackend_options
attribute in MosaicTilerFactory (developmentseed#247) - update FastAPI requirements
- update minimal python version to 3.6
- add
**render_params.kwargs
to pass custom render params inimage.render
method (developmentseed#259) - Changed probe url from
/ping
to/healthz
in k8s deployment
breaking change
-
renamed
OptionalHeaders
,MimeTypes
andImageDrivers
enums to the singular form (developmentseed#258) -
renamed titiler.dependencies's Enums (
ColorMapName
,ResamplingName
andTileMatrixSetName
) to the singular form (developmentseed#260) -
renamed
MimeType
toMediaType
(developmentseed#258) -
add
ColorMapParams
dependency to ease the creation of custom colormap dependency (developmentseed#252) -
renamed
PathParams
toDatasetPathParams
and also made it a simple callable (developmentseed#260) -
renamed
colormap
query-parameter tocolormap_name
(developmentseed#262)# before /cog/preview.png?colormap=viridis # now /cog/preview.png?colormap_name=viridis
-
use
colormap
query-parameter to pass custom colormap (developmentseed#262)/cog/preview.png?colormap={"0": "#FFFF00FF", ...}
- update FastAPI requirements
- add
validate
inMosaicTilerFactory
(developmentseed#206, author @drnextgis) - rename
ressources
package toresources
(developmentseed#210, author @drnextgis) - renamed environment variables prefixes for API and STACK configurations:
TITILER_STACK
as prefix to CDK andTITILER_API
as prefix to API (developmentseed#211, author @fredliporace) - remove MosaicTilerFactory
create
andupdate
endpoints (developmentseed#218) - deleted
titiler.models.mosaics
because the models are not used anymore (developmentseed#221) - update rio-tiler and cogeo-mosaic minimal versions (developmentseed#220, developmentseed#213)
- move STAC related dependencies to `titiler.dependencies (developmentseed#225)
- add
rio_tiler.io.MultiBandReader
bands dependencies (developmentseed#226) - add
MultiBaseTilerFactory
andMultiBandTilerFactory
custom tiler factories (developmentseed#230) - Update STAC tiler to use the new
MultiBaseTilerFactory
factory - depreciate empty GET endpoint for MosaicTilerFactory read (developmentseed#232)
- better
debug
configuration and make reponse headers metadata optional (developmentseed#232)
breaking change
- update
titiler.dependencies.AssetsBidxParams
to makeasset
a required parameter (developmentseed#230 - the STAC
/info
endpoint now expect theassets
parameter to be passed. To ge the list of available assets we added a new/assets
endpoint within the tiler factory - remove
COGReader
as defaultreader
intitiler.endpoints.factory.BaseTilerFactory
- add
rio_tiler.errors.MissingBands
in known errors. - add
titiler.endpoints.factory.TMSFactory
to enable custom TMS endpoints. - breaking rename
BaseFactory
toBaseTilerFactory
intitiler.endpoints.factory
- allow
API_DISABLE_{COG/STAC/MOSAIC}
environment variables to control default endpoints in titiler main app (developmentseed#156) - add
overwriting=False/True
on MosaicJSON creation (developmentseed#164) - add
gdal_config
option to Tiler factories to replace customAPIRoute
class (developmentseed#168) - add
info.geojson
endpoint to return dataset info as a GeoJSON feature (developmentseed#166) - update
rio-tiler
,cogeo-mosaic
and optional dependencies
- require
rio-tiler>=2.0.0rc2
- update Enums for Image types. (breaking)
- Add more output datatype (jpeg2000, pngraw)
- add
width/height
in/crop
endpoint 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()
forMosaicTilerFactory
method (developmentseed#147)
- update for rio-tiler==2.0.0rc1, cogeo-mosaic==3.0.0a17 and morecantile==2.0
- split
tile()
factory method (developmentseed#141, author @fredliporace)
- avoid changing mutable TMS and Colormap list by using deepcopy.
- quiet/turn off logs
- add logger middleware (developmentseed#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-Timings
toServer-Timing
. - add
total;dur={}
in response headerServer-Timing
, using newtitiler.middleware.TotalTimeMiddleware
middleware (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
EPSG6933
in TMS
breaking changes
-
[FACTORY] the
additional_dependency
should 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
, theMetadataParams
will be used to passpmin
andpmax
because they are the only required parameters for the metadata method. All other params will be passed to akwargs
dict.@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.reader
attribute. 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
.npy
output 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_for
method in TilerFactory to retrieveprefixed
endpoint URL (#95) -
remove magic
titiler.dependencies.PathParams
mosaicid path translation, where a user could passurl=mosaicid://
to the endpoint. -
switch to
pydantic.BaseSettings
for 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
/part
GeoTIFF output - pin rio-tiler-crs to
>=3.0b4,<3.1
and 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 == WebMercatorTMSParams
Tiler 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
&height
parameters in API docs to force output size for part/preview endpoints. - add
resampling_method
in 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
,/point
endpoints
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