Fix altimetric profile if topology geometry is wrong (fixes #875)