How to get to an outer product table from a collection of (axis,coordinate) pairs? Didn't find how to do this. Seems to be a "higher order" union: the number of union operators depends on the data. I don't think SQL can do this.. I solved it in Python for now.