1

I am looking at putting together a tile server for other astral bodies, such as Mars and the moon. At the moment I am using leafletjs and the Control.Scale at the client end (though could be any client API), which assumes Earth as the planet.

Should the planet radius be provided by the server to the client or should this be specified in the client? If it is the server, is there a metadata file that would be looked for and what is its format? If it is the client, should this be done via a custom TileLayer?

At the moment I am looking to use an open street maps style URL, such that:

http://{s}.tile.myhost.mydomain/planet/<planet_name>/<layer>/{z}/{x}/{y}.png
2

[...] a tile server for other astral bodies, such as Mars and the moon.[...] Should the planet radius be provided by the server to the client or should this be specified in the client?

Both.

Leaflet assumes EPSG:4326 as the reference frame of any L.LatLngs, and EPSG:3857 for display. These coordinate systems assume that the shape of the earth is WGS84.

The "right way" to do this is to use coordinate systems which use a Mars/Moon/[name of celestial body] ellipsoid, such as IAU2000:49913. You'll have to research things like coordinate reference systems, map projections, and geodetic transforms. It'll be also useful to have a look at how to define TMS grids.

The "quick and dirty way" is to keep using earth CRSs and provide tiles that cover the same area, like Leaflet-KSP does.

The decision of right vs fast is ultimately up to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.