At the small town of Canal Flats the Kootenay River passes within of Columbia Lake , the headwaters of the Columbia River , as it merges into the Rocky Mountain Trench along the eastern foothills of the Selkirk Mountains .