Closed 0xCoto closed 1 year ago
This is great thanks for bringing this up! It's something I would love to support: I looked at adding a lunar at one point.
From memory, technically non-earth datasets would work: gdal doesn't recognise the MOLA data you linked but I think the projection information could be added like in this SE question.
The main issue I had was with the API: users give lat,lon WGS84 coordinates, which don't make sense not on earth, and I'm not sure if gdal can translate between datums on different planets.
Some potential solutions:
y,x
coordinates and a crs like ?locations=9329005,166022&epsg:32618
. If you're familiar with non-earth datasets I have a couple of questions:
Edit: also found this post on working with mars data using QGIS - again, not sure if it helps.
Thanks! I'll look through this, figure out what exactly would be needed, then make a call on if it's worth the changes!
@ajnisbet Hi Andrew, just wanted to follow up in case you'vr found anything interesting or determined the difficulty of implementing something like this? Hopefully I'm not disturbing too much :)
I had a look at this today.
Because Open Topo Data treats input coordinates as WGS-84, pyproj can't convert those coordinates to lunar/martian ones. You get the error
Error creating Transformer from CRS.: (Internal Proj Error: proj_create_operations: Source and target ellipsoid do not belong to the same celestial body)
The best way to handle this would be to add some parameters like xy_locations
and locations_srs
to let you specify coordinates that aren't wgs84 latlons. I will add this at some point, but it's non-trivial so I'm not sure when I'll be able to get round to it.
I'd accept a PR though! The steps needed are
api.py
.backend.get_elevation
locations_srs
to utils.reproject_latlons
, rename that function, and probably update the cached projection transforms to use both the source and destination coordinate systems as keys.
I'm not sure if this has been requested before, but it would be super useful if the Open Topo Data API server was extended to include elevation data from Mars. The two datasets I'm aware are described in this SE answer:
For the things I'm working on, the MOLA dataset would suffice to support my experiments, as it covers the entire Martian surface. Perhaps this might help others working in fields like astrogeology, space exploration and more!
How challenging would you say it would be to integrate this dataset to the current API? Do you think the available dataset format varies significantly from Earth-based data, or is it just as easy to implement?
Cheers!