-
Notifications
You must be signed in to change notification settings - Fork 109
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
Allow Non-Earth Coordinates System #428
Comments
👋 @jlaura The problem is that by default rio-tiler tries to get the bounding box of the data in WGS84 (earth) rio-tiler/rio_tiler/io/cogeo.py Lines 103 to 105 in 809ee70
rio-tiler/rio_tiler/io/cogeo.py Lines 131 to 151 in 809ee70
both will fail for non-earth data (there is no possible coordinates transformation between earth and non-earth projection). I'm currently working on this but it will require a lot of change, which will then be added to #426 for our next major release. As mentioned over TiTiler, in order to fully utilise titiler/rio-tiler you'll need a TileMatrixSet for Europa (you won't be able to use WebMercator TMS to display your data). I was wondering if you had already created one. I don't know the specific of the coordinate system uses for your data or if there are standard TMS for non-earth body 🤷♂️ (having a TMS could help me during testing). |
@vincentsarago We must have a TMS defined for at least Mars because another provider serves up a WMTS (https://api.nasa.gov/mars-wmts/catalog/). The data are all in the projection that I am used to working in IAU2000:49900. For the moon, I would anticipate using IAU2000:30100. Here are all of the IAU projection codes in wkt format. I believe that the IAU projections should be getting into the proj library at some point, but I do not see them in the 8.1.1 release. I'll check with our liaison to that project. I also started to dig into the OGC TMS specification to see what all is required and will ping @thareUSGS to see if he has any additional information. |
Minor addendum - the codes are in proj (looking in 8.1.1), but under the ESRI namespace (not, IAU). For example, The 2015 IAU codes look like they will be in Proj 8.2 🚀 (OSGeo/PROJ#2876) Does having these help at all? |
@jlaura that's excellent info we can then construct a custom TMS: from pyproj import CRS
europa_crs = CRS.from_authority("ESRI", 104915)
print(europa_crs)
>>> <Geographic 2D CRS: ESRI:104915>
Name: GCS_Europa_2000
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World.
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: D_Europa_2000
- Ellipsoid: Europa_2000_IAU_IAG
- Prime Meridian: Reference_Meridian
from morecantile import TileMatrixSet
tms = TileMatrixSet.custom(
crs=europa_crs,
extent=europa_crs.area_of_use.bounds,
matrix_scale=[2, 1],
) # Checking if rasterio can do transformation from TMS crs and Image crs (the one you gave)
import rasterio
from rasterio.warp import transform_bounds
with rasterio.open("cog_nonearth.tif") as src:
transform_bounds(src.crs, tms.rasterio_crs, *src.bounds)
>>> (129.36834223297478, 13.985559117409744, 138.90253908503576, 23.13673177454536) Short story, I think it's possible to make rio-tiler/morecantile/titiler work with the data :-) |
@vincentsarago Awesome! Looks like I need to use the docs here - using a custom tms with the example that you used above and I should be good to go. I'll give that a look this evening (UTC-7) and report back on the discussion over on TiTiler. Much appreciate the information and rapid assist! |
FYI, for now rio-tiler will still error on non-earth images. I hope to finish my work over #429 later today. |
FYI, creating a tiler using #429 and the custom TMS shared earlier should work fine I've added a notebook in #429 https://github.com/cogeotiff/rio-tiler/blob/00d7f283c47d1ca9d5df5b3ca68e5e350c9a6576/docs/examples/Using-nonEarth-dataset.ipynb |
While testing TiTiler with an S3 hosted COG and I am running into some (not unexpected) issues with the fact that the data are of another body (Europa in this case. Also tested Mars).
I am seeing the following error when attempting to hit the /cog/bounds endpoint.
Speaking with the devs over on that project it sounds like this could be an issues with how the bounds are being computed. The morecantile project pulls a transformation object from pyproj. I wonder if a similar solution might be viable here so that the coordinate transformation can be generated?
Also, here is the direct link to the data if anyone is interested! https://asc-jupiter.s3-us-west-2.amazonaws.com/europa/galileo_voyager/controlled_mosaics/11ESCOLORS01-02_GalileoSSI_Equi-cog.tif
The text was updated successfully, but these errors were encountered: