pan/midgard: Generalize temp coordinate to non-2D