Companies that store GPS traces (taxis, phones, delivery fleets) increasingly benchmark and tune their databases on synthetic trajectories. The reason is that real traces are private and hard to share. The generators behind these synthetic datasets are judged almost entirely on machine-learning criteria: whether trip-length and speed histograms match, and whether a travel-time predictor trained on fake data does about as well as one trained on real data. Spatiotemporal indexes are judged on something else. These are the data structures that let a database answer "which vehicles were inside this polygon between 8 and 9 am" without scanning everything, and their performance depends on how points pile up in space and time at many scales at once. A generator can match every one-dimensional histogram and still put its hotspots in the wrong shape. An index tuned on that data would then be tuned for a city that does not exist.
This note proposes to measure that failure directly, as the cost of tuning a spatiotemporal index on synthetic data and then deploying it on real data. It also proposes to test whether a cheap, engine-free statistic predicts that cost: a comparison of how many trajectory points and trajectory bounding boxes fall into grid cells at every resolution. If the statistic works, it becomes both a fidelity metric for trajectory generators and a target for a simple post-hoc correction of their output.
Core Claim
The claim has three parts. First, modern trajectory generators have a large error that current fidelity checks miss. Diffusion generators pass the Kolmogorov–Smirnov checks and downstream prediction tests used in SynMob. We expect them to still (a) rank competing spatiotemporal indexes differently than real data does and (b) lead index tuning to configurations that cost measurably more page reads on the real workload. Second, most of this error is predicted by a multi-scale occupancy spectrum, which compares real and synthetic cell counts across a hierarchy of space–time grids. It is predicted neither by 1D marginals nor by downstream ML utility. Third, reweighting or rejecting synthetic trajectories to match that spectrum removes most of the error without retraining the generator.
The measurement is new relative to the closest work. PrivBench defined "query runtime fidelity" for relational databases. It showed that synthetic tables which match marginals can still push the query optimizer into plans that are orders of magnitude slower, and it fixed this by modeling histograms and join fanouts inside a private sum-product network. PrivBench has no notion of continuous $(x, y, t)$ geometry, space-filling curves, or trajectory bounding boxes. This note carries its central question into trajectory storage and changes the target. PrivBench aims for equal runtime of a fixed plan. We aim for equal decisions: which index to choose and how to parameterize it. That is what a practitioner actually uses a benchmark for.
Research Program
The core object is tuning regret. Let $\theta$ be an index configuration, for example the grid depth of a GeoSOT code, the split threshold of an adaptive quadtree, or the segment length in a Hilbert-curve index. Let $C_D(\theta)$ be the mean number of disk pages that configuration reads to answer a query workload over dataset $D$. Tuning on synthetic data $S$ selects $\theta_S = \arg\min_\theta C_S(\theta)$. Tuning on real data $R$ selects $\theta_R$. The regret is
$$ \mathrm{Regret}(S) = \frac{C_R(\theta_S)}{C_R(\theta_R)} - 1, $$
which is zero when synthetic tuning is as good as real tuning. We count pages rather than wall-clock time so the metric does not depend on the hardware or engine; latency is reported as a secondary check. Alongside regret we measure ranking fidelity, the Kendall rank correlation between index methods ordered by cost on $S$ and on $R$. We also measure range-count Q-error, the ratio of estimated to true result counts, which is borrowed from PrivBench.
The proposed predictor is a multi-scale occupancy distance. For each grid level $\ell$ of a recursive space–time subdivision, we form the normalized histogram $p_\ell^D$ of points per cell. We then take
$$ \Delta(S, R) = \sum_{\ell} w_\ell \, W_1\!\left(\mathrm{sort}(p_\ell^S), \mathrm{sort}(p_\ell^R)\right) + \lambda \, W_1\!\left(V^S, V^R\right). $$
Here $W_1$ is the one-dimensional Wasserstein distance. Applied to sorted cell masses, it compares how skewed occupancy is at that scale. $V^D$ is the distribution of segment bounding-box volumes after a standard segmentation, and $w_\ell$ and $\lambda$ are weights fixed in advance (uniform, not fit to regret). Occupancy skew is what the adaptive quadtree of TrajStore and the adaptive Hilbert partitions of HHBITS exploit. Segment volume governs how well bounding-box indexes prune. So the index literature gives a mechanistic reason to expect $\Delta$ to track regret.
The corrective step is deliberately simple. We draw an oversized synthetic pool and importance-reweight or subsample whole trajectories so that per-level cell counts match a target spectrum. The target is either the real spectrum or, in the privacy setting, a noised version of it. This is the trajectory analogue of PrivBench's leaf histograms, applied after generation so that it works with any generator.
The generators under test come in two groups. The main one is a SynMob-style one-dimensional UNet diffusion model with classifier-free guidance ("diffusion model" meaning a generator that learns to turn random noise into samples by repeated denoising). We retrain it on each real corpus so that a real reference always exists. For stay-point data we additionally use the categorical diffusion model of Synthetic location trajectory generation using categorical diffusion models. That model is especially interesting here because its authors report that it overestimates travel distances and flattens distance distributions. This is exactly the kind of distortion we predict will corrupt density-adaptive partitioning. The second group is the non-learned generators that a skeptic would propose, described below.
Baselines
The naive reference point is current practice in spatiotemporal algorithm papers: benchmark on independent uniform and Gaussian points in a cube. This is what Choi et al. used to evaluate 3D MaxRS at 10,000 to 500,000 objects. We generate such data at matched point counts and bounding extents. A proposal that cannot beat this point is not worth doing. We expect uniform data to produce large regret for adaptive indexes and near-zero regret for static grids, and that contrast is itself informative.
The strongest learned competitor is the diffusion generator validated the way SynMob validates it. SynMob reports greater than 90% K-S similarity on travel distance, travel time and speed, a traffic-demand-prediction gap "often under 6%", and a travel-time-estimation gap of 4–10%. For each real corpus we train it with one fixed compute and tuning budget. We record these same ML fidelity numbers so that we can show SynMob-level ML fidelity coexisting with, or failing to coexist with, low index regret.
The strongest non-learned competitor is resampling of real data. This means bootstrapping whole trajectories with random time shifts, plus Gaussian jitter at several radii. It keeps real density almost by construction and may well win on regret; its cost is privacy. We therefore report every generator on a fidelity–privacy plane. Privacy is measured as nearest-real-trajectory distance and the success rate of a simple membership-inference attack. Resampling is "beaten" only if a learned generator plus correction reaches comparable regret at clearly better privacy.
For the indexes, the reference system is the MongoDB space–time composite index. It is compared with the GeoSOT unified code index of Qian et al., which reports about 40% better query efficiency than that composite index on Beijing taxi data. It is also compared with HHBITS, which reports saving about 40% of query time over three composite indexes on GeoLife, and with TrajStore's cost-driven quadtree, which reports being over 8 times faster than R-tree and grid baselines on Boston taxi traces. Every index gets the same parameter grid, the same hardware and the same workload whether it runs on real or synthetic data. No reported result on Lacuna measures tuning regret or index ranking fidelity for synthetic trajectories, so there is no prior number to beat. The success criterion is fixed in advance: corrected synthetic data should cut the diffusion baseline's regret by at least half and restore the real index ranking.
Two ablations isolate the key ingredient. The first applies the reweighting with a single-resolution histogram instead of the full multi-scale spectrum. The second drops the segment-volume term. If single-scale matching works as well as multi-scale, the multi-scale claim is wrong.
Why not just…?
Why not just trust K-S tests and downstream ML utility, as SynMob does? Those checks look at one variable at a time, or at an aggregate prediction task. Neither is sensitive to the joint shape of hotspots across scales. PrivBench is the direct precedent: synthetic tables that satisfied marginal criteria still produced large cardinality errors and wrong plans. Our experiment tests this claim for trajectories rather than assuming it. We rank all generators by K-S similarity, by ML utility gap and by $\Delta$, and ask which ranking agrees with regret. If K-S predicts regret as well as $\Delta$ does, the metric part of this proposal fails, and we will say so.
Why not just release jittered or bootstrapped real trajectories? This is the most serious threat, and we expect it to have low regret. SynMob argues that perturbed GPS traces can be re-identified, but that argument is not quantified in the file, so we measure it ourselves. The proposal survives only if the fidelity–privacy plane shows corrected learned generators dominating resampling somewhere useful. If resampling at moderate jitter is both private enough and low-regret, the right recommendation is "use resampling", and the note will report that.
Why not just skip generators and tune indexes on a small real sample? A subsample preserves density shape but not absolute density, and adaptive indexes split cells based on point counts. We include a 10% real subsample, rescaled in count, as a baseline. If it matches corrected synthetic data, the value of synthesis lies only in sharing data across organizations, not in fidelity.
Why not use learned indexes and avoid tuning altogether? Marcus et al. found that learned indexes lag B+-trees on range queries, writes and compound keys, including on OpenStreetMap cell keys. Spatiotemporal range queries over streaming inserts are exactly that regime, so we keep to conventional unified indexes.
Proposed Experiments
The real corpora are the Microsoft Beijing Taxi data (about 10 million trajectories from 10,357 taxis), GeoLife (18,670 trajectories, about 24.9 million points), and Boston taxi traces (245 million points), all as described in the cited index papers. The released SYN-CHENGDU and SYN-XI'AN sets are used only for spectrum analysis unless the matching real data can be obtained. The query workloads come in two kinds. One is uniform random 3D range boxes, as in the GeoSOT evaluation. The other is density-following boxes whose centers are sampled from the real point distribution at three selectivities. We add MaxRS queries answered by the divide-and-conquer algorithm to cover an aggregation workload.
Three results would settle the claim. First, on at least two of three corpora, diffusion data with SynMob-level ML fidelity must show nonzero regret and a flipped ranking among the four indexes under density-following workloads. Without this, the problem does not exist. Second, across all generators and jitter levels, $\Delta$ must correlate with regret more strongly than the K-S statistics or the ML utility gap do, measured with held-out corpora so that nothing is fit to the outcome. Third, spectrum-matched reweighting must bring diffusion regret close to that of real subsampling, and the multi-scale version must outperform the single-scale ablation. We also run a workload-shift stress test, since the index literature flags shifting hotspots as the weak point of adaptive structures: we tune on the morning rush in synthetic data and deploy on the evening rush in real data. This tests whether synthetic data can at least anticipate the shift a real deployment will face.
References
- SynMob: Creating High-Fidelity Synthetic GPS Trajectory Dataset for Urban Mobility Analysis
- Privacy-Enhanced Database Synthesis for Benchmark Publishing
- Demonstration of the TrajStore System
- Non-Uniform Spatial Partitions and Optimized Trajectory Segments for Storage and Indexing of Massive GPS Trajectory Data
- Synthetic location trajectory generation using categorical diffusion models
- Scalable Algorithms for Maximizing Spatiotemporal Range Sum and Range Sum Change in Spatiotemporal Datasets
- GeoSOT-Based Spatiotemporal Index of Massive Trajectory Data
- Learned Index: A Comprehensive Experimental Evaluation