Skip to content
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

update BaseBackend to use a default coord_crs from the tms #234

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

AndrewAnnex
Copy link
Contributor

@AndrewAnnex AndrewAnnex commented Sep 29, 2024

update BaseBackend to use a default coord_crs from the tms parameter. There is also the mosaic def's tms which could be used but it is not clear if should be assumed or not...

This was causing issues with custom non earth TMSs. This is a higher priority than #233 to get resolved.

… There is also the mosaic def's tms which could be used but not clear if should be assumed or not
@vincentsarago
Copy link
Member

I'm not quite sure to see the issue. You can set you CRS when calling the method themself?

@AndrewAnnex
Copy link
Contributor Author

AndrewAnnex commented Sep 30, 2024

@vincentsarago, forgive me if I don't explain the issue well here as it's fairly complicated but here's my current understanding:

I am working in the planetcantile project to define TMSs for other planetary bodies (Moon, Mars, etc) so that these can be used across titiler/morecantile/cogeo-mosaic for mosaic.json. Currently in Titiler the mosaicjson endpoints will default to WGS84 for the CRS here and cause Proj errors when attempting to convert between my non-earth CRSs/TMSs.

Without modifying Titiler directly I think it makes more sense to update cogeo-mosaic as each TMS has a explicit or implicitly discoverable geographic crs from it's CRS parameter. One can work around this by setting PROJ_IGNORE_CELESTIAL_BODY=YES, but that is a hack and may not always do the right thing depending on the ellipsoid (many of the planetary CRSs have ellipsoids with different flattenings/ no fattenings as the ellipsoids are defined with equal semi major/minor axes, but are not explicitly spherical CRS which are possible to define with WKT2...)

Again, If a person defines a mosaic.json file, a TMS is required, and so think it makes sense to always grab the appropriate geographic crs from the TMS object (which will know it implicitly from the CRS/geographic_crs of the tms) rather than assuming WGS84. assets_for_tile seems to do this already but for consistency and to avoid the exceptions I was seeing from titiler this PR attempts to make that consistent

On a side note, I am also debugging an issue in morecantile with the geographic_crs/rasterio_geographic_crs ending up as 4326 vs the intended geographic_crs depending on how the TMS is serialized/initialized. Although I haven't made enough progress on that to post an issue or pr yet.

@vincentsarago vincentsarago merged commit 9519ae4 into developmentseed:main Oct 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants