When we speak, we don't think of prepositions, we always use the correct one automatically.
There is a correspondence:
Location у + gen. Direction к + dat. Direction from от + gen.
...