migration to 0.4 #396
vincentsarago
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This Document references main changes from 0.3 to 0.4
Install
Current version on pypi is 0.4.0
Bands and Assets
In previous titiler version, we were requesting
bandsorassetsoptions to be set forMultiBaseandMultiBandsreadersinfoandstatisticsmethod. With TiTiler 0.4.0, we changed this and will now defaults to all available bands/assets if not provided.tradeoff: This means that you don't have to call the
/assetsor/bandsendpoint to get a list of available assets/bands but this means that rio-tiler will also open all dataset (bands or assets) to get the info.QueryParameters
Instead of requesting coma (
,) delimited value (e.gbidx=1,2,3), in 0.4 we now use List directly (e.gbidx=1&bidx=2&bidx=3)Parameters accepting list:
-
bidx-
bands-
assets-
asset_bidx-
asset_expression-
rescale-
c(categories in/statisticsendpoints)-
p(percentiles in/statisticsendpoints)Some endpoints in
MultiBaseTilerFactoryneedsdict(object) parameter. Sadly there is no standard way (for GET request) to define Object in Query Parameter so we had to make acustomway using pipe (|) asparam={key}|{value}which will then be converted toparam = {"key": value}in the application.asset_bidx=data|1,2,3->asset_bidx = {"data": [1, 2, 3]}In FastAPI we can use
aliasforQueryparameter. This help for using nice QueryParameter name in the API but keep direct compatibility with the backend code.bidxindexes{endpoint}/preview?url=data.tif&bidx=1&bidx=2&bdix=3asset_bidxasset_indexes{endpoint}/preview?url=data.json&asset_bidx=data|1,2,3return_maskadd_mask{endpoint}/preview.tif?url=data.tif&return_mask=Falserescalein_range{endpoint}/preview?url=data.tif&rescale=0,1000resamplingresampling_method{endpoint}/preview?url=data.tif&resampling=cubicSummary of changes
resampling_method->resamplingbidx=1,2,3->bidx=1&bidx=2&bidx=3assets=b1,b2->assets=b1&assets=b2(for MultiBaseTilerFactory)bands=b1,b2->bands=b1&bands=b2(for MultiBandsTilerFactory)asset_bidx=image|1,2,3asset_expression=image|b1+b2Dependencies
titiler.core.dependencies.DefaultDependencyBefore 0.4, we were using the
kwargsattribute to pass values to the functionnow we can unpack directly the values to the function
titiler.core.dependencies.RenderParamsIn
0.4we split theRenderParamstoPostProcessParamsandImageRenderingParamsand addedprocess_dependencyattribute in the TileFactory (defaults toPostProcessParams)Output Models
Precise pydantic Models have been added to all endpoint returning JSON or GeoJSON response. OpenAPI documentation should give a good preview of the expected responses.
Changes
datasetkey has been removed from the/inforesponses (to match rio-tiler.models.Info` model)minzoom,maxzoom,boundsare kept in the/inforesponsesEndpoints
/metadata: deleted and replaced by
/statistics/statistics: Statistics endpoints are now added by defaults (only
previewandpartare optional)Beta Was this translation helpful? Give feedback.
All reactions