Clamp the Y position before trying to get the elevation