Given we are in a world of 500 km underwater interconnects and synchronous grids that span up to eight time zones, I am not sure why you think electricity needs to be generated right next to cities.
Though, that said, existing urban rooftops are over a third of the required area to power the world, so you might as well stick some there while you are at it.