Functions for fitting spline codebooks to sparse trajectory data.