Since the specific outputs of these improvements all depend on what civics you're running, I'd say that's the first criteria I'm looking at. Canals max out under Protectionism (+1 commerce) and later, Planned Economy (+1 commerce, +1 production). So I don't think I'd be looking to canals in most situations if I'm not planning to eventually end up running Planned Economy. However, even if I'm not there's one scenario that jumps out at me: I have a very flat grassland-heavy city that's already got enough food to take it to its current population cap. In that case, sacrificing some of the eventual commerce of a town for extra hammers would be worth the tradeoff.