Automated analysis of lateral river connectivity and fish stranding risks—Part 1: Review, theory and algorithm