At the moment, when a surface starport is spawned (in Space.cpp MakeFrameFor), the terrain height is checked, and if the starport is on water it is relocated (100 positions are tried, generated from an RNG using the SystemBody seed).
Apart from that code probably being in the wrong place (in my opinion starports should be placed properly at sysgen time, not relocated at spawn time), I think the height check should be skipped for custom starports which have an author-specified location. It's rather confusing having the specified location completely ignored just because the terrain happens to cross the water-line.
See forum thread: http://spacesimcentral.com/forum/topic/2939-wrong-radiants/
There should be a warning if relocation takes place for a custom system and maybe even an assert or something so modders will have to correct it.
Space shouldn't really need to know about city/starport placement mechanics. The knowledge should probably belong under Spacestation:: (or CityOnPlanet::).
However something to consider is that sysgen should happen in stages, both as an efficiency thing as different levels of generation are needed for different uses - everything need not be generated at once, and because there might be a back and forth required between different parts.
I've added checks for relocations to #1503. Being underwater will result in stderr output, but not an assert yet. This occurs in Sol, Epsilon Eridani and probably a few others. I can add an assert in later after those are relocated. ('Water' is classified as 0 height, so Dante's base on IO gets identified as water..)
The warning is good, but I don't want it to assert. There's no advantage to killing the game just because a starport is on "water"; no underlying code assumptions are violated in that situation, nothing else will break, so it's just an irritation. Modders may actually want to place starports on water, and I see no reason to stop them since it works fine.
Oh, I just wanted to get the attention of the modder so they need to fix it before proceeding (and also to keep output files clean/unconfusing when players check).
Edit: but I guess it might make changing seeds hard, so probably an error will suffice.