All summaries · 2026-11-03

SpatialVec: A Unified Representation Learning Framework for Geospatial Objects with Boundary-Aware Sampling

Samya Acharja, Kanchan Chowdhury

arXiv:2611.00111 · abstract · pdf · summarized by meta/muse-spark-1.3-contributor on 2026-11-03

The one-paragraph version

SpatialVec is a way to turn map objects — points like a shop location, polylines like a road, and polygons like a building footprint — into a single kind of fixed-length numeric vector that a machine-learning model can use. The core problem it tackles is that whether two objects touch, overlap, contain each other, or sit apart is often decided by a tiny strip where their edges come close, and older embeddings smooth over that detail. SpatialVec therefore looks extra carefully at boundaries: it centers and rescales each shape, samples many query points near the edge plus some inside and outside, records three clues at each point, and trains a Transformer to compress those clues into a compact code that can reconstruct them. On two OpenStreetMap datasets from New York City and Singapore, that boundary-focused code beats prior methods on classifying topological relations, estimating distances, and predicting range-query selectivity, with the biggest wins on the hardest polyline-polygon and polygon-polygon cases.

The problem they're solving, and why it matters

GeoAI systems need to reason over geography, not just text and pixels. A city model might need to know that a road touches a park boundary, a building is inside a parcel, or two footprints overlap. Those are topological relationships, meaning qualitative patterns of connection like disjoint, touching, overlapping, containing, and crossing, as opposed to exact coordinates.

Prior encoders struggle here. Histogram summaries count where geometry falls in coarse bins and lose edge precision. Fourier-domain summaries, which describe shape as a mix of wavy patterns at different frequencies, capture global outline well but can blur exactly where two edges meet. Even the recent implicit-field approach that measures distance to the shape does not explicitly emphasize the boundary zone.

This matters because many downstream tasks — urban analysis, transport modeling, environmental monitoring, spatial search and query optimization — need both local edge evidence and global context like size and absolute position at the same time. Without both, a model may know roughly what a shape looks like but fail to answer whether it touches another shape.

The key idea, in plain words

Look hardest where topology lives: at the boundary.

Imagine two building polygons that just touch at a corner. Their interiors are far apart, and a random or coarse sample might miss that one contact point entirely. SpatialVec spends most of its sampling budget right on and around edges, in thin layers moving outward, while still keeping some samples deep inside and far outside so it does not lose the big picture.

At each sampled spot it records three complementary answers. First, how far am I from the object, and for polygons, am I inside or outside. Second, do I count as occupied, meaning inside a polygon or very close to a point or line. Third, am I in the narrow boundary band. Those three views together say: continuous distance, solid extent, and edge proximity.

A Transformer encoder then reads all those annotated spots as an unordered set, pays special attention to edge spots, and squeezes everything into one geometry code. A decoder has to reconstruct the three answers from that code, which forces the code to remember both overall shape and fine edge detail. Finally the code is glued to size, shape-type, and real-world location info, because normalized shape alone cannot answer how far apart things are in meters.

How it actually works, step by step

1. Normalize but remember the original. Each object, defined as an ordered list of two-dimensional coordinates, is moved so its center sits at the origin and scaled by its bounding-box diagonal. That shared normalized setup is called the canonical geometry space. In parallel the method saves a 17-number metadata summary: what geometry type it is, where its center and bounding box were originally, how wide, tall, large and long it is, and shape descriptors like how stretched, filled, or compact it is.

2. Choose how many points to sample, based on the object. Instead of a fixed count, complex objects get more samples within allowed limits of 512 to 2048. Longer edges mean more boundary samples. Larger polygon areas mean more interior samples. That total is then split among three regions: boundary region, polygon interior, and outer space, with weights that favor boundaries.

Note: the text description of when the interior weight is zero appears flipped relative to the algorithm and surrounding text, so the exact wording there is unclear — but the intended behavior is clear from context: only polygons get interior samples; points and polylines get none.

3. Sample the boundary densely. For lines and polygon outlines, a segment is picked with probability proportional to its length, so long sides naturally get more attention than tiny kinks. A point along it is chosen, then nudged outward by a small offset distance drawn from a fixed set of thin layers. One layer is exactly on the edge, others step outward. For an isolated point object, samples are drawn as rings around the center at increasing radii.

4. Sample interior and exterior for context. Interior candidates are drawn uniformly inside the bounding box and kept only if a point-in-polygon test says they are truly inside and safely away from the edge. Outer-space candidates are drawn uniformly in the surrounding space and kept only if outside the polygon and away from the edge. All samples are then shuffled so order carries no meaning.

5. Describe each sample with three fields. The signed distance field is the distance to the closest edge, made negative inside polygons and always positive for points and lines which have no inside. The occupancy field is a yes-or-no flag for belonging to or lying very close to the object, using a threshold fixed at 0.025 in normalized space. The boundary field is a yes-or-no flag for lying very close to the edge, using the same threshold. Together those three numbers at a query location form what the paper calls the implicit spatial field.

6. Turn samples into tokens. Each two-dimensional sample coordinate is expanded with sine and cosine waves at eight frequencies to capture both broad trends and fine wiggles, yielding a 34-number coordinate code. That is concatenated with the distance value, the two yes-or-no flags, and a three-way distance band label of near, middle, or far. The result is a 40-number token per sample, projected up to 256 numbers, then combined with encoded metadata and encoded original location so every token knows both local evidence and global context.

7. Encode with a Transformer and multi-view pooling. A learnable summary token is prepended and six self-attention layers let every sample see every other sample. Then nine summaries are concatenated: the summary token, average and maximum over all points, attention-weighted and average boundary views, middle- and far-band views, plus metadata and location views. A fusion network compresses that wide concatenation into a 256-number geometry code.

8. Train by reconstruction. During training, each point's encoding plus the global code must predict back the original distance, occupancy, and boundary values. Distance errors count more near the edge, but capped so ultra-close points cannot dominate, and the two yes-or-no tasks use standard classification loss. A tiny penalty keeps the code from growing too large. After training, the final 477-number embedding is the geometry code plus normalized metadata plus a frequency encoding of the original location.

What they showed — results, honestly, with limitations

The authors use New York City with about 15k points, 140k roads, and 1.15M buildings, and Singapore with about 4k points, 46k roads, and 110k buildings, and keep the same downstream setups as prior work so only the input vectors change.

For topological classification across five pair types and both cities, SpatialVec is best or tied-best in all ten settings. Easy point-line or point-polygon cases are near ceiling for several methods, but hard cases separate clearly. Compared to the strongest baseline, polyline-polygon accuracy improves by about 4.9% in Singapore and 19.4% in New York, and polygon-polygon by about 6.7% and 22.9%.

For distance estimation without seeing coordinates, SpatialVec has the lowest average absolute error in all six tested settings. Against the strongest baseline, error drops by roughly 15-19% in Singapore and 41-60% in New York, with the largest drop near 59.7% for New York polyline-polygon.

For range-query selectivity, meaning predicting what fraction of objects intersect a query window, SpatialVec is best on both datasets, cutting error by about 11.5% in New York and 5.7% in Singapore versus the next-best method.

Efficiency is mixed. Total one-time preprocessing plus training is actually higher than baselines at about 510 minutes versus 250 to 480 minutes. But per-object encoding stays stable as vertex count grows, and for the most complex polygons it is reported as up to about 77% and 94% faster than the two closest competitors, while the histogram method remains fastest per polygon. Ablations on New York show every piece helps, with boundary-aware pooling, multi-view aggregation, and the extra occupancy and boundary fields hurting most — around 10-11% on hard polygon pairs — when removed.

Limitations to keep in mind: evaluation is only on two cities and three tasks with one classifier and regressor setup, no confidence intervals or statistical tests are reported, and some baseline hybrids are omitted for consistency. The runtime comparison mixes one-time training cost with per-object inference cost, so the headline speedups apply to complex polygons specifically, not overall training.

Why this might matter to me

If you care about spatial reasoning in language and vision models, this is a concrete pattern for grounding relations like touching, inside, and overlapping without handing the model raw coordinates every time. A fixed vector that already emphasizes edge contact could plug into retrieval, question answering, or map-aware chat where small boundary differences change the answer.

If you care about world models, the lesson is to allocate sensing where interaction happens. Just as a robot world model should sample contact surfaces more densely than empty air, SpatialVec samples edges more than empty space, while keeping interior and far-field samples so distance and containment are still recoverable.

If you care about text-to-CAD and parametric geometry, the three-field trick maps well: continuous distance for smooth optimization, occupancy for solid versus void, and an explicit boundary flag for sharp transitions that sketches and extrusions depend on. Training a latent code to reconstruct all three could help preserve holes, thin walls, and touching parts that pure global shape codes blur.

If you care about 3D generation and scene representation, this reads like a 2D cousin of signed distance plus occupancy networks with edge-aware sampling. The multi-view pooling — global average, max, boundary-attended, and distance-banded summaries — suggests a way to make NeRF-like or 3D occupancy latents more sensitive to contact and intersection without exploding sample counts everywhere.

Terms worth knowing