Thanks, the "k" threw me off a little, apparently, since "flat" (or German "flach") isn't that different after all. But even if the word parts have no relation to the meaning of the word, I find that knowing their literal translations still makes it much easier to learn them, at least for me. If "dicht" can also mean "dense" (so basically the same as German "dicht", which my dictionary seems to indicate), then it seems like there might even be some relation. And one more question if you don't mind: Can something that is "bij" something else also be "vlakbij" or "dichtbij" it, i.e. is "bij" simply more general or encompasses a bigger area (e.g. it could be used if a speaker doesn't want to or can't specify how close the things are), or would it then definitely not be as close?
You're right, dicht can also mean dense, e.g. een dicht bos = a dense forest, or dichtbevolkt = densely populated. Bij can indeed be a more vague description, that could be dichtbij as well (ik woon bij het bos (I live near the forest) > could be vlakbij but you cannot tell from this sentence). Another use of bij can never be replaced by dichtbij or vlakbij: ik ben bij het concert (I am at the concert), ik ben bij haar (thuis) (I am at her place), replacing bij by dichtbij or vlakbij would change the meaning in these cases.