Most historic large cities were built in such places to begin with. If you aren't close to a major body of water like a river how are you going to provide water for the local population? And a lot of them are near the sea as well.
That is why Indonesia is moving its capital city. Are they doing it with China's BRI help?