Not that I'm trying to discourage anyone from solving this problem. That was merely my experience. There probably exists some combination of filtering and cleverness that would get around the discontinuities. But I think you can see from Google's incredibly vague elevation-along-route bike directions that this problem is not easy.