-
Notifications
You must be signed in to change notification settings - Fork 31
update for titiler-pgstac 0.1.0a3 #22
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
Conversation
| ################################################################################ | ||
| registered_cmaps = cmap | ||
| custom_colormaps: Dict[str, Dict[int, List[int]]] = { | ||
| custom_colormaps: Dict[str, ColorMapType] = { |
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.
update to use new rio-tiler ColorMap Type
| 98: [10, 5, 250, 255], | ||
| 99: [5, 2, 252, 255], | ||
| 100: [0, 0, 255, 255], | ||
| 0: (255, 255, 255, 255), |
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.
Type, is now a Tuple
| path_dependency=ItemPathParams, | ||
| colormap_dependency=PCColorMapParams, | ||
| router_prefix=get_settings().item_endpoint_prefix, | ||
| ) |
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.
There is no more need to create a custom TilerFactory, we can use MultiBaseTilerFactory and set custom params
| f"collections/{collection}/items/{item}", | ||
| ) | ||
|
|
||
| def register_poly_crop(self) -> None: |
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.
/crop is now in titiler tiler factory
| raise Exception("Cannot make a colormap from Intervals colormap") | ||
|
|
||
| if len(cm) > 256 or max(cm) >= 256: | ||
| raise Exception("Cannot make a colormap for discrete colormap") |
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.
make_lut can only work with GDAL like colormap
| @dataclass | ||
| class AssetsBidxExprParams(dependencies.AssetsBidxExprParams): | ||
|
|
||
| collection: str = Query(None, description="STAC Collection ID") |
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 add collection to AssetsBidxExprParams params which will be used in all endpoints
| reader=CustomPGSTACBackend, # type:ignore | ||
| router_prefix=get_settings().mosaic_endpoint_prefix, | ||
| pgstac_mosaic_factory = MosaicTilerFactory( | ||
| reader=PGSTACBackend, |
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.
no more need for custom MosaicTilerFactory (no more retry connection)
pctiler/pctiler/reader.py
Outdated
| @attr.s | ||
| class MosaicSTACReader(MultiBaseReader): | ||
| """Simplified STAC Reader. | ||
| class CustomSTACReader(pgstac_mosaic.CustomSTACReader): |
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 can extent pgstac_mosaic.CustomSTACReader instead of creating a new custom one
|
Breaking changes, are described in developmentseed/titiler#396. TiTiler is trying to use better query parameters format, so moving away of For the Tiler API here are the breaking changes:
|
|
@vincentsarago Sorry I didn't see that this PR was waiting for us to approve a CI build. I just kicked that off, and you can see the build failure in the action logs.
|
|
Getting failures on preview endpoint: Failure for mosaic/tile endpoint /register endpoint seems to be working ok. Let me know if I can help debug these. |
|
@vincentsarago things are generally working with the upgrade, though I've got a few test cases that are failing that I'm hoping are just related to a misunderstanding of the new TiTiler url params. Can you offer some suggestions here: Previous working URL params
Not working
Also tried
The tile version also fails with a different error
I'll note that some NAIP / bidx request are succeeding, such as
so I don't think it's URL params, necessarily. The requests that fail to render on this branch succeed for the same item/asset/bands in our staging deployment. Something to do with the COGs themselves? Looks like other collections with requests involving bands fail similarly
All the other PC collections are rendering items correctly. |
|
thanks for the feedback @mmcfarland I realize now that rio-tiler/titiler could be smarter and maybe only accept about the tile requests that succeed: when passing |
|
Ah, makes sense. I should have taken the error message at its word 😬. I fixed up the |
mmcfarland
left a comment
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.
Tested and working
Description
This PR update TiTiler-PgSTAC requirement (+titiler and rio-tiler)
Type of change
How Has This Been Tested?
TODO
Locally, just made
Checklist:
Please delete options that are not relevant.