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
-
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
bands
orassets
options to be set forMultiBase
andMultiBands
readersinfo
andstatistics
method. 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
/assets
or/bands
endpoint 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/statistics
endpoints)-
p
(percentiles in/statistics
endpoints)Some endpoints in
MultiBaseTilerFactory
needsdict
(object) parameter. Sadly there is no standard way (for GET request) to define Object in Query Parameter so we had to make acustom
way 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
alias
forQuery
parameter. This help for using nice QueryParameter name in the API but keep direct compatibility with the backend code.bidx
indexes
{endpoint}/preview?url=data.tif&bidx=1&bidx=2&bdix=3
asset_bidx
asset_indexes
{endpoint}/preview?url=data.json&asset_bidx=data|1,2,3
return_mask
add_mask
{endpoint}/preview.tif?url=data.tif&return_mask=False
rescale
in_range
{endpoint}/preview?url=data.tif&rescale=0,1000
resampling
resampling_method
{endpoint}/preview?url=data.tif&resampling=cubic
Summary of changes
resampling_method
->resampling
bidx=1,2,3
->bidx=1&bidx=2&bidx=3
assets=b1,b2
->assets=b1&assets=b2
(for MultiBaseTilerFactory)bands=b1,b2
->bands=b1&bands=b2
(for MultiBandsTilerFactory)asset_bidx=image|1,2,3
asset_expression=image|b1+b2
Dependencies
titiler.core.dependencies.DefaultDependency
Before 0.4, we were using the
kwargs
attribute to pass values to the functionnow we can unpack directly the values to the function
titiler.core.dependencies.RenderParams
In
0.4
we split theRenderParams
toPostProcessParams
andImageRenderingParams
and addedprocess_dependency
attribute 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
dataset
key has been removed from the/info
responses (to match rio-tiler.models.Info` model)minzoom
,maxzoom
,bounds
are kept in the/info
responsesEndpoints
/metadata: deleted and replaced by
/statistics
/statistics: Statistics endpoints are now added by defaults (only
preview
andpart
are optional)Beta Was this translation helpful? Give feedback.
All reactions