In order to encourage trajectories to learn more from their neighbours, we propose to first roughly divide them into groups w.r.t their spatial-temporal proximity, and then feed each group independently into the other autoencoder. We use the Sort-Tile-Recursive (STR) algorithm [1]} to group the trajectories. The STR algorithm is originally used to pack spatially-close objects into minimum bounding rectangles (MBRs) and construct a bulk-loading R-tree index of the objects. Since each trajectory can be considered as an object in a three-dimensional space \((t, x, y)\) , where \(t\)  is the time dimension and \((x, y)\)  stands for the two spatial dimensions, we apply the idea of STR to pack trajectories. Trajectories in the same MBR or group are more likely to be traveling companions, and thus fed as an independent group into the model.
