How to use custom TMS/projection with 'Mosaic from COG urls' example #591
-
Thanks for such a powerful tool! I've got the example from here working: https://developmentseed.org/titiler/examples/code/mosaic_from_urls/ It seems fast and great! My next requirement is to get this working for polar projections. I've been able to add a custom tms to the route like so:
It shows up under /docs and appears to be generally working. However, the output is not changed, and tiles are still returned in web mercator when I hit the endpoint with a request like this: I think this all has to do with using this: Is there an example someone could point me to which sets up a backend that can mosaic multiple cogs (provided via list in url) like the example above but also supports projection to custom tms (and accepting tile requests in that custom tms as well) I feel like I might be missing something fundamental in my mental model here. I really appreciate any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
👋 Hi @Shane98c 😬 This turns out to be pretty complex. The Mosaic Factory use titiler/src/titiler/mosaic/titiler/mosaic/factory.py Lines 278 to 283 in 418bb93 This is one of the reason we had to re-write most of the factory for titiler-pgstac https://github.com/stac-utils/titiler-pgstac/blob/master/titiler/pgstac/factory.py#L251-L255 Sadly there is no quick fix (apart re-writing the MosaicTilerFactory FYI, I wanted to refactor the multiple file example to switch from mosaic to regular BaseReader but didn't find the time to finish. I'll 👋 you if I do |
Beta Was this translation helpful? Give feedback.
👋 Hi @Shane98c
😬 This turns out to be pretty complex. The Mosaic Factory use
BaseBackend
as a reference class. Because inBaseBackend
the TMS is set withinit=False
(meaning that user shouldn't pass the tms as input parameter) the MosaicTilerFactory's tiles endpoint do not use TMS as areader
inputtitiler/src/titiler/mosaic/titiler/mosaic/factory.py
Lines 278 to 283 in 418bb93
This is one of the reason we had to re-write most of the factory for titiler-pgstac https://github.com/stac-utils/titiler-pgstac/blob/master/titiler/pg…