Conceptio › Archive › arXiv CS
arXiv CS open access

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

Samya Acharja et al. · arxiv_cs
arXiv CS · Papers
Open Source ↗Direct PDF ↓
data-managementdatabasessqlstorage
Spatial representation learning is essential for Geospatial Artificial Intelligence (GeoAI) applications, enabling machine learning models to capture the geometry, location, and spatial relationships of geographic entities such as points, polylines, and polygons. Existing spatial encoding methods of
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

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

arXiv:2611.00111v1 [cs.CV] 28 Oct 2026

Accepted to 2026 IEEE International Conference on Big Data Samya Acharja

Kanchan Chowdhury

Marquette University Milwaukee, USA samya.acharja@marquette.edu

Marquette University Milwaukee, USA kanchan.chowdhury@marquette.edu

Abstract—Spatial representation learning is essential for Geospatial Artificial Intelligence (GeoAI) applications, enabling machine learning models to capture the geometry, location, and spatial relationships of geographic entities such as points, polylines, and polygons. Existing spatial encoding methods often struggle to preserve fine-grained topological information, particularly for interactions involving complex geometries such as polylines and polygons. These approaches inadequately capture boundary structure and local spatial context, causing topologysensitive relationships near geometry boundaries to be underrepresented in the learned embedding space. Consequently, accurately modeling complex spatial interactions remains a significant challenge for downstream spatial reasoning tasks. To fill the gap, we introduce SpatialVec, a boundary-aware spatial representation learning framework that adaptively samples geometry boundaries and their surrounding regions, capturing fine-grained geometric structures critical for topology-aware spatial reasoning. A transformer-based encoder-decoder trained through geometry reconstruction produces compact, geometryaware, and unified representations for points, polylines, and polygons. Empirical evaluation on two real-world datasets shows that SpatialVec substantially improves the preservation of challenging topological relationships involving polygonal interactions and outperforms state-of-the-art baselines significantly on downstream prediction and classification tasks.

I. I NTRODUCTION Spatial representation learning has become an important foundation for Geospatial Artificial Intelligence (GeoAI). Many GeoAI applications require machine learning models to reason over geographic entities represented as points, polylines, and polygons. Unlike images or text, these objects carry geometric structure, absolute location, scale, orientation, and relationships with neighboring entities. A useful spatial representation must therefore retain this information to support tasks such as urban analysis, transportation modeling, environmental monitoring, and spatial search [1]–[6]. Several methods have been developed to encode spatial objects into fixed-dimensional vectors. Histogram-based spatial embeddings [7] summarize the distribution of spatial data for downstream learning and query optimization. Poly2Vec [8] provides a unified encoder for points, polylines, and polygons by representing geometric components in the Fourier domain

[8]. Geo2Vec [9] instead samples a signed distance field around each object and learns a representation that captures shape and location. These methods show that spatial embeddings can replace raw coordinates in several downstream tasks providing a common interface for machine learning models. However, accurately preserving spatial relationships between geometries remains difficult. Topological relationships such as touching, intersection, overlap, and containment are often determined by small regions where two boundaries meet or pass close to one another. Representations based mainly on global statistics [7] or frequency-domain summaries [8] may retain the overall geometry while weakening these local interactions. The most recent method Geo2Vec [9] captures finegrained geometric information utilizing a signed distance field but fails to explicitly model detailed interactions along object boundaries. Existing representations still struggle to model polyline–polygon and polygon–polygon relationships, which require local boundary behavior and global spatial context to be captured simultaneously. Developing a unified representation for heterogeneous spatial objects raises three technical challenges. First, the sampling process must capture narrow boundary interactions without losing coverage of interiors and outer space. Second, the same encoder must handle points, polylines, and polygons, although these geometry types differ in dimensionality and interior structure. Third, while canonical normalization is needed to compare geometric shape across objects, it removes absolute size and location information that is required for metric and range-based reasoning. To address these challenges, we propose S PATIALV EC, a unified representation learning framework for heterogeneous spatial objects. SpatialVec first maps each object into a canonical geometry space while retaining its original metadata and location features. It then applies a boundary-aware sampling strategy, allocating a larger share of the sampling budget to topology-sensitive boundary regions of an object while retaining complementary samples from polygon interiors and the outer-space. At each sampled location, the framework evaluates three complementary geometric fields: an SDF that measures the location’s distance from the object, an occupancy

field that indicates whether it belongs to or lies near the object, and a boundary field that identifies locations close to the object’s boundary. A Transformer encoder processes these geometric observations and combines global, boundaryfocused, and distance-aware information into a compact spatial representation of the object. During training, a reconstruction decoder uses this representation to recover the geometric information observed at the sampled locations, encouraging the learned representation to preserve both overall shape and fine-grained boundary structure to retain both broad geometric structure and local boundary evidence. The learned code is finally combined with normalized metadata and originallocation encoding to form the SpatialVec embedding. SpatialVec achieves the best topological classification accuracy across all evaluated geometry pairs, improving the accuracy by up to 22.9%. It also reduces the distance-estimation error by 15.4 − 59.7% across real-world geospatial datasets. The largest gains are observed for the more challenging polyline– polygon and polygon–polygon relationships, and these results indicate that preserving boundary-localized evidence together with geometry and original spatial context is particularly important for reasoning over heterogeneous spatial objects. The main contributions of this work are as follows: • We introduce a unified implicit-field representation for points, polylines, and polygons that combines signed distance, occupancy, and boundary observations within a common encoding framework. • We develop a boundary-aware sampling strategy that concentrates observations near topology-sensitive boundaries while retaining coverage of polygon interiors and outerspace. • We design a Transformer-based encoder with global, boundary-aware, and distance-aware aggregation, together with a self-supervised decoder that reconstructs the sampled spatial fields. • We evaluate SpatialVec on two real-world geospatial datasets across topological relationship classification, distance estimation, and range-query prediction, demonstrating consistent improvements over existing spatial representation methods. II. P RELIMINARIES Definition 1 (Spatial Object): A spatial object E is a geographic entity represented in a two-dimensional space. Its geometry is described by a sequence of N point coordinates {p1 , p2 , ..., pN }, where each point pi = (xi , yi ) ∈ R2 . Definition 2 (Canonical Geometry Space): The canonical geometry space is a normalized coordinate system used to represent spatial objects independently of their original position and scale. Given the centroid cE of an object E and the diagonal length dE of its bounding box, each coordinate pi is transformed as pi − cE ei = , p max(dE , ϵ) where ϵ is a small constant that prevents division by zero. This transformation centers the object at the origin and places ge-

ometries of different sizes in a common scale while preserving their relative shape and orientation. Definition 3 (Signed Distance Function (SDF) Field): Given e and a query point q ∈ R2 , the a canonical spatial object E e If the SDF field ϕE (q) measures the distance from q to E. e is a polygon, object E ( e e −d(q, ∂ E), q lies inside E, ϕE (q) = e e +d(q, ∂ E), q lies outside E, e denotes the set of points on the boundary E e and where ∂ E e = min d(q, ∂ E) ∥q−p∥ denotes the Euclidean distance 2 e p∈∂ E e If the object E e is from q to the closest point in the set ∂ E. e a point or polyline, ϕE (q) = +d(q, ∂ E) since points and polylines do not have interior regions. Definition 4 (Occupancy and Boundary Fields): The occupancy field shows whether a query point is part of, or very close to, a spatial object. For a polygon, ( e 1, q is inside E, oE (q) = e 0, q is outside E. Since points and polylines do not have an interior, a query point is considered occupied when its distance from the object is smaller than a threshold τo : ( 1, ϕE (q) ≤ τo , oE (q) = 0, ϕE (q) > τo . The boundary field shows whether a query point lies on or near the object’s boundary: ( 1, |ϕE (q)| ≤ τb , bE (q) = 0, |ϕE (q)| > τb , where τo and τb are predefined distance thresholds. Definition 5 (Implicit Spatial Field): Given a canonical e and a query point q ∈ R2 , the implicit spatial spatial object E field is defined as ΨE (q) = [ϕE (q), oE (q), bE (q)] . It represents the geometry of E through three field values evaluated at spatial query locations. Definition 6 (Spatial Embedding Learning): Given a collection of spatial objects G = {Ej }M j=1 , spatial embedding learning aims to learn a mapping Fθ : E → eE ∈ Rd , where eE is a fixed-dimensional representation of object E. In SpatialVec, the embedding is learned from sampled distance, occupancy, and boundary fields together with the object’s spatial information. The same mapping is used for points, polylines, and polygons, allowing different geometry types to be represented in a common embedding space. III. M ETHODOLOGY Given a spatial object E, SpatialVec first maps it to the canonical space while retaining metadata and original-location information. After the mapping, SpatialVec applies Adaptive Boundary-Aware Sampling, where the number and distribution

SpatialVec Encoder 1

2

Spatial Object E

3

Canonical Normalization & Metadata Extraction

4

Boundary-Aware Sampling

6

5

Implicit Field Construction

7

Input Representation and Tokenization

Spatial Field Encoder

Multi-View Feature Aggregation

CLS

Transformer Encoder Layer 1

Transformer Encoder Layer 2

Transformer Encoder Layer 3

⋮

Transformer Encoder Layer 6

..

...

Ground Truth 8

9

Spatial Embedding Construction

10

Downstream Tasks

Reconstruction Decoder Decoder MLP

Training Objective

Distance

Occupancy logit

• • •

Weighted Smooth-L1 BCE (occupancy) BCE(boundary)

Boundary logit

Fig. 1. End-to-end data flow and architecture of SpatialVec framework.

of sampled points are determined by the geometric characteristics of each object, with greater emphasis on boundary regions while retaining coverage of polygon interiors and the surrounding space. After the sampling, SpatialVec Encoder encodes each sampled point to a geometry code zE , which is a compact representation of the spatial object that summarizes the information captured from the sampled points, including its overall geometry, boundary structure, and spatial characteristics. During training, the Reconstruction Decoder uses the encoded representation to recover the spatial information associated with the sampled points. Finally, zE is combined with metadata and location features to form the SpatialVec embedding eE . Fig. 1 illustrates the end-to-end data flow and architecture of SpatialVec. As mentioned earlier in this section, before sampling, each e spatial object E is transformed into its canonical form E. During this mapping, SpatialVec also retains a 17-dimensional metadata vector mE computed from the original geometry. Here, metadata refers to object-level attributes that describe what type of geometry the object is, where it is located, how large it is, and its overall shape. Specifically, mE contains

three geometry-type indicators, six centroid and boundingbox coordinates, five size-related features comprising width, height, bounding-box diagonal, log-transformed area, and logtransformed length, and three shape descriptors: aspect ratio, fill ratio, and compactness. The rest of this section describes each component of the our methodology in detail. A. Adaptive Boundary-Aware Sampling SpatialVec samples query points directly in the canonical geometry space. Because each object has already been centered and scaled, geometric properties used by the sampler are measured in the same normalized coordinate system. Rather than assigning the same number of query points to every object, SpatialVec determines an object-specific sampling budget e Objects with longer boundaries NE from the geometry of E. receive additional boundary observations, while polygons with larger interiors receive additional interior observations. The value of NE therefore varies across objects, while Nmin and Nmax only specify the allowable lower and upper limits of the sampling budget. The resulting object-specific budget is then distributed among the boundary region, polygon interior, and

outer-space. The sampling budget is adapted to the geometry of each object. Let ℓE denote the canonical boundary length for polygons, the canonical line length for polylines, and 0 for points. Also, let AE denote the canonical polygon area and is set to 0 for non-polygon geometries, while δE = 1 for e we define polygons and 0 otherwise. For a canonical object E, n n l NE = min Nmax , max Nmin , N0 (1 + λℓ ℓE moo (1) p . +λa δE AE ) Let Wbnd and Wint denote the sampling weights assigned to boundary and interior, respectively. The value of Wint is set e is a polygon. The numbers of to 0 if the canonical object E samples for boundary (Nbnd ), interior (Nint ), and outer-space region (Nspace ) are calculated as: Nbnd = ⌊Wbnd NE ⌋ ,

Nint = ⌊Wint NE ⌋ ,

Nspace = NE − Nbnd − Nint ,

Algorithm 1: Boundary-Aware Sampling Objective: Generate an object-adaptive set of query points with increased coverage near geometrically informative regions e minimum and Input: Canonical spatial object E; maximum budgets Nmin , Nmax Output: Sampled implicit-field representation SE e 1 ℓE ← Canonical length of E; e 2 if E is a polygon then e 3 AE ← area of E; 4 δE ← 1; 5 else 6 AE ← 0; 7 δE ← 0; 8

(2)

NE ←  √  min Nmax , max Nmin , N0 1 + λℓ ℓE + λa δE AE ;

wbnd ← 1 + λb ℓE ;√  w int ← δE 1 + λi AE ; Algorithm 1 summarizes the boundary-aware sampling pro11 wspace ← 1; cedure. First, SpatialVec computes the geometric properties int + wspace ; e including its canonical length and 12 W ← wbnd  + wwbnd of the canonical object E, 13 Nbnd ← NE W   ; polygon area when applicable (lines 1–7). These properties wint 14 Nint ← NE W ; are used to determine the object-specific sampling budget 15 Nspace ← NE − Nbnd − Nint ; NE according to Eq. (1) (line 8). The total budget is then e distributed among the boundary, interior, and outer-space 16 Qbnd ← SampleBoundary(E, Nbnd ); e regions. The corresponding sampling weights are computed 17 if E is a polygon then e Nint ); Qint ← SampleInterior(E, in lines 9–12, and the resulting values of Nbnd , Nint , and 18 Nspace are obtained in lines 13–15 according to Eq. (2). 19 else e Nbnd ) in line 16 samples 20 Qint ← ∅; The function SampleBoundary(E, e Nbnd points from the boundary region of the object E. 21 Qspace ← SampleOuterSpace(Nspace ); This sampling procedure is detailed in Section III-A1. For 22 QE ← Qbnd ∪ Qint ∪ Qspace ; e Nint ) in lines 17– polygon geometries, SampleInterior(E, 23 QE ← Shuffle(QE ); 20 samples Nint points from the polygon interior, whereas 24 return QE ; points and polylines receive no interior samples. Similarly the function SampleOuterSpace(Nspace ) in line 21 samples Nspace points from the surrounding canonical space. The func  tions SampleInterior and SampleOuterSpace are detailed cos θ ek+1 + r T = (1 − f )e xk + f x , (4) in Section III-A2. The boundary, interior, and outer-space sin θ samples are then combined to form QE (line 22) and randomly where f ∼ U (0, 1) determines the position on the segment, shuffled (line 23). θ ∼ U (0, 2π) determines the offset direction, and r ∈ 1) Boundary Sampling The number of boundary samples Nbnd is determined by {0, 0.004, 0.012, 0.03, 0.075} specifies the offset distance. The the adaptive allocation in Eq. (2). For a polygon or poly- value r = 0 produces samples directly on the boundary, while line, a boundary segment is selected according to its length. the remaining values create several outer layers at increasing If the canonical boundary contains segments with lengths distances. This provides dense observations of the region in which the implicit field changes most rapidly. For a point ℓ1 , . . . , ℓK , segment k is selected with probability geometry, samples are instead drawn around the canonical ℓk . (3) origin using radii {0.004, 0.012, 0.03, 0.075, 0.18}. Pr(k) = PK j=1 ℓj 2) Interior and Outer-Space Sampling This gives longer segments proportionally more samples and In the case of interior sampling, points and polylines reavoids making the sampling distribution depend on the number ceive no interior samples because they do not have a twoof vertices. After selecting a segment, points are sampled dimensional interior region. For polygons, candidate points uniformly along it, ensuring that its distance from the line are sampled independently and uniformly within the minimum segment is ≤ τb . The samll offset between two consecutive and maximum coordinate ranges of the canonical bounding samples is defined as: box. Each candidate point is then evaluated using a point9

10

in-polygon test, and retained only if it is located inside the polygon, and distance from the polygon boundary is > τb . This process is repeated until the required number of interior samples (Nint ) is obtained. For outer-space sampling, candidate points are sampled independently and uniformly over the corresponding horizontal and vertical extents of the surrounding canonical space. Thus, each location within this sampling region has an equal probability of being selected. If the object is a polygon, pointin-polygon test ensures that the candidate point is outside the polygon. Similarly to the interior sampling, a candidate point is retained only if the distance from the object boundary is > τb . The sampling is repeated until the required number of outer-space samples (Nspace ) is obtained. B. Unified Implicit-Field Representation After boundary-aware sampling, SpatialVec represents each sampled location using multiple complementary descriptions of the underlying geometry. Rather than relying only on the SDF value, SpatialVec jointly uses the three fields defined in Section II: the SDF field, occupancy field, and boundary field. Each field captures a different aspect of the spatial object. The SDF field describes how far the sampled point is from the object and whether the point is inside or outside the object in case of a polygon, providing continuous information about its geometric structure. The occupancy field provides information about whether the sampled location belongs to or lies close to the object, helping characterize its spatial extent. The boundary field explicitly identifies locations near the object boundary, where small geometric changes are particularly important for distinguishing spatial relationships. By combining these three complementary sources of information, SpatialVec captures both the overall structure of an object and finegrained information around its boundary. Given the sampled E locations QE = {qi }N i=1 , the resulting unified implicit-field representation is N

E SE = {(qi , ϕE (qi ), oE (qi ), bE (qi ))}i=1 .

(5)

This representation provides the same input form for points, polylines, and polygons despite their different geometric structures. Therefore, SpatialVec does not require a separate representation scheme for each geometry type. The unified implicitfield representation SE is subsequently converted into input tokens and processed by the SpatialVec encoder. C. SpatialVec Encoder The SpatialVec encoder converts the sampled implicit-field observations through three main stages. First, Input Representation and Tokenization combines Fourier-encoded canonical coordinates with the corresponding distance, occupancy, boundary, and distance-band values, together with metadata and original-location information. Next, Transformer-Based Spatial Field Encoding processes the query-point tokens using self-attention, while a learnable CLS token aggregates information across the sampled locations. Finally, Multi-View Feature Aggregation summarizes the contextualized representa-

tions using global, boundary-aware, and distance-aware views. These complementary views are fused to produce the 256dimensional geometry code zE which compactly summarizes the spatial characteristics of the object. 1) Input Representation and Tokenization The sampled query points and their associated field values are converted into a sequence of input tokens for the encoder. Each token represents one query point and combines its canonical location with the corresponding distance, occupancy, and boundary information. Multi-frequency Coordinate Encoding. To capture spatial patterns at different scales, the canonical coordinates of each sampled point are represented using multiple Fourier frequencies. Let qi = (xqi , yiq ) denote the canonical coordinates of sampled point i, and let F = {1, 2, 4, 8, 16, 32, 64, 128} denote the set of eight frequency levels. The coordinate encoding is defined as h i  γ(qi ) = qi ∥ sin(πf qi ) ∥ cos(πf qi ) f ∈F . (6) For each f ∈ F , the frequency f is multiplied by both coordinates of qi , giving f qi = (f ·xqi , f ·yiq ), and the sine and cosine functions are applied separately to both coordinates. Lower frequencies capture broader spatial variations, while higher frequencies capture finer geometric variations. Together with the original two-dimensional coordinates, these features form the 34-dimensional coordinate representation γ(qi ). Field-token Construction. The coordinate encoding is combined with the previously computed implicit field values. Each query point is also assigned to one of three distance bands: near, middle, or far. The token for query point qi is constructed as   ti = γ(qi )∥ϕE (qi )∥oE (qi )∥bE (qi )∥ band ϕE (qi ) . (7) Here, band(ϕE (qi )) is a three-dimensional one-hot vector that indicates whether the sampled point lies in the near, middle, or far distance band, using thresholds of 0.06 and 0.22. The resulting token is ti ∈ R40 . Each 40-dimensional token is then projected to the model dimension of 256 using a linear layer, GELU activation, and layer normalization. The field values are included in the encoder input so that each token contains both the spatial location of the sampled point and the geometric information observed at that location. Metadata and Location Integration. Object-level metadata and original-location information are added to the 256dimensional representation of each field token before Transformer encoding. In parallel, the centroid and bounding-box features are transformed using a multi-frequency location encoding and projected through a separate MLP. These two global representations are added to every point token: hi = TokenProj(ti ) + MetaEnc(mE ) + LocEnc(sE ). (8) Here, TokenProj is a linear projection followed by GELU activation and layer normalization that maps ti ∈ R40 to a 256dimensional vector. MetaEnc applies the same sequence of operations to the 17-dimensional metadata vector. LocEnc first

applies multi-frequency Fourier encoding to the six originallocation features and then maps them to 256 dimensions using a two-layer MLP. Their sum, hi ∈ R256 , is the point representation passed to the Transformer encoder. This allows every token to retain its local field information while also receiving information about the geometry type, size, and original spatial location. Set-based Representation. The sampled query points form an unordered set. Therefore, no sequential position encoding is added to the token sequence. The location of each point is already represented by its Fourier-encoded coordinates. Consequently, changing the order of the sampled points does not change the geometry being represented. Finally, a learnable classification token is prepended to the point-token sequence before it is passed to the Transformer encoder. 2) Transformer-Based Spatial Field Encoding A learnable CLS token is prepended to the point representations h1 , . . . , hNE , and the resulting sequence is processed by a six-layer Transformer encoder. Each layer uses a hidden dimension of 256, eight attention heads, a feed-forward dimension of 1,024, GELU activation, pre-normalization, and a dropout rate of 0.1. In each layer, self-attention updates every point token using information from the CLS token and all other point tokens. Therefore, each point representation retains its local field information while also incorporating the spatial context of the remaining sampled locations. The CLS token is updated in the same way and aggregates information from all point tokens. After six layers, the encoder outputs contextualized point representations and a contextualized CLS representation, which are used for Multi-View Feature Aggregation. 3) Multi-View Feature Aggregation Although the number of sampled points NE varies across objects, the aggregation operations convert these variable-size token sets into fixed-dimensional representations. SpatialVec converts these outputs into fixed-size summaries using nine views: the CLS vector, mean and max pooling over all point vectors, attention-based boundary pooling, mean pooling over transformed boundary vectors, mean pooling over the middleand far-distance bands, the metadata vector, and the originallocation vector. These nine vectors are concatenated and passed through a fusion MLP:  uE = vcls ∥vmean ∥vmax ∥vbattn  (9) ∥vbnd ∥vmid ∥vfar ∥vmeta ∥vloc , zE = Fuse(uE ) ∈ R256 .

(10)

Here, vcls is the contextualized CLS representation, vmean and vmax are the mean- and max-pooled point representations, and vbattn is the attention-weighted boundary representation. The vector vbnd is obtained by mean pooling the transformed boundary-point representations, while vmid and vfar summarize the middle- and far-distance bands, respectively. Finally, vmeta and vloc denote the encoded metadata and original-location representations. Their concatenation forms

uE ∈ R2304 , and Fuse denotes the fusion MLP that maps uE to the geometry code zE ∈ R256 . The resulting geometry code contains object-level, boundary, distance-band, metadata, and location information. D. Reconstruction Decoder The reconstruction decoder uses the geometry code and the contextualized representation of each query point to recover the sampled spatial fields. For every query point, its encoder representation is concatenated with the global geometry code and passed through a two-layer MLP. Three prediction heads then estimate the implicit distance, occupancy, and boundary values. By reconstructing these fields at all sampled locations, the decoder provides the self-supervised training signal for the encoder. The distance loss is weighted more heavily near the boundary, while occupancy and boundary prediction are trained using binary cross-entropy. Together, these objectives encourage the geometry code to preserve both the overall spatial structure and the fine boundary details of the object. 1) Implicit Field Reconstruction and Training Objective Let pi ∈ R256 denote the contextualized encoder representation of query point qi . The geometry code zE is concatenated with each point representation and processed by a two-layer reconstruction MLP, giving di = Dec(pi ∥zE ). Three linear heads use di to predict the implicit distance ϕ̂i , occupancy logit aoi , and boundary logit abi . The occupancy and boundary probabilities are obtained by applying the sigmoid function to their logits. To emphasize samples near the geometry boundary, the distance loss assigns the following weight to query point qi :   1 , 10 . (11) wi = min |ϕE (qi )| + 0.02 When the inverse-distance weight becomes greater than 10, a small number of samples extremely close to the boundary can contribute disproportionately to the loss and dominate the optimization, reducing the influence of the remaining samples. We therefore set the upper bound to 10, which limits the contribution of any individual sample to at most ten times the base weight. This value provides strong emphasis to near-boundary regions while keeping their influence within one order of magnitude and maintaining a balanced training objective. The SDF field prediction is trained using weighted Smooth-L1 loss, while occupancy and boundary prediction use binary cross-entropy with logits:   PN i=1 wi SmoothL1 ϕ̂i , ϕE (qi ) Lsdf = , PN i=1 wi N 1 X (12) Locc = BCE (aoi , oE (qi )) , N i=1 Lbnd =

N  1 X BCE abi , bE (qi ) . N i=1

Here, Lsdf, Locc, and Lbnd denote the signed distance field, occupancy, and boundary reconstruction losses, respectively.

A small L2 penalty on zE limits the magnitude of the geometry code. The total training objective is L = Lsdf + 0.55 Locc

+0.70 Lbnd + 10−4 ∥zE ∥22 .

(13)

E. Spatial Embedding Construction After encoding, SpatialVec forms the final embedding eE by concatenating the learned geometry code with the normalized metadata and the Fourier encoding of the original centroid and bounding-box features: e E ∥ γloc (sE )] ∈ R477 , eE = [zE ∥ m 256

(14)

17

e E ∈ R is the norwhere zE ∈ R is the geometry code, m malized metadata vector, and γloc (sE ) ∈ R204 is the Fourier encoding of the six centroid and bounding-box features. Thus, the final embedding eE has 256+17+204 = 477 dimensions. The geometry code represents the sampled implicit field, while the metadata and location components retain the geometry type, size, and original spatial position. IV. E XPERIMENTAL E VALUATION We evaluate SpatialVec by addressing the following research questions. RQ1: How effectively do SpatialVec embeddings preserve geometric relationships, relative spatial distances, and spatial location and distribution information? RQ2: What is the computational efficiency of SpatialVec’s embeddinggeneration process compared with existing methods? RQ3: How do the key components of SpatialVec contribute to the quality of the learned spatial embeddings? Training Configuration. The embedding model is trained for 30 epochs using the AdamW optimizer with a learning rate of 3 × 10−4 , weight decay of 10−4 , and a batch size of 32. A. Datasets We use two real-world geospatial datasets from the recent work [8], NYC and Singapore, both derived from OpenStreetMap [1]. Each dataset contains point, polyline, and polygon geometries and is used to evaluate whether the learned embeddings capture geometric and spatial information effectively in downstream GeoAI tasks. NYC. The NYC dataset covers New York City and contains 14,943 points of interest, 139,512 road geometries, and 1,153,008 building geometries. Singapore. The Singapore dataset contains 4,347 points of interest, 45,634 road geometries, and 109,877 building geometries from the Singapore region. B. Baselines We compare SpatialVec with the following spatial representation learning methods: THEORY. THEORY [10] learns spatial embedding by encoding the spatial distribution and relationships of geo-entities. Hist2Vec. Hist2Vec [7] represents spatial data using multiresolution histogram features and learns fixed-dimensional embeddings through an unsupervised autoencoder.

Poly2Vec. Poly2Vec [8] provides a unified representation for point, polyline, and polygon geometries using a Fourier-based polymorphic encoder. Geo2Vec. Geo2Vec [9] represents heterogeneous spatial objects through sampled implicit SDF field and learns fixeddimensional embeddings that capture shape, location, and spatial relationships. We also include several geometry-specific encoders as baselines. For point objects, DIRECT [11] uses the original coordinates directly, TILE [12] partitions the spatial domain into discrete cells and represents each location through a tile embedding, WARP [13] applies a coordinate-wrapping mechanism, and GRID [14] uses multi-scale positional encoding to represent spatial locations. 1) Topological Relationship Classification In this evaluation, a downstream classifier receives the embeddings of two spatial objects and predicts their topological relationship such as disjoint, touching, overlap, containment, and intersection. We use Pt, Pl, and Pg to denote point, polyline, and polygon geometries, respectively. Following the established evaluation protocol, we consider five geometrypair settings: Pt–Pl, Pt–Pg, Pl–Pl, Pl–Pg, and Pg–Pg. The Pt–Pl, Pt–Pg, and Pl–Pl settings are formulated as binary classification tasks, whereas Pl–Pg and Pg–Pg contain multiple topological relationship classes. All embedding methods are evaluated using the same training and test samples and the same downstream classifier configuration. We report the topological classification accuracy results in Table I. C. Effectiveness in Spatial Reasoning Tasks To address RQ1, we evaluate the quality of the learned embeddings through three spatial reasoning tasks: topological relationship classification, distance estimation, and rangequery’s selectivity prediction. For topological relationship classification and distance estimation, we follow the evaluation protocol established by prior spatial representation learning methods, including Poly2Vec and Geo2Vec. Specifically, we use the same NYC and Singapore datasets, the same geometry-pair categories, and the same downstream task formulations to ensure a controlled and directly comparable evaluation. Only the input object representations are replaced by the embeddings generated by each evaluated method. As introduced in Definition II, the occupancy and boundary thresholds are set to τo = τb = 0.025 in the canonical coordinate space and are kept fixed for all experiments. Values of parameters Nmin and Nmax are set to 512 and 2048, respectively. Table I shows that SpatialVec achieves the best or tied-best accuracy across all ten settings. The gains are modest for the simpler binary tasks, where several methods already approach ceiling performance, but become clearer for the more difficult Pl–Pg and Pg–Pg settings. Relative to the strongest baseline, SpatialVec improves Pl–Pg accuracy by 4.9% in Singapore and 19.4% in NYC. For Pg–Pg, the relative gains increase to 6.7% and 22.9%, respectively, showing a larger advantage when the relationship depends on detailed interactions between

TABLE I M ODEL ACCURACY ON TOPOLOGICAL RELATIONSHIP CLASSIFICATION . A LL VALUES ARE SCALED BY ×10−2 .

Singapore Method

NYC

Pt–Pl↑ Pt–Pg↑ Pl–Pl↑ Pl–Pg↑ Pg–Pg↑ Pt–Pl↑ Pt–Pg↑ Pl–Pl↑ Pl–Pg↑ Pg–Pg↑

DIRECT TILE WARP GRID THEORY Hist2Vec Poly2Vec Geo2Vec

82 79 88 84 89 89 95 98

84 70 88 84 90 62 94 96

73 50 71 69 71 94 81 96

36 45 47 45 45 44 50 61

35 41 47 45 45 47 70 75

84 65 88 82 89 91 95 98

90 78 88 89 90 62 98 99

74 50 73 73 73 94 83 98

49 49 55 51 59 44 64 67

44 40 38 38 45 47 68 70

SpatialVec

98

98

97

64

80

99

99

98

80

86

extended geometries. These results suggest that SpatialVec retains finer local geometric information than the competing representations. THEORY mainly captures spatial position, while Hist2Vec aggregates geometry into histogram statistics, which can weaken local boundary details. Poly2Vec preserves global shape through frequency-domain features, but close boundary interactions may be less explicit. Geo2Vec performs better than most baselines because it uses an implicit SDF field. Geo2Vec performs better than most baselines because it uses an implicit distance field. SpatialVec performs the best by coupling boundary-aware sampling with an encoder-decoder objective that compresses distance, occupancy, and boundary fields into a shared spatial representation and reconstructs them during encoding. 1) Distance Estimation A regression model receives the embeddings of two spatial objects and predicts their ground-truth spatial distance. Because the prediction is made without directly accessing their coordinates, a lower estimation error indicates that the embeddings preserve the relative spatial distance between the objects. We follow the same dataset construction and geometry-pair definitions used in the prior evaluation protocol. The experiments include Pt–Pl, Pt–Pg, Pl–Pl, Pl–Pg, and Pg– Pg pairs, and all representation methods are evaluated using identical training and test splits and the same regression model. Several baselines [14]–[16] in Table I are designed for a single geometry family, so applying them would require combining different encoders or changing the original method. We omit such hybrid variants [11]–[13] to keep the distance comparison consistent with the published setups. Mean absolute error (MAE) is used as the evaluation metric, where a lower value indicates better preservation of distance information. The results are reported in Table II. Table II shows that SpatialVec achieves the lowest MAE in all six settings. Relative to Geo2Vec, the strongest baseline, it reduces the estimation error by 18.8%, 15.4%, and 16.7% on the Singapore Pg–Pt, Pl–Pg, and Pg–Pg settings, respectively. The corresponding reductions on NYC are 41.1%, 59.7%, and 52.4%. The largest gain is observed for NYC Pl–Pg, where SpatialVec lowers the MAE by approximately 59.7%. This improvement proves SpatialVec’s ability to preserve

TABLE II C OMPARING MAE ON DISTANCE ESTIMATION . A LL MAE VALUES ARE SCALED BY ×10−3 . Singapore

NYC

Method

Pg–Pt↓

Pl–Pg↓

Pg–Pg↓

Pg–Pt↓

Pl–Pg↓

Pg–Pg↓

TILE THEORY Hist2Vec Poly2Vec Geo2Vec SpatialVec

99.9 24.30 16.20 13.10 6.40 5.20

115.5 25.00 22.47 21.00 13.00 11.00

114.3 25.00 30.31 15.00 5.40 4.50

127.6 26.20 21.80 28.07 10.20 6.01

154.3 26.60 27.42 28.05 13.00 5.24

167.4 27.40 32.44 52.70 12.09 5.75

the relative distances between spatial objects. THEORY and Hist2Vec mainly capture spatial distributions, while Poly2Vec emphasizes global frequency-domain structure, making precise object-to-object separation harder to recover. Geo2Vec performs considerably better because its SDF field directly represents geometric proximity. SpatialVec further combines distance, occupancy, and boundary fields with boundaryfocused sampling, allowing the embeddings to retain both the objects’ extent and the local regions that determine their minimum separation. 2) Range-Query Selectivity Prediction A range query retrieves all spatial objects from a dataset whose geometries intersect a specified query window. Following the range-query evaluation setting, we predict the selectivity of a given query window, defined as the fraction of objects in the dataset that intersect the window. The downstream model receives the spatial representation of the input data together with the query-window information and predicts the corresponding range-query selectivity. To provide a controlled comparison, all methods use the same datasets, query windows, training and test splits, and downstream prediction setting. We evaluate the predicted selectivity using weighted mean absolute percentage error (WMAPE), where a lower value indicates better performance. The results are presented in Table III. Table III shows that SpatialVec achieves the lowest WMAPE on both datasets. Compared with the strongest competing method, SpatialVec reduces the prediction error by approximately 11.5% on NYC and 5.7% on Singapore.

TABLE III C OMPARING WMAE ON RANGE - QUERY ’ S SELECTIVITY PREDICTION .

NYC↓

Singapore↓

Hist2Vec Poly2Vec Geo2Vec SpatialVec

0.4448 0.4430 0.4562 0.3919

0.2931 0.3130 0.3523 0.2765

Hist2Vec

TABLE IV C OMPARING EMBEDDING PREPROCESSING AND TRAINING LATENCY.

Method Hist2Vec Poly2Vec Geo2Vec SpatialVec

250.00 min 300 min 473.4 min 507.6 min

250.3 min 300.01 min 479.8 min 510.00 min

3) Computational Efficiency To address RQ2, we evaluate the runtime required to generate spatial embeddings and examine how it changes with geometric complexity. Table IV compares the embedding generation time of SpatialVec with that of recent baselines which are competitive in prediction and classification tasks. Although SpatialVec requires more runtime than the baselines, these baselines showed significantly poorer performance in downstream prediction and classification tasks. Since the embedding generation latency is a one-time cost, the superior performance in downstream tasks outweighs the onetime runtime cost. Fig. 2 further evaluates embedding-generation efficiency by examining how runtime changes as polygon complexity increases. While Hist2Vec is the fastest for each polygon complexity, SpatialVec maintains relatively stable embeddinggeneration latency as polygon complexity increases. Its runtime grows only modestly across the three complexity groups, whereas Poly2Vec and Geo2Vec become substantially more expensive for complex polygons. For polygons in the highestcomplexity group, SpatialVec reduces latency by up to 76.7% and 93.8% relative to Poly2Vec and Geo2Vec, respectively. 4) Ablation Study To address RQ3, we conduct an ablation study that evaluates the effectiveness of various key components in our proposed embedding generation technique. We create multiple variants of SpatialVec by modifying or removing one component of SpatialVec at a time while keeping the remaining components unchanged. For the “w/o boundary-aware sampling” variant, we replace the proposed sampling strategy with simple uniform sampling over the canonical space. For the “w/o occupancy and boundary fields” variant, the occupancy and boundary values are removed from the implicit field representation while the SDF information is retained. For the “w/o metadata and location integration” variant, the metadata and original-location information are removed from the encoder input. For the “w/o boundary-aware pooling” variant, the boundary-specific pooling operation is removed while the

Geo2Vec

SpatialVec

101

100

10−1 ≤8

Preprocessing Time Training Time Total Time 0.3 min 0.1 min 6.4 min 2.4 min

Poly2Vec

102

Latency (ms)

Method

103

9–32

> 32

Number of Vertices Fig. 2. Embedding-generation latency with increasing polygon complexity on the NYC dataset. The y-axis uses a logarithmic scale. TABLE V ACCURACY ON TOPOLOGICAL RELATIONSHIP CLASSIFICATION ON NYC DATASET FOR S PATIALV EC VARIANTS . Variant

Pt–Pl

Pt–Pg

Pl–Pl

Pl–Pg

Full S PATIALV EC

99

99

98

80

Pg–Pg 86

w/o boundary-aware sampling w/o occupancy and boundary fields w/o metadata and location integration w/o boundary-aware pooling w/o multi-view aggregation

97 97 98 95 96

98 98 98 97 98

95 98 97 96 94

79 72 78 74 73

75 75 76 75 76

remaining aggregation views are retained. Finally, for the “w/o multi-view aggregation” variant, the proposed multiview aggregation is replaced with simple mean pooling over all encoded point representations, giving equal importance to samples from all spatial regions. Table V compares all these variants with full SpatialVec on topological classification task using NYC dataset, which shows that the full SpatialVec model achieves the best overall performance. The largest reduction in accuracy, approximately 5.4%, occurs when boundary-aware pooling or multi-view aggregation is removed, followed by removing the occupancy and boundary fields (4.8%), boundary-aware sampling (3.9%), and metadata and location integration (3.2%). The effects are most pronounced for Pg–Pg and Pg–Pl, where removing the occupancy and boundary fields reduces the mean accuracy by 11.4%, while removing boundary-aware pooling or multi-view aggregation reduces it by approximately 10.2%. These results highlight the importance of all the components of SpatialVec. V. R ELATED W ORK Graph-Based Spatial Representations. A major line of research in geospatial representation learning focuses on learning compact embeddings for locations, regions, and spatial graphs. PlaceField2BVec [17], Loc2Vec [18], and Region2Vec [19] learn representations from geographic context, spatial proximity, and interactions among predefined locations or regions. Graph-based representation learning methods node2vec [20] and LINE [21] similarly encode entities through graph connectivity and neighborhood structures. These approaches are particularly useful when geographic data can be naturally

represented as nodes, edges, or predefined regions. However, their representations cannot explicitly model continuous geometry of spatial objects, including their boundaries, shapes, interiors, and spatial extent, making them less suitable for geometry-sensitive spatial reasoning tasks. Trajectory-Based Spatial Representations. Another line of work learns spatial representations from movement and trajectory data. ST2Vec [22], contrastive trajectory similarity learning with dual-feature attention [23], and DeepMove [24] capture spatial and temporal dependencies from mobility traces. These methods have demonstrated strong performance in applications such as trajectory similarity estimation, mobility prediction, and next-location recommendation. While effective for sequential movement data, they are not designed to represent static geographic objects such as points, polylines, and polygons, which makes them orthogonal to our objectives. Geometry-Aware Spatial Representations. More recent spatial representation methods have increasingly focused on encoding the intrinsic geometry of spatial objects directly from their coordinate-based representations. Poly2Vec [8] encodes points, polylines, and polygons using multi-frequency Fourier features, while Geo2Vec [9] represents these geometries through sampled SDF field. Both retain overall object shape, but fine-scale boundary details and localized geometric variations receive limited emphasis in the learned representation. VI. C ONCLUSION In this paper, we propose SpatialVec, a unified spatial representation learning framework for point, polyline, and polygon geometries. SpatialVec combines canonical normalization, adaptive boundary-aware sampling, implicit spatial fields, and Transformer-based encoding and decoding to learn fixed-dimensional embeddings. Its boundary-aware sampling places more observations near geometric boundaries, while the distance, occupancy, and boundary fields jointly describe the shape and spatial extent of each object. Experiments on NYC and Singapore datasets demonstrate that SpatialVec’s embedding achieves strong performance on downstream geospatial tasks such as topological relationship classification, distance prediction, and range-query’s selectivity prediction and outperforms state-of-the-art baselines by upto 59.7%. The code and data are available at https://github.com/daiss-lab/SpatialVec. R EFERENCES [1] Y. Li, W. Huang, G. Cong, H. Wang, and Z. Wang, “Urban region representation learning with openstreetmap building footprints,” in Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2023, pp. 1363–1373. [2] S.-Y. Lai, T.-H. Hsieh, P.-C. Tsai, C.-C. Kung, S.-K. Ling, and H.-P. Hsieh, “M3: Recommendation via attention-graph cluster qlearning with multi-scale spatial heterogeneity for multi-purpose, multistakeholder green attractions in transportation,” in Proceedings of the 33rd ACM International Conference on Advances in Geographic Information Systems, 2025, pp. 39–51. [3] J. Peters, K. Mora, M. D. Mahecha, C. Ji, D. Montero, C. Mosig, and G. Kraemer, “Context-aware multimodal representation learning for spatio-temporally explicit environmental modelling,” arXiv preprint arXiv:2511.11706, 2025.

[4] T. Georgiadis, J. Pavlopoulos, and N. Mamoulis, “Sparagraph: Spatial reasoning using retrieval-augmented generation,” ACM Transactions on Spatial Algorithms and Systems, vol. 12, no. 3, pp. 1–31, 2026. [5] M. Saeedan, M. S. Rashid, A. Eldawy, and V. Hristidis, “Gsqa: A benchmark for geospatial question answering,” arXiv preprint arXiv:2605.22811, 2026. [6] S. P. Burns, M. Urban, J. S. Sedillo, R. Frediani, M. A. K. Samaun, J. Tomsicek, and R. Mendonca, “Community-engaged dissemination and implementation: restaurant accessibility for people with disabilities,” OTJR: Occupational Therapy Journal of Research, vol. 46, no. 2, pp. 231–239, 2026. [7] A. Belussi, S. Migliorini, and A. Eldawy, “A generic machine learning model for spatial query optimization based on spatial embeddings,” ACM Transactions on Spatial Algorithms and Systems, vol. 10, pp. 1–33, 2024. [8] M. Despoina Siampou, J. Li, J. Krumm, C. Shahabi, and H. Lu, “Poly2vec: Polymorphic fourier-based encoding of geospatial objects for geoai applications,” arXiv e-prints, pp. arXiv–2408, 2024. [9] C. Chu and C. Shahabi, “Geo2vec: Shape-and distance-aware neural representation of geospatial entities,” in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 40, no. 23, 2026, pp. 18 985–18 993. [10] G. Mai, K. Janowicz, B. Yan, R. Zhu, L. Cai, and N. Lao, “Multi-scale representation learning for spatial feature distributions using grid cells,” arXiv preprint arXiv:2003.00824, 2020. [11] G. Chu, B. Potetz, W. Wang, A. Howard, Y. Song, F. Brucher, T. Leung, and H. Adam, “Geo-aware networks for fine-grained recognition,” in Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, 2019, pp. 0–0. [12] T. Berg, J. Liu, S. W. Lee, M. L. Alexander, D. W. Jacobs, and P. N. Belhumeur, “Birdsnap: Large-scale fine-grained visual categorization of birds,” in 2014 IEEE conference on computer vision and pattern recognition. IEEE, 2014, pp. 2019–2026. [13] O. Mac Aodha, E. Cole, and P. Perona, “Presence-only geographical priors for fine-grained image classification,” in Proceedings of the IEEE/cvf international conference on computer vision, 2019. [14] G. Mai, C. Jiang, W. Sun, R. Zhu, Y. Xuan, L. Cai, K. Janowicz, S. Ermon, and N. Lao, “Towards general-purpose representation learning of polygonal geometries,” GeoInformatica, vol. 27, pp. 289–340, 2023. [15] X. Li, K. Zhao, G. Cong, C. S. Jensen, and W. Wei, “Deep representation learning for trajectory similarity computation,” in 2018 IEEE 34th international conference on data engineering (ICDE), 2018. [16] L. Li, H. Xue, Y. Song, and F. Salim, “T-jepa: A joint-embedding predictive architecture for trajectory similarity computation,” in Proceedings of the 32nd ACM international conference on advances in geographic information systems, 2024, pp. 569–572. [17] Z. Chen, S. Wang, K. Wu, G. Li, J. Li, and J. Wang, “Placefield2bvec: A bionic geospatial location encoding method for hierarchical temporal memory model,” International Journal of Applied Earth Observation and Geoinformation, vol. 136, p. 104402, 2025. [18] A. Sassi, M. Brahimi, W. Bechkit, and A. Bachir, “Location embedding and deep convolutional neural networks for next location prediction,” in 2019 IEEE 44th LCN symposium on emerging topics in networking (LCN symposium). IEEE, 2019, pp. 149–157. [19] Y. Liang, J. Zhu, W. Ye, and S. Gao, “Region2vec: community detection on spatial networks using graph embedding with node attributes and spatial interactions,” in Proceedings of the 30th international conference on advances in geographic information systems, 2022, pp. 1–4. [20] A. Grover and J. Leskovec, “node2vec: Scalable feature learning for networks,” in Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, 2016. [21] J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and Q. Mei, “Line: Large-scale information network embedding,” in Proceedings of the 24th international conference on world wide web, 2015, pp. 1067–1077. [22] Z. Fang, Y. Du, X. Zhu, D. Hu, L. Chen, Y. Gao, and C. S. Jensen, “Spatio-temporal trajectory similarity learning in road networks,” in Proceedings of the 28th ACM SIGKDD conference on knowledge discovery and data mining, 2022, pp. 347–356. [23] Y. Chang, J. Qi, Y. Liang, and E. Tanin, “Contrastive trajectory similarity learning with dual-feature attention,” in 2023 IEEE 39th International conference on data engineering (ICDE). IEEE, 2023, pp. 2933–2945. [24] J. Feng, Y. Li, C. Zhang, F. Sun, F. Meng, A. Guo, and D. Jin, “Deepmove: Predicting human mobility with attentional recurrent networks,” in Proceedings of the 2018 world wide web conference, 2018.

Related documents

Record · ID 1528101 · SHA-256 80c5dea7a304bea6
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive