-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(raster)!: update titiler-pgstac from 0.2.3 to 0.8.0 #239
Conversation
@@ -12,7 +12,7 @@ repos: | |||
language_version: python | |||
|
|||
- repo: https://github.com/PyCQA/flake8 | |||
rev: 3.8.3 | |||
rev: 6.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flake8 didn't like Annotated
types so I had to update
raster_api/runtime/Dockerfile
Outdated
@@ -1,9 +1,9 @@ | |||
FROM public.ecr.aws/sam/build-python3.9:latest | |||
FROM public.ecr.aws/sam/build-python3.11:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not mandatory but will be faster
} | ||
) | ||
|
||
PostProcessParams = algorithms.dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this replace the post_process
option we used in DatasetParams
stac = MultiBaseTilerFactory( | ||
reader=PgSTACReader, | ||
path_dependency=ItemPathParams, | ||
optional_headers=optional_headers, | ||
router_prefix=f"{path_prefix}/stac", | ||
environment_dependency=settings.get_gdal_config, | ||
router=APIRouter(route_class=LoggerRouteHandler), | ||
extensions=[ | ||
stacViewerExtension(), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now use extensions
instead of creating custom Factories
extensions=[ | ||
cogValidateExtension(), | ||
cogViewerExtension(), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the official titiler extensions for the /validate
and /viewer
endpoints
super().__post_init__() | ||
|
||
if self.post_process is not None: | ||
self.post_process = pp_methods.get(self.post_process) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced by Algorithm
breaking change now we need to pass algorithm=swir
instead of post_process=swir
], | ||
) -> pystac.Item: | ||
"""STAC Item dependency.""" | ||
return get_stac_item(request.app.state.dbpool, collection, item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to keep the collection={collection_id}&item={item_id}
query parameters for the /stac
endpoints
return features[0] | ||
|
||
|
||
def DatasetPathParams( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this was used
"item": item.id, | ||
}, | ||
media_type="text/html", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extension instead of custom Factory
e789826
to
d177f15
Compare
"titiler.pgstac==0.2.3", | ||
"titiler.application>=0.10,<0.11", | ||
"importlib_resources>=1.1.0;python_version<='3.9'", # https://github.com/cogeotiff/rio-tiler/pull/379 | ||
"boto3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boto3
is now an optional dependency in rio-tiler
…cloudfront (#244) # What - adds optional configuration to deploy all endpoints with a custom root path (i.e. `/api/stac` and `/api/raster`) #229, #241 - adds support for using a cloudfront as a reverse proxy #229, #241, #245 - titiler-pgstac upgraded from 0.2.3 to 0.8.0 #239 - titiler upgrade for custom colormap configuration #243 # How tested A temporary test stack was deployed to confirm that raster-api works as expected and that the two-subdomain staging-stac and staging-raster pattern is still supported. The [pre-deploy diff action for this pr](https://github.com/NASA-IMPACT/veda-backend/actions/runs/6791564314/job/18463354484#step:11:919) confirms that the raster API lambda will be upgraded and no domain name changes will be caused.
ref #234
This PR aims to update titiler-pgstac from version 0.2.3 to 0.8.0. Doing so, will also update titiler, rio-tiler, morecantile, fastapi and pydantic.
Endpoint changes
Use/collections/{collection_id}/items/{item_id}
prefix for Item endpoint.I was able to keep this as it was (
{endpoint}/stac/info?collection=collection1&item=item1
)post_process=
->algorithm=
change tile url path parameter order from
/tiles/{searchid}/{TileMatrixSetId}/{z}/{x}/{y
} to/{searchid}/tiles/{TileMatrixSetId}/{z}/{x}/{y}
replace
/{searchid}/{z}/{x}/{y}/assets
endpoints by/{searchid}/tiles/{z}/{x}/{y}/assets
replace - by _ in query parameters
remove
max_size
default for mosaic's/statistics [POST]
endpoint breaking changeadd
/bbox
and/feature [POST]
optional endpoints