SpatialVec: Boundary-Aware Sampling for Geospatial Embeddings
Topological predicates are decided in a thin band at object boundaries; SpatialVec pushes its sampling budget there and gains most on polyline-polygon and polygon-polygon pairs, but its hyperparameters and dataset coverage are still thin enough that buyers must verify independently.
On this page
Two real-world datasets and a 22.9% accuracy gain sound convincing, but if you are a data buyer holding a quote for geospatial embeddings, the question you actually have to answer is narrower: does this vector keep the few metres where two boundaries touch? Most people assume that an embedding preserving overall shape is good enough, because the demo task usually has obvious visual structure. The failure shows up later, in the queries that matter. Does this parcel touch that road, is this line contained in that polygon. Touching, intersection, overlap and containment are decided in a thin band around boundaries, and a vector built from global statistics can average that band away. SpatialVec's pitch is that you spend your sampling budget where the decision is made [1].
Where topological decisions actually happen
Start with what exists. Histogram-based spatial embeddings summarise the distribution of spatial data into a vector. They are cheap, but they describe what is in a region, not how two boundaries meet. Poly2Vec puts points, polylines and polygons into a Fourier-domain encoder, and frequency summaries are good at keeping overall shape while giving little weight to the short stretch where two objects nearly touch. Geo2Vec goes further: it samples a signed distance field around each object, then learns a representation from it. A signed distance field simply records, for every query point, a number that is negative inside the object, positive outside, and equal in magnitude to the distance to the boundary. That captures fine geometry, yet the paper argues it does not explicitly model the detailed interactions that occur along object boundaries [1].
Why does the boundary dominate? Topological relationships such as disjoint, touching, intersecting, overlapping and containing are usually decided by the small region where two boundaries meet or pass close to each other. A vector drawn mostly from global statistics can preserve the fact that an object is a long thin polygon while flattening the fact that it is exactly tangent to a road. Polyline-polygon and polygon-polygon pairs are the hardest cases, because they need local boundary behaviour and global spatial context at the same time. That is also why the paper frames the problem as unified representation rather than better shape encoding. Points, polylines and polygons differ in dimensionality and in whether they have an interior, yet they must land in one embedding space.
How the sampling budget follows geometry
SpatialVec assigns each object its own sampling budget instead of giving every object the same number of query points. The budget is N_E = min(N_max, max(N_min, ceil(N_0 × (1 + λ_l × ℓ_E + λ_a × δ_E × sqrt(A_E))))). In plain terms: ℓ_E is the canonical boundary length for polygons or the canonical line length for polylines, and zero for points; A_E is polygon area, set to zero otherwise; δ_E is one for polygons and zero otherwise. Longer boundaries and larger areas earn more samples, subject to N_min and N_max. Adaptive therefore means the budget varies across objects, not that sampling jitters inside one object.
The budget is then split across three regions: boundary, interior and outer space. The weights are w_bnd = 1 + λ_b × ℓ_E, w_int = δ_E × (1 + λ_i × sqrt(A_E)) and w_space = 1, and the sample counts are floored from each weight's share of the total. Note the δ_E factor in w_int: points and polylines have no interior and receive no interior samples. The prose in the paper contains one error here, stating that the interior weight is set to zero if the object is a polygon, which contradicts Algorithm 1 and the definition of δ_E. Follow Algorithm 1 when reproducing: the interior weight is non-zero only for polygons.
| Region | Weight | Points | Polylines | Polygons |
|---|---|---|---|---|
| Boundary w_bnd | 1 + λ_b × ℓ_E | Yes, degenerates to 1 since ℓ_E = 0 | Yes, grows with line length | Yes, grows with boundary length |
| Interior w_int | δ_E × (1 + λ_i × sqrt(A_E)) | 0 | 0 | Yes, grows with area |
| Outer space w_space | 1 | Yes | Yes | Yes |
Boundary sampling is not uniform either. If the canonical boundary consists of segments with lengths ℓ_1 through ℓ_K, segment k is selected with probability ℓ_k divided by the sum of all segment lengths. Long segments receive proportionally more samples, and short segments are not silently dropped. This is the most concrete part of the boundary-aware claim, because topology-sensitive locations are often short segments, for example a brief stretch where one polygon runs flush against another.
Three geometry types, one vector
At every sampled location the framework evaluates three field values, together called the implicit spatial field: signed distance φ, occupancy o and boundary indicator b. The distance value is the signed distance to the boundary described above. Occupancy says whether the query point counts as belonging to or sitting against the object; polygons use inside versus outside, while points and polylines have no interior and are judged against a distance threshold τ_o. The boundary indicator is one when the absolute distance is within a threshold τ_b. Both thresholds are preset hyperparameters, and the excerpt does not give their values.
Geometry alone is not enough. Canonical normalisation centres each object and scales it by the bounding-box diagonal, which makes objects of different sizes comparable but also removes absolute size and absolute location. Distance estimation and range queries need exactly those two things. SpatialVec compensates with a 17-dimensional metadata vector concatenated to the learned geometry code. That is how the paper keeps overall shape and boundary evidence together: the code carries shape and boundary, the metadata carries scale and position.
| Metadata group | Dims | Contents |
|---|---|---|
| Geometry-type indicators | 3 | Whether the object is a point, polyline or polygon |
| Location coordinates | 6 | Centroid and bounding-box coordinates |
| Size features | 5 | Width, height, bounding-box diagonal, log area, log length |
| Shape descriptors | 3 | Aspect ratio, fill ratio, compactness |
| Total | 17 | Concatenated with geometry code and original-location encoding |
A Transformer encoder compresses the sampled observations into a compact geometry code z_E. Training needs no human labels: a reconstruction decoder recovers the field values at the sampled locations from z_E, which is the self-supervised objective the paper describes. Its job is to force z_E to retain both overall shape and boundary detail, rather than only the large contours that are easy to reconstruct. The final embedding concatenates the code with normalised metadata and original-location encoding, and points, polylines and polygons all share the same mapping. That shared mapping is what the word unified in the title means [1].
What the 22.9% and 15.4-59.7% actually measure
Evaluation covers two real-world geospatial datasets across four task families: topological relationship classification, distance estimation, range-query selectivity prediction, plus computational efficiency and an ablation study. Two numbers carry the headline. Topological classification accuracy improves by up to 22.9%, and the method achieves the best accuracy across all evaluated geometry pairs. Distance-estimation error drops by 15.4% to 59.7%. The paper states that the largest gains appear on the harder polyline-polygon and polygon-polygon combinations, which is consistent with the motivation, since the sampling budget is concentrated at boundaries.
| Downstream task | Reported outcome | Numbers in the excerpt |
|---|---|---|
| Topological relationship classification | Best accuracy on all evaluated geometry pairs, up to 22.9% improvement | Improvement given, per-pair absolutes not given |
| Distance estimation | Error reduced by 15.4% to 59.7% | Range given, per-dataset split not given |
| Range-query selectivity prediction | Evaluated downstream, outperforms baselines | No values in the excerpt |
| Computational efficiency | Evaluated separately | No values in the excerpt |
| Ablation study | Validates sampling and components | No values in the excerpt |
One point matters for procurement and the excerpt does not settle it. The excerpt never names the two real-world datasets, never states their scale or their train-test split, and never lists the full baseline set. The only comparison families named in the excerpt are histogram-based spatial embeddings, Poly2Vec's Fourier encoding and Geo2Vec's distance-field sampling. So the claim of significantly beating state-of-the-art baselines is directional within the material available here. How much it wins, and against which exact baselines, has to come from the full experimental section or from the authors.
When this method does not apply
- Narrow data coverage: two real-world datasets, unnamed and unsized in the excerpt, so transfer across cities and sources is untested.
- Hyperparameters undisclosed: the values of N_0, λ_l, λ_a, λ_b, λ_i, N_min and N_max, and any sensitivity analysis, are outside the excerpt.
- Points are a degenerate case: ℓ_E = 0 and δ_E = 0, so the budget collapses to N_0 bounded by the limits, boundary sampling has little to bite on, and point-only gains are not reported separately.
- Scale is restored by hand: absolute size and position ride on 17 hand-designed metadata dimensions, and the excerpt has no experiment on highly irregular or holed polygons.
- Normalisation is itself a loss of information: the method mitigates the loss of absolute scale and location, it does not remove it.
Put together, the boundary of applicability is clear. The method fails to pay off when your downstream decision only cares about overall shape, such as binning by area or filtering by aspect ratio, because spending compute on boundary sampling buys nothing there. It also weakens when the data is homogeneous in geometry type and tightly clustered in size, since an object-level adaptive budget then behaves much like a fixed one. Conversely, when the predicates you must decide are intersection, containment, adjacency or tangency, and the objects are mostly polyline-polygon and polygon-polygon pairs, boundary evidence is the deciding factor. In that setting the paper's design, a budget that follows geometry, boundary segments sampled in proportion to length, and metadata restoring what normalisation removed, targets the right thing [1].
