I am making a small game like Kerbal Space Program. What I do is when I am over a certain height, I render the planet or moon as a sphere. Each planet or moon will have a generation seed to generate the terrain when I am going to land. This works really well with an earth like planet.
To generate a surface map for an earthlike planet, I just use 3d rotation to see where the point on the map is in a 3d coordinate space, and take its perlin noise value as height (I also use other factors to see what the terrain looks like, but I just start with a height).
This gives me a beautiful mountain, hill kind of landscape, which works good for watery planets. However, moons and rocky planet terrains have a lot of craters & I have no idea how I am going to do with noise.
Also I am using noise so I wouldn't have to save an entire terrain by itself for a celestial body's surface, I use it so I can see where I am on the planet, and generate the height from there. If there are other solutions please tell.