A multi-view contrastive learning framework for spatial embeddings in risk modelling Freek Holvoet, Christopher Blier-Wong, Katrien Antonio Abstract Incorporating spatial information, particularly those influenced by climate, weather, and demographic factors, is crucial for improving underwriting precision and enhancing risk management in insurance. However, spatial data are often unstructured, high-dimensional, and difficult to integrate into predictive models. Embedding methods are needed to convert spatial data into meaningful representations for modelling tasks. We propose a novel multi-view contrastive learning framework for generating spatial embeddings that combine information from multiple spatial data sources. To train the model, we construct a spatial dataset that merges satellite imagery and OpenStreetMap features across Europe. The framework aligns these spatial views with coordinate-based encodings, producing low-dimensional embeddings that capture both spatial structure and contextual similarity. Once trained, the model generates embeddings directly from latitude–longitude pairs, enabling any dataset with coordinates to be enriched with meaningful spatial features without requiring access to the original spatial inputs. In a case study on French real estate prices, we compare models trained on raw coordinates against those using our spatial embeddings as inputs. The embeddings consistently improve predictive accuracy across generalised linear, additive, and boosting models, while providing interpretable spatial effects and demonstrating transferability to unseen regions. Keywords : spatial embedding, multi-view learning, GeoAI, spatial representation learning, risk analysis, satellite imagery 1 Introduction Spatial data are central to fields such as environmental monitoring, urban planning, and real estate pricing. Spatial modelling is also increasingly important in insurance applications. For instance, spatial data are used to link weather patterns to hail-damage claim frequency ( 12 ) or to quantify the effect of heat waves on mortality rates ( 38 ) . These examples illustrate how incorporating spatial information enables actuaries to better analyse and manage risks that exhibit spatial dependence. Despite their importance, integrating spatial information into predictive models remains challenging. Location is often represented as a simple coordinate pair (latitude and longitude) or as a categorical variable, which fails to capture real-world geographical structure. Popular machine learning methods, such as random forests and gradient boosting machines, apply linear splits on these coordinate variables, leading to artificial rectangular patterns that do not align with real-world geography ( 13 ) . Early work in spatial risk modelling was primarily inspired by geostatistics, where the focus is on understanding the dependence structures inherent in spatially distributed data. Two modelling strategies are typically explored: incorporating location via spatial smoothing of residuals, see 45 ; 5 ; 46 or by considering the spatial coordinates directly in a statistical model, for example, in a generalised additive model with a bivariate smooth effect of latitude and longitude, see 9 ; 15 ; 40 ; 21 ; 22 . While these approaches model spatial dependence explicitly, modern machine learning increasingly represents spatial information through representation learning, where spatial information is captured implicitly via so-called embeddings. Embeddings are vector representations of data objects, obtained through an encoder that maps discrete or structured inputs into a continuous, typically low-dimensional space. The dimensionality of the embedding determines how much information it can represent: low-dimensional embeddings capture the most essential structure of the input data, while higher-dimensional embeddings can preserve more detailed or complex patterns. A particular class of embeddings, called entity embeddings, refers to compact, continuous-valued representations of categorical variables, where each category is mapped to a low-dimensional vector ( 16 ) . The use of embeddings in actuarial science is not new: 37 discuss the notion of supervised entity embeddings to model categorical variables, and 3 construct entity embeddings via unsupervised learning for use in actuarial applications. For example, a motor third-party liability dataset may contain categorical variables such as gender, vehicle type, and coverage level, each of which can be represented by entity embeddings. A non-exhaustive list of applications of entity embeddings in non-life insurance pricing includes 8 ; 1 ; 36 ; 49 ; 23 . Spatial information can be categorical in nature, for instance, when postal codes or administrative regions are treated as levels of a categorical variable. In such cases, entity embeddings can be used to capture spatial variation in risk levels, as shown in 41 . In 4 , the authors claim that entity embeddings are inappropriate for integrating spatial information in insurance loss modelling. Granular territories such as postal codes are typically created to facilitate mail delivery, not to capture homogeneous risk profiles. Furthermore, if neighbors live on the border between two territories, their insurance premiums may differ since the embeddings of their territories will vary, even though their spatial risk should be similar. For this reason, the effect of spatial information in prediction models should be smooth on a map, and entity embeddings typically do not possess this property. For these reasons, 4 propose modelling spatial risk through spatial embeddings rather than entity embeddings. Spatial embeddings represent geographic information directly in a continuous latent space, where locations that are close in space are assigned similar vectors. Unlike entity embeddings, which treat each spatial unit as an independent category, spatial embeddings encode smooth transitions across space. Figure 1 illustrates the difference between entity embedding and spatial embedding, by embedding postal codes into one dimension, which is shown as a colour on the map. In the left panel, postal codes treated as categorical entities produce random, discontinuous colour patterns, while the spatial embeddings in the right panel exhibit spatial consistency, with nearby postal codes having similar colours and distant postal codes having dissimilar colours. (a) Entity embeddings: each postal code is treated as a distinct category, resulting in random, discontinuous colour patterns that lack spatial structure. (b) Spatial embeddings: the embedding encodes geographic proximity, producing smooth colour transitions across neighbouring postal codes with nearby locations having similar embeddings, while distant locations differ. Figure 1 : Conceptual illustration of entity versus spatial embeddings for a selection of postal codes in France. Each postal code is embedded into a one-dimensional latent space, illustrated by colour. Spatial embeddings can also incorporate external contextual information about each location, such as census statistics, land cover maps, or satellite imagery. These context-aware spatial embeddings enable models to represent not only the location itself, but also what is present there. In a case study on claim frequency modelling using Canadian data, 4 construct spatial embeddings from geographic coordinates enriched with census data using a convolutional neural network. They show that these embeddings capture spatial risk patterns more effectively than traditional spatial smoothing methods, such as generalised additive models with bivariate smooth effects. Similarly, 32 construct spatial embeddings based on H3 hexagonal coordinates ( 47 ) , augmenting them with spatial context from OpenStreetMap data for each hexagonal cell. Using a Belgian motor third-party liability claims dataset, they demonstrate that incorporating such contextual information improves predictive accuracy. In the broader field of geospatial artificial intelligence (GeoAI), spatial representation learning has advanced rapidly through neural networks that process large-scale, heterogeneous spatial data ( 50 ; 2 ; 30 ; 29 ) . These methods typically produce task-agnostic spatial embeddings, which means that the embeddings are not trained for a single predictive task, but rather to capture general spatial structure and relationships across different regions or data sources. Once learnt, these embeddings can serve as general-purpose spatial representations that can be reused in different predictive settings. This property makes them particularly suited for spatial transfer learning, which refers to the ability of a model trained on one geographic area or dataset to generalise its learnt spatial patterns to other territories where no training data are available. By leveraging shared geographic characteristics through spatial embeddings, transfer learning allows for more accurate predictions in previously unseen locations. The recent development of foundation models extends context-aware spatial embedding models by aiming to create general-purpose geospatial representations that integrate multiple data modalities while retaining spatial awareness. Foundation models have already transformed language and vision through large pretrained architectures, and similar ambitions are now emerging for multimodal spatial models that unify imagery, vector data, and semantic context ( 28 ; 31 ) . A notable recent example is AlphaEarth ( 6 ) , a large-scale multiview and spatiotemporal geospatial foundation model that integrates satellite imagery, weather reanalysis, and auxiliary contextual data to produce globally consistent embeddings. One specific spatial embedding architecture we will investigate in this paper is the SatCLIP model, proposed by 26 ; 27 . SatCLIP constructs context-aware spatial embeddings by combining geographic coordinates with visual context extracted from satellite imagery. The model produces two types of embeddings: one derived from spatial coordinates using spherical harmonics to capture global spatial structure ( 39 ) , and another derived from satellite images using a vision transformer that extracts high-level visual patterns ( 44 ) . These two embedding spaces are aligned through contrastive learning, where the model learns to assign similar representations to spatial locations that share similar visual and geographic characteristics, and dissimilar representations to locations that differ. The contrastive training procedure allows the coordinate encoder to internalise the contextual information contained in the imagery. As a result, SatCLIP can generate embeddings for new locations using only their geographic coordinates, without requiring access to the original spatial data. 27 uses the trained SatCLIP model to produce embeddings that are high-dimensional and designed to capture large-scale spatial variation across the earth’s surface. They demonstrate the use of these embeddings in a case study on global temperature pattern prediction. In this paper, we propose a multi-view contrastive learning model that generates spatial embeddings by leveraging multiple input data sources as spatial context. Our contribution lies in combining information from different spatial views with geographical coordinates to obtain low-dimensional embeddings that capture local spatial patterns. The model takes as input different sources of spatial data, such as satellite imagery and tabular neighbourhood information, together with the geographical coordinates of where the spatial information was gathered. Through contrastive learning, the model learns to associate patterns in the geographic coordinates with the information contained in the spatial views. Rather than targeting global coverage, the proposed framework is intended for regional settings. It can be retrained efficiently on consumer-grade hardware, flexibly incorporates different spatial data sources, and yields fine-grained spatial embeddings that capture local geographic structure in greater detail when compared to global-scale spatial embedding models. Our work differs from SatCLIP ( 26 ; 27 ) in two key aspects. First, we integrate multiple spatial data sources rather than relying on a single modality, such as satellite imagery. Second, our model is designed to learn compact embeddings optimised for fine-grained regional applications, whereas SatCLIP produces high-dimensional global representations tailored to large-scale earth system modelling. Our model architecture has two main components: one that encodes spatial views and another that encodes coordinates, as illustrated in Figure 2 . The bottom of Figure 2 shows how each spatial input data source is processed by its dedicated encoder, represented by the blue blocks. The results of each spatial view encoder are then merged with a neural network part called the multi-view fusion encoder (orange block). The top half of Figure 2 shows the encoding of coordinates, represented by the green block in Figure 2 . Hereto, we use a set of spherical harmonic basis functions ( 39 ) . These functions capture patterns on earth at both large and small scales. Each set of coordinates is encoded as a weighted sum of spherical harmonic basis functions. These weights are then passed through a neural network that learns to link the basis functions to meaningful geographic context. We use contrastive learning to connect the output of the multi-view fusion encoder and the output of the location encoder. This forces the neural network part of the location encoder to link the information from the multiple spatial views to the patterns from the spherical harmonic basis functions. Figure 2 : Architecture of our multi-view spatial embedding model. The green block represents the embedding of latitude and longitude coordinates. Each blue block embeds a different spatial view, and the orange block fuses these different spatial embeddings. The model is trained with a contrastive learning objective to learn spatial embeddings by contrasting the coordinate embedding with the information learnt from the different spatial views. Image inspired by 27 . This paper is structured as follows. Section 2 details the construction of a multi-view spatial dataset for European countries. We gather both satellite images via Google Maps ( 14 ) and neighbourhood context via OpenStreetMap ( 34 ) for almost 100\,000 locations across Europe. Section 3 shows the construction of the multi-view spatial embedding model and details the contrastive loss function, the training, and the hyperparameter choices. In Section 4 , we illustrate the practical value of our spatial embeddings in the context of real estate pricing. Traditional models in this field often rely on basic location indicators, such as postal codes or proximity to landmarks, which only provide limited spatial context. In contrast, our proposed spatial embeddings incorporate a richer set of geographic features, enabling the model to better account for the influence of surrounding areas and environmental characteristics on property values. To evaluate our approach, we compare the predictive performance of a generalised linear model, a generalised additive model with a spatial smoother, and a gradient-boosting machine in predicting real estate prices using our spatial embeddings instead of raw coordinates. We examine permutation-based variable importance to evaluate the impact of spatial embeddings on the model’s output. Using partial dependence effects, we demonstrate how geographic patterns, encoded via our embedding vectors, influence the predictions from the pricing model. We also experiment with transfer learning to areas held out of training to evaluate spatial generalization. Section 5 concludes the paper. 2 Dataset of locations and spatial views We construct a multi-view dataset of 95\,857 unique locations distributed across the European continent. The sampling of locations is guided by population distribution, using the European Local Administrative Units (LAU) framework ( 11 ) . We show the distribution of the datasets’ locations in Europe in Figure 3 . Figure 3 : Our dataset consists of 95\,857 sampled locations in European countries. The sampling of the locations is done based on the European Local Administrative Units framework. Each location is defined by a latitude–longitude coordinate pair and enriched with two data views: a Google satellite image (GS) on the one hand and structured semantic context from OpenStreetMap (OSM) ( 34 ) on the other hand. Figure 4 shows an example of the two spatial views for a location in Leuven, Belgium. We gather the satellite image using the Google Maps Static API ( 14 ) , as shown in Figure 4b . The satellite image is centred on the coordinates of the location and has a resolution of 256\times 256 pixels in RGB format, resulting in a dimension of 256\times 256\times 3 . We gather OSM tags representing semantic information typically not visible in satellite imagery. Hereto, we define six categories of tags: shops , tourism , food & drink , health , education and public safety . Appendix A contains all OpenStreetMap tags corresponding to each category. We aggregate occurrences of these tags in three rings of H3 hexagonal cells ( 47 ) centred at each location. Using concentric rings around the centre, we capture both close-by and more distant amenities in a consistent spatial structure. This is illustrated in Figure 4c , which shows three rings of hexagons around the centre location with the occurrences of each category of tag in coloured points. Three rings of hexagons around a central location lead to 37 hexagons in total, where the frequency of each of the six tag categories is counted for each hexagon. Formally, let P=95\,857 denote the total number of locations in our dataset. We define the dataset \mathcal{D}=\{(\lambda_{p},\phi_{p}),V^{\mathrm{GS}}_{p},V^{\mathrm{OSM}}_{p}\}_{p=1}^{P} , where the pair (\lambda_{p},\phi_{p}) represents the geographical coordinates latitude and longitude of location p . Each location is associated with a satellite image represented by V^{\mathrm{GS}}_{p}\in\mathbb{R}^{256\times 256\times 3} , and V^{\mathrm{OSM}}_{p}\in\mathbb{N}^{37\times 6} represents the aggregated of OpenStreetMap tags counts. Note that for a location p , the spatial views V^{\mathrm{GS}}_{p} and V^{\mathrm{OSM}}_{p} always relate to the coordinates (\lambda_{p},\phi_{p}) . (a) The coordinate pair (\lambda,\phi)=(4.70591^{\circ},50.88173^{\circ}) shown with a red cross. This corresponds to a location in Leuven, Belgium. (b) A Google Satellite image corresponding to the coordinate pair from panel (a). The data point V^{\mathrm{GS}} represents the RGB pixel values from this image. (c) OpenStreetMap tags corresponding to the coordinate pair from panel (a). The data point V^{\mathrm{OSM}} contains the count for each of the six categories in each of the hexagons. Figure 4 : Illustration of one data point in the dataset \mathcal{D} , with coordinates (\lambda,\phi)=(4.70591^{\circ},50.88173^{\circ}) in Leuven, Belgium. Panel (a) shows the location of the coordinate pair. Panel (b) displays the associated Google Satellite image, where the matrix V^{\mathrm{GS}}\in\mathbb{R}^{256\times 256\times 3} stores the RGB pixel values. Panel (c) displays the corresponding OpenStreetMap features, where the matrix V^{\mathrm{OSM}}\in\mathbb{N}^{37\times 6} contains the counts of six categories of tags for each of the 37 surrounding hexagons. 3 Spatial embedding model architecture Using the two spatial views introduced in Section 2 , we construct our spatial embedding model. Firstly, we introduce the two spatial view encoders and the structure of the multi-view fusion encoder as sketched in Figure 2 . Secondly, we detail the architecture of the location encoder. Thirdly, we provide an overview of the model’s complete architecture and examine the hyperparameter choices for training the spatial embedding model. 3.1 Spatial view encoders and multi-view fusion Google satellite encoder (GS) The image encoder, denoted as f^{\mathrm{GS}}(V^{\mathrm{GS}}) , maps a satellite image V^{\mathrm{GS}}\in\mathbb{R}^{256\times 256\times 3} to a d_{\mathrm{GS}} -dimensional vector. As encoder f^{\mathrm{GS}} , we use a convolutional neural network, since such architectures are specifically designed to extract and combine patterns from image data. In particular, we adopt the ResNet18 model from 48 , a convolutional neural network trained on satellite imagery using momentum contrast ( 19 ) , a self-supervised learning method that optimises the network to produce vector representations reflecting the structure of images. The ResNet18 architecture consists of 17 convolutional layers with residual links to facilitate training ( 20 ) . Each convolutional layer consists of several convolutional filters, meant to extract patterns from the input data. After applying the convolutional layers, the results are pooled and flattened into a vector, which is then passed through a fully connected network to produce the final embedding. Figure 5 illustrates this architecture. The input satellite image V^{\mathrm{GS}} is represented by a green input block. It is processed through a sequence of convolutional layers (blue blocks), followed by pooling and flattening operations (yellow blocks). The resulting representation is then passed through a fully connected network (rightmost blue block), which outputs the final embedding vector of dimension d_{\mathrm{GS}} shown in red. We initialise the model with pretrained weights from 48 and adjust the output dimension to d_{\mathrm{GS}} , a hyperparameter. The trainable parameters of f^{\mathrm{GS}} lie in the convolutional filters and in the fully connected output network, represented as blue blocks in Figure 5 . Figure 5 : Illustration of the encoder used for the Google satellite imagery spatial view. We use a ResNet18 architecture ( 20 ) , pretrained following 48 . The input image (green block) of dimension 256\times 256\times 3 is processed by convolutional layers (blue blocks) that extract spatial patterns. These patterns are then pooled and flattened (yellow blocks) before passing through a fully connected network (rightmost blue block). The final embedding is a vector of dimension d_{\mathrm{GS}} , as shown in the red block. Blue blocks contain the trainable parameters of the model. OpenStreetMap tags encoder (OSM) We denote the encoder for the OpenStreetMap tags view as f^{\mathrm{OSM}}(V^{\mathrm{OSM}}) with the encoder mapping a hexagonal data input V^{\mathrm{OSM}}\in\mathbb{N}^{37\times 6} to a d_{\mathrm{OSM}} -dimensional vector. Similar to the encoder f^{\mathrm{GS}} , we use a convolutional neural network to extract patterns from the input data and represent those patterns in a vector. However, our input is defined on a hexagonal grid, whereas standard convolutional neural networks are designed for square-grid data such as images. Therefore, we adopt the method proposed by 32 for convolutional neural networks on hexagonal input data while preserving neighbourhood relations between cells. The mapping follows the h2 coordinate system ( 43 ) , which minimises distortion by maintaining adjacency and approximate distance between neighbouring hexagons. Although alternative mappings are possible, this approach provides a consistent alignment between hexagonal neighbourhoods and square convolutional filters, allowing the use of standard convolutional layers without altering the underlying spatial structure of the data. We illustrate this transformation with a grid of 37 hexagons in Figure 6a , which is mapped to a 7\times 7 matrix in Figure 6b following the h2 coordinate system from 43 . The upper and lower corners of the matrix are masked, meaning that these entries are fixed to zero because no corresponding hexagons exist in those positions. For clarity, coordinates are added to each hexagonal cell and their correspondence to the square matrix is shown. A convolutional filter covering one ring of hexagons is illustrated with red and green cells in Figure 6a . In the transformed representation, this filter corresponds to a 3\times 3 convolutional filter, where the upper-right and lower-left corners are masked, shown with the red and green cells in Figure 6b . Generally, for a convolutional filter of k -rings around a central hexagon, the corresponding standard convolutional filter has a size of 2k+1 , with zeros masking the upper-right and lower-left corners of size k . Hence, the encoder f^{\mathrm{OSM}} is built using a standard convolutional architecture on transformed input data and by fixing the upper right and lower left corners of the convolutional filters to zero. (a) A hexagonal grid of 37 cells (three rings). Coordinates are added for clarity. In colour, a convolutional filter of size k=1 (one ring) is shown. (b) The corresponding 7\times 7 square grid obtained from the transformation of the 37 hexagonal cells following 32 . Coordinates indicate how hexagonal cells map to the square representation. In colour, the k=1 filter is shown after transformation, corresponding to a 3\times 3 filter with the upper-right and lower-left corners masked. Figure 6 : Illustration of the transformation from hexagonal to square representation. A convolutional filter of size k=1 on the hexagonal grid (left) corresponds to a 3\times 3 filter on the transformed square grid (right), with the upper-right and lower-left corners masked. The encoder f^{\mathrm{OSM}} is illustrated in Figure 7 . The input is a hexagonal grid consisting of 37 cells, where each cell counts the number of tags for each of the six OSM categories under consideration, resulting in an input dimension of 37\times 6 . We apply the transformation on our hexagonal input, which results in a square matrix of dimension 7\times 7\times 6 . On the transformed input, we apply two convolutional layers. The number of convolutional filters in each layer, together with the size of the filters, is treated as a tuning parameter. Each convolutional layer is followed by normalization and ReLU activation to facilitate training. The output of the second convolutional layer is then flattened into a vector and passed through a feed-forward neural network to produce the final representation of dimension d_{\mathrm{OSM}} . This architecture enables the encoder to learn from the spatial structure of the OSM data, resulting in an output vector that accurately represents the spatial patterns in the input data. Figure 7 : Illustration of the used encoder for the OpenStreetMap spatial view. The hexagonal input data is first transformed into a rectangular format. Next, there are two convolutional layers, each using masked convolutions. Finally, a feed-forward neural network outputs the encoded input. Each blue block in the flowchart contains trainable elements to be optimised in the training of the spatial encoder model. The encoder f^{\mathrm{OSM}} has trainable parameters in the filters of each of the two convolutional layers and in the fully connected network that produces the output. Figure 7 shows these components as blue blocks. The output dimension d_{\mathrm{OSM}} is a hyperparameter. The number and size of convolutional filters in each layer are tuning parameters. Multi-view fusion We combine the embedding vectors produced by the spatial view encoders f^{\mathrm{GS}} and f^{\mathrm{OSM}} into a single joint spatial representation by use of a multi-view fusion encoder f^{\mathrm{MV}} . The two embeddings are concatenated and passed through a feed-forward neural network with fully connected layers, which outputs a vector of dimension d . These layers contain trainable weights that are optimised jointly with the rest of the spatial embedding model. The depth of the network and the width of each layer are treated as hyperparameters in the model design. 3.2 Location encoder Each data point’s coordinates (\lambda,\phi) are embedded onto a d -dimensional vector by a location encoder, as illustrated in Figure 8 . We denote the location encoder as f^{\mathrm{LE}}:\mathcal{D}\to\mathbb{R}^{d}:(\lambda,\phi)\mapsto f^{\mathrm{LE}}\left(\lambda,\phi\right). (1) We use the proposed location encoder by 39 , where f^{\mathrm{LE}}(\lambda,\phi)=\mathrm{NN}(\mathrm{PE}(\lambda,\phi)) , consisting of a positional encoder \mathrm{PE}(\lambda,\phi) and a neural network part \mathrm{NN}(\cdot) . 39 apply this setup to learn spatial patterns from weather variables, i.e., temperature and air pressure data, for use in a regression model, and from satellite imagery for land-use classification and land-ocean segmentation. The positional encoder is defined as \mathrm{PE}(\lambda,\phi)=\sum_{{\ell}=0}^{L}\sum_{m=-\ell}^{\ell}w_{\ell}^{m}Y_{\ell}^{m}(\lambda,\phi), (2) where w_{\ell}^{m} are weights and Y_{\ell}^{m} are the orthogonal spherical harmonic basis functions associated with Legendre polynomials P_{\ell}^{m} of degrees {\ell} and orders m , see 39 . These spherical harmonic functions encode spatial locations on a spherical surface by decomposing them into a sum of orthogonal components. The orthogonality ensures that different spatial components are captured separately, allowing the model to represent complex spatial patterns at global and localised scales. The neural network part, known as the Siren network ( 42 ; 27 ; 39 ) , takes as input the weighted spherical harmonic functions w_{\ell}^{m}Y_{\ell}^{m}(\lambda,\phi) . These are passed through feed-forward layers with sinusoidal activation functions, which allow the network to represent spatial patterns smoothly on a sphere. Figure 8 sketches the architecture of the location encoder. The input is a coordinate pair (\lambda,\phi) , represented by the green block. We evaluate the spherical harmonic basis functions (yellow blocks), for \ell=0,\ldots,L and for each \ell over m=-\ell,\ldots,\ell , using this coordinate pair as input. The weighted spherical harmonic basis functions (first blue block) serve as inputs to the feed-forward neural network with sinusoidal activation functions, known as the Siren network (second blue block). The output of the Siren network is the location embedding of the coordinate pair. Figure 8 : Illustration of the used location encoder. A weighted sum of spherical harmonic basis functions is used, with \ell=0,\ldots,L and for each \ell over m=-\ell,\ldots,\ell . The weighted spherical harmonic basis functions w_{\ell}^{m}Y_{\ell}^{m} are inputs to a feed-forward neural network using sinusoidal activation functions, called the Siren net ( 39 ) . Each blue block in the flowchart contains trainable elements that can be optimised during the training of the spatial encoder model. The weights of the spherical harmonic basis functions and the weights in the Siren network are trainable parameters of the location encoder. Increasing the number of basis functions L allows the positional encoder to capture more fine-grained spatial detail, but also increases computational cost. To effectively utilise this additional detail, a larger value for L typically implies a larger value for d , ensuring the encoder has sufficient capacity to represent the information ( 27 ) . The values of L , d , and the architecture of the Siren network are treated as hyperparameters. 3.3 Putting it all together: model architecture, training, and applications Figure 9 illustrates the complete architecture for our spatial embedding model using two spatial views as inputs. The left-hand side represents the encoding of the location coordinates (\lambda,\phi) by the location encoder f^{\mathrm{LE}} as discussed in Section 3.2 , resulting in an embedded location vector of dimension d . On the right, the spatial view encoders, as discussed in Section 3.1 , process the two data sources: the OpenStreetMap tags, encoded by f^{\mathrm{OSM}}(V^{\mathrm{OSM}}) , into a vector of dimension d_{\mathrm{OSM}} , and the Google satellite imagery, encoded by f^{\mathrm{GS}}(V^{\mathrm{GS}}) , into a vector of dimension d_{\mathrm{GS}} . These two spatial view embeddings are then combined by the multi-view fusion encoder f^{\mathrm{MV}}\left(f^{\mathrm{GS}}(V^{\mathrm{GS}}_{p}),f^{\mathrm{OSM}}(V^{\mathrm{OSM}}_{p})\right) into a single joint embedding of dimension d , with typically d\leq d_{\mathrm{GS}}+d_{\mathrm{OSM}} . Figure 9 : Architecture of the multi-view spatial embedding model with two spatial views as inputs. The left side shows the location encoder f^{\mathrm{LE}} (Figure 8 ), which embeds the coordinates (\lambda,\phi) . On the right, the Google satellite imagery and OpenStreetMap tags are processed by their respective encoders f^{\mathrm{GS}} and f^{\mathrm{OSM}} (Figures 5 and 7 ). Their outputs are combined in the multi-view fusion encoder f^{\mathrm{MV}} . The resulting spatial view embedding is aligned with the location embedding using contrastive learning. Blue blocks indicate trainable components that are optimised during model training. From the dataset \mathcal{D} , introduced in Section 2 , we construct a training dataset \mathcal{D}^{T}=\{(\lambda_{p},\phi_{p}),V^{\mathrm{GS}}_{p},V^{\mathrm{OSM}}\}_{p=1}^{P^{T}} of size P^{T} , containing 90\% of the dataset \mathcal{D} sampled randomly. The remaining 10\% of data forms the validation set \mathcal{D}^{V} and is used for early stopping in the training of the model. The training objective is to align the embedded locations with the embedded spatial views. For each p=1,\ldots,P^{T} , we denote the embedding vectors as z for notational clarity: z^{\mathrm{LE}}_{p}=f^{\mathrm{LE}}(\lambda_{p},\phi_{p}),\quad z^{\mathrm{MV}}_{p}=f^{\mathrm{MV}}\left(f^{\mathrm{GS}}(V^{\mathrm{GS}}_{p}),f^{\mathrm{OSM}}(V^{\mathrm{OSM}}_{p})\right). The contrastive loss function \mathscr{L} is constructed to maximise the similarity between the so called positive pairs z^{\mathrm{LE}}_{p} and z^{\mathrm{MV}}_{p} , and to minimise the similarity across all mismatched pairs z^{\mathrm{LE}}_{p} and z^{\mathrm{MV}}_{p^{\prime}} for p^{\prime}\neq p , see 35 . The contrastive loss over all elements in the training dataset is defined as \mathscr{L}=\frac{1}{2P^{T}}\sum_{p=1}^{P^{T}}\left[-\log\frac{\exp\left(\text{sim}(z^{\mathrm{LE}}_{p},z^{\mathrm{MV}}_{p})/\tau\right)}{\sum_{p^{\prime}=1}^{P^{T}}\exp\left(\text{sim}(z^{\mathrm{LE}}_{p},z^{\mathrm{MV}}_{p^{\prime}})/\tau\right)}-\log\frac{\exp\left(\text{sim}(z^{\mathrm{MV}}_{p},z^{\mathrm{LE}}_{p})/\tau\right)}{\sum_{p^{\prime}=1}^{P^{T}}\exp\left(\text{sim}(z^{\mathrm{MV}}_{p},z^{\mathrm{LE}}_{p^{\prime}})/\tau\right)}\right], where \text{sim}(a,b)=\frac{a\cdot b}{\lVert a\rVert\,\lVert b\rVert} denotes the normalised dot-product and \tau is a so-called temperature hyperparameter. The two similarity terms ensure that both the alignment from location to spatial embeddings, \text{sim}(z^{\mathrm{LE}}_{p},z^{\mathrm{MV}}_{p}) , and from spatial to location embeddings, \text{sim}(z^{\mathrm{MV}}_{p},z^{\mathrm{LE}}_{p}) , is maximised. Training the complete architecture of our spatially embedded model consists of finding the optimal values for the trainable parameters so that the contrastive loss \mathscr{L} on the training dataset \mathcal{D}^{T} is minimised. The trainable parameters in the model architecture are illustrated with blue blocks in Figure 9 . Minimizing the contrastive loss encourages the location embeddings z^{\mathrm{LE}}_{p} and the multi-view embeddings z^{\mathrm{MV}}_{p} of the same point p to be similar, while embeddings of different locations remain distinct. In this way, the positional patterns represented by the spherical harmonics are aligned with the information extracted from the spatial views. The resulting embedded locations thus encode both the geographic position and the spatial content, allowing the model to represent locations in a manner that reflects where they are as well as what is observed there. In a case study involving geographical locations, the trained spatial embedding model can be applied to represent each location by its embedding. For a dataset consisting of covariates x_{1},\ldots,x_{p} , where x_{1} represents geographical coordinates, the covariate x_{1} can be replaced with its embedding f^{\mathrm{LE}}(x_{1}) , as illustrated in Figure 10 . These embeddings act as compact descriptors that integrate both geographic position and the spatial information captured from multiple data views, and can be used as input features in downstream analyses such as regression models. Figure 10 : Application of the trained spatial embedding model in a case study where geographical coordinates are used as a covariate in a predictive model. By replacing the raw coordinate x_{1} with its spatial embedding f^{\mathrm{LE}}(x_{1}) , the model incorporates not only geographic position but also the spatial information observed at that location through the embedding. 3.4 Hyperparameter choices and trained model architectures In the construction and training of our spatial embedding model architecture, several hyperparameters have to be specified. The OpenStreetMap encoder f^{\mathrm{OSM}} consists of two convolutional layers, the first with 8 filters and the second with 16 filters, both with kernel size k=1 . The multi-view fusion encoder is implemented as a single dense layer consisting of 128 neurons. The location encoder uses L=64 spherical harmonic basis functions in the positional encoder, followed by a two-layer feed-forward network with 128 neurons each. Optimization is performed with the Adam algorithm ( 25 ) using a learning rate of 10^{-5} and weight decay of 0.01 . Training is carried out for 500 epochs with a batch size of 128 . The contrastive loss employs a temperature parameter of \tau=0.07 . The hyperparameter choices either follow the values proposed in 27 or were determined during preliminary testing in the model construction phase. More details can be found in Appendix B . For the experimental study in Section 4 , we study the effect of the overall embedding dimension d , and the intermediate dimensions d_{\text{GS}} and d_{\text{OSM}} of the Google Satellite and OpenStreetMap encoders on the resulting spatial embeddings. To this end, we construct five different embedding models, each corresponding to a different combination of d , d_{\text{GS}} , and d_{\text{OSM}} . Table 1 shows the values of d , d_{\text{GS}} , and d_{\text{OSM}} for each of the five embedding models, which are compared in the experimental study in Section 4 . Table 1 : Overview of the five spatial embedding models used in the experimental study. Each model varies the overall embedding dimension d and the intermediate dimensions d_{\text{GS}} and d_{\text{OSM}} , while all other hyperparameters are fixed. Model acronyms are constructed as follows: the prefix EU indicates that the model is trained on the European dataset introduced in Section 2 ; this is followed by the overall embedding dimension d ; then GS with the dimension of the Google Satellite encoder d_{\text{GS}} ; and finally OSM with the dimension of the OpenStreetMap encoder d_{\text{OSM}} . † † nicematrix-placeholder: NiceTabular (nicematrix) All training is conducted using Python on a desktop computer with a single NVIDIA RTX 4070 GPU (12 GB), an Intel i9-13900K CPU, and 128GB of RAM. Training the model on the full European dataset required approximately 12 hours, depending on hyperparameters. Calculating the embeddings for a new coordinate, as illustrated in Figure 10 , takes under 1 millisecond. 4 Experimental study 4.1 Real estate transactions dataset We use a real estate transaction dataset published by 10 . Our dataset contains 200\,000 property sales in France between 2017 and 2023 . Each record in the dataset describes one transaction with the sale price and descriptive variables about the property. Table 2 provides an overview of the variables in the dataset, including their descriptions and whether they are continuous or categorical. Table 2 : Description of the variables in the French real estate transaction dataset. The column Variable lists the variable names used in this paper, while the column Original name (Etalab) shows the dataset field names as defined in 10 . Each description specifies whether the variable is continuous or categorical, and for categorical variables, the levels are listed. † † nicematrix-placeholder: NiceTabular (nicematrix) The case study constructs a regression model using the variables in Table 2 as covariates with price as the response variable. The left-hand side of Figure 11 shows the distribution of the response variable in the dataset, and the right-hand side shows the average property value by postal code. All transaction prices lie between € 100 000 and € 2 000 000. The average transaction value of properties is € 310 190, with 90\% of properties having a transaction value between € 112 000 and € 800 000. The areas with a higher average transaction value include the Paris district, the south-east and south-west coast areas, and the French Alps bordering Switzerland. The centre of France features large areas with lower average transaction prices in the regions of Limousin, Auvergne, and Bourgogne, which are characterised by extensive areas of nature reserves and agricultural land. We observe a higher average transaction price in cities such as Orleans, Lyon, and Toulouse. The dataset does not contain properties in the departments Bas-Rhin, Haut-Rhin, and Moselle. Figure 11 : Plot of the property values in the dataset. The left-hand side shows a density plot of the property values. The right-hand side shows the average property value by postal code. Figure 12 shows the distribution of the other variables in the French real estate dataset. The properties in the dataset are on average 135\text{\,}{\mathrm{m}}^{2} , with 95\% of properties being below 220\text{\,}{\mathrm{m}}^{2} . The properties have on average four rooms, and a land area of 1012\text{\,}{\mathrm{m}}^{2} . Around 81\% of properties are classified as houses (Type 3), 12.5\% are apartments (Type 1), and the others are industrial or commercial properties (Type 2). Most land use classifications are building lots (class S). More properties were sold in 2021 in comparison to 2020 , and no sales were recorded in the latter half of 2022 . Figure 12 : Exploratory data analysis of the French real-estate transaction dataset. From left to right, top row: density of \log(\texttt{building\_area}) , bar graph of rooms , and the density of \log(\texttt{land\_area}) . Bottom row: bar graph of type , bar graph of land_use , and a bar graph showing the number of transactions per month over time. We denote the French real estate transaction dataset as \mathcal{D}^{\mathrm{FR}}=\left(\boldsymbol{x}_{i},y_{i}\right)_{i=1}^{200\,000} . Each index i represents one property in the dataset, with the vector (x_{i,1},\ldots,x_{i,7}) containing the value of each of the seven variables in the dataset, as described in Table 2 , and y_{i} the value of the price of that property. Let the value x_{i,7} be the latitude-longitude coordinates of the location of property i . When using a spatial embedding model, we replace the latitude-longitude coordinates of each property with the spatial embedding vector representing those coordinates, constructed by the location encoder f^{\mathrm{LE}} from a trained spatial embedding model defined in Section 3.4 . 4.2 Performative analysis of spatial embeddings We fit a regression model on the French real estate dataset with the transaction price as the response variable and the variables in Table 2 as input features. We will compare the effect on predictive accuracy when using the latitude and longitude coordinates as input features versus replacing latitude-longitude with its spatial embedding vector. We construct both a generalised linear model (GLM), a generalised additive model (GAM), and a gradient boosting machine (GBM). The dataset is split into a randomly selected 80\% of the observations as training data and the remaining 20\% as an out-of-sample test set. We fit the GLM using a Gaussian distribution and a logarithmic link function. The categorical input features are dummy encoded for use in the GLM. The levels with the largest amount of exposure are taken as reference level: \texttt{type}_{1} and \texttt{land\_use}_{S} . The location variable is used as two continuous variables, latitude and longitude , and the date variable is used as three continuous variables, year , month , and day . Variable selection is done via a bidirectional stepwise variable selection process; see 17 . The full model structure of the GLM using latitude and longitude as input variables is as follows: \displaystyle\log\left(\mathbb{E}(\texttt{price})\right)= \displaystyle\ \beta_{0}+\beta_{1}\,\texttt{type}_{2}+\beta_{2}\,\texttt{type}_{3}+\beta_{3}\,\texttt{land\_use}_{\text{AB}}+\ldots+\beta_{28}\,\texttt{land\_use}_{\text{VI}} \displaystyle+\beta_{29}\,\texttt{rooms}+\beta_{30}\,\texttt{building\_area}+\beta_{31}\,\texttt{land\_area} \displaystyle+\beta_{32}\,\texttt{year}+\beta_{33}\,\texttt{month}+\beta_{34}\,\texttt{day}+\beta_{35}\,\texttt{latitude}+\beta_{36}\,\texttt{longitude}. (3) For the GLM using the spatial embedding as input variable, the terms \beta_{35}\,\texttt{latitude}+\beta_{36}\,\texttt{longitude} are replaced with \beta_{35}\,\texttt{spatial\_embedding}_{1}+\ldots+\beta_{34+d}\,\texttt{spatial\_embedding}_{d} , where (\texttt{spatial\_embedding}_{1},\ldots,\texttt{spatial\_embedding}_{d}) is the spatial embedding vector of dimension d . We use a Gaussian GAM with a logarithmic link function. The categorical variables are used similarly to those in the GLM, with dummy encoding and the same reference levels. For the continuous variables rooms , building_area , and land_area , univariate smooth functions f_{1} , f_{2} , f_{3} are used. The variable date is treated as three continuous variables, year , month , and day , each with a univariate smooth function f_{4} , f_{5} , f_{6} . The variable coordinates is used as two continuous variables, latitude and longitude , with a bivariate smooth function f_{7} . The full model structure of the GAM is as follows: \displaystyle\log\left(\mathbb{E}(\texttt{price})\right)= \displaystyle\ \beta_{0}+\beta_{1}\,\texttt{type}_{2}+\beta_{2}\,\texttt{type}_{3}+\beta_{3}\,\texttt{land\_use}_{\text{AB}}+\ldots+\beta_{28}\,\texttt{land\_use}_{\text{VI}} \displaystyle\quad+f_{1}(\texttt{rooms})+f_{2}(\texttt{building\_area})+f_{3}(\texttt{land\_area}) \displaystyle\quad+f_{4}(\texttt{year})+f_{5}(\texttt{month})+f_{6}(\texttt{day})+f_{7}(\texttt{latitude},\,\texttt{longitude}). (4) For the GAM using the spatial embedding as input variable, the term f_{7}(\texttt{latitude},\,\texttt{longitude}) is replaced by f_{7}(\texttt{spatial\_embedding}_{1})+\ldots+f_{6+d}(\texttt{spatial\_embedding}_{d}) . For the GBM, we use the XGBoost implementation ( 7 ) . The categorical input features are one-hot encoded for use in the GBM. The optimal tuning parameter values are determined via five-fold cross-validation. We tune the number of trees from the values \{100,500,1000,5000\} , the depth of each tree from the values \{3,5,7\} , and the learning rate from the values \{0.01,0.001\} . We assess model performance for the GLM, GAM, and GBM using the mean squared error (MSE) of log-transformed house prices on the test set. The same test set is used for all three models to ensure a fair comparison. Table 3 shows the out-of-sample losses for the GLM, GAM, and GBM. The first column specifies how the location of the property was used in the model: either using latitude-longitude as input features (no spatial embedding), or a spatial embedding vector as an input feature, in which case the name of the embedding model follows the acronyms given in Table 1 . We indicate the lowest out-of-sample loss for each column in bold. We observe that for the GLM, GAM, and GBM, using spatial embeddings instead of latitude-longitude coordinates as input features results in improved out-of-sample loss. The larger the dimension of the embeddings, the lower the out-of-sample loss, which is to be expected as larger embedding dimensions allow for more spatial information to be stored in the embeddings. Table 3 : Comparison between models using latitude–longitude and spatial embedding as input features. Results show out-of-sample losses, measured in mean-square error on the log transform of the transaction price. For spatial treatment, the model acronyms are used as defined in Table 1 . The lowest out-of-sample loss per column is indicated in bold. † † nicematrix-placeholder: NiceTabular (nicematrix) 4.3 Model interpretation of spatial effect Variable importance We use the permutational variable importance tool from 33 to compare the importance of each variable in our dataset on the prediction of real estate price. The variable importance is measured as the average change in prediction when randomly permuting the values of an input feature. For a prediction model f_{\mathrm{pred}}(\cdot) , and an input feature x_{j} in the dataset \mathcal{D}^{\mathrm{FR}} , the importance of that feature is defined as \mathrm{VIP}_{x_{j}}=\frac{1}{|\mathcal{D}^{\mathrm{FR}}|}\sum_{\boldsymbol{x}_{i}\in\mathcal{D}^{\mathrm{FR}}}\mathrm{abs}\big(f_{\mathrm{pred}}\left(x_{i,1},\ldots,x_{i,j},\ldots x_{i,7}\right)-f_{\mathrm{pred}}\left(x_{i,1},\ldots,\tilde{x}_{i,j},\ldots x_{i,7}\right)\big), (5) where \tilde{x}_{i,j} is a random permutation of all values of that input variable. When calculating the variable importance of the property’s location, the latitude–longitude pairs are permuted together rather than the latitude and longitude values separately. Similarly, when using the spatial embedding to represent location, the entire embedding vectors are permuted, not the individual elements within each vector. We calculate the variable importance for each of the input variables in Table 2 . Figure 13 shows the variable importance for the GLM on the left, the GAM in the middle, and the GBM on the right. Dark blue shows the effect of the model with spatial embeddings, whereas light blue shows the effect of the model using latitude-longitude coordinates. For the spatial embedding, we utilised the location encoder from the trained EU32_GS96_OSM32 model, as described in Section 3.4 . We observe in the GLM that the coordinates of the property are the third most important variable. This is because the GLM can only fit two coefficients, one for latitude and one for longitude, which is not sufficient to capture any nuanced spatial effects. Using spatial embeddings, however, the embedding vector is seen as the most important variable in the model. For both the GAM and the GBM, location is the most important variable, whether used via latitude and longitude coordinates or spatial embeddings. For the GLM and the GAM, the effect of permuting the spatial embeddings is so significant that the relative importance of other variables is no longer visible in Figure 13 . This is not the case for the GBM model, where the importance of non-location variables stays relatively equal between the model using latitude and longitude versus the model using spatial embeddings. Figure 13 : Variable importance as measured in the GLMs (left side), the GAM (middle), and the GBM models (right side). In dark blue, we show the importance of each variable as measured in the model with spatial embeddings. In light blue, we show the importance measured in the model using latitude-longitude coordinates. Partial dependence We use partial dependence plots ( 18 ) to examine the relationship between the predicted real estate price and the property’s location in the pricing model. For a prediction model f_{\mathrm{pred}}(\cdot) , where input feature x_{i,7} represents the latitude-longitude coordinates, we calculate the partial dependence effect of a location (\lambda,\phi) as \mathrm{PD}(\lambda,\phi)=\frac{1}{|\mathcal{D}^{\mathrm{FR}}|}\sum_{\boldsymbol{x}_{i}\in\mathcal{D}^{\mathrm{FR}}}f_{\mathrm{pred}}(x_{i,1},\ldots,x_{i,6},(\lambda,\phi)). (6) When using a prediction model with the spatial embedding of latitude-longitude coordinates as input feature, as calculated via the encoder f^{\mathrm{LE}} , the partial dependence effect of the location (\lambda,\phi) is calculated as \mathrm{PD}(\lambda,\phi)=\frac{1}{|\mathcal{D}^{\mathrm{FR}}|}\sum_{\boldsymbol{x}_{i}\in\mathcal{D}^{\mathrm{FR}}}f_{\mathrm{pred}}(x_{i,1},\ldots,x_{i,6},f^{\mathrm{LE}}(\lambda,\phi)). (7) Let \{(\lambda_{c},\phi_{c}),\,c=1,\ldots,6\,048\} denote the latitude–longitude coordinates of the centroids of the 6\,048 postal codes in France. For each coordinate pair, we compute the partial dependence effect, which results in a spatial map showing how location influences the predicted real estate price. Figure 14 : Partial dependence effect of location on real estate price, calculated per postal code for predictions from the GLMs. The left-hand side is the model using latitude-longitude coordinates as input features, and the right-hand side is the model using spatial embeddings instead of latitude-longitude. We use the EU32_GS96_OSM32 model to extract spatial embeddings. Figure 14 shows the partial dependence effect as calculated with the GLM. The left-hand side shows the effect of the GLM using latitude and longitude as input features as defined in Equation ( 3 ); the right-hand side shows the GLM using the spatial embedding vector as input features. The GLM using latitude and longitude shows a negligible partial dependence effect, with each postal code having a very similar average predicted price. This is in line with the variable importance plots in Figure 13 , which indicate that the variables latitude and longitude are not important in this GLM. By contrast, the partial dependence effect for the GLM using spatial embeddings shows higher predicted prices around Paris and in the south-east and south-west regions of France, with a further effect visible on the island of Corsica. This demonstrates that the GLM can capture more nuanced patterns through spatial embeddings than it can solely based on latitude and longitude coordinates. Figure 15 shows the partial dependence effect per postal code as calculated with the GAM. The left-hand side displays the GAM using latitude and longitude as input, as described in Equation ( 4 ). Compared to the GLM, the bivariate smoothing on the coordinates produces a more nuanced spatial pattern, with higher predicted prices around Paris and in the south-east and south-west regions. The right-hand side shows the GAM using spatial embeddings as input. In this case, the model captures more complex spatial variation, distinguishing between urban centres and rural areas. Figure 15 : Partial dependence effect of location on real estate price, calculated per postal code for predictions from the GAM. The left-hand side is the model using latitude-longitude coordinates as input features, and the right-hand side is the model using spatial embeddings instead of latitude-longitude. We use the EU32_GS96_OSM32 model to extract spatial embeddings. Figure 16 shows the partial dependence effect of the GBM using latitude-longitude as input features on the left and using the spatial embeddings on the right-hand side. For both the GBM using latitude-longitude and the GBM using spatial embeddings, we see a difference between cities in France and rural areas. The GBM using latitude-longitude, however, shows a square pattern caused by the linear splits made by the regression trees in the GBM ( 22 ; 13 ) . The partial dependence effect from the GBM using spatial embeddings does not show these square artifacts and shows the shapes of cities more clearly. Figure 16 : Effect of location on average predicted real estate price, calculated per postal code for predictions from the GBMs. The left-hand side is the model using latitude-longitude coordinates as input features, and the right-hand side is the model using spatial embeddings instead of latitude-longitude. We use the EU32_GS96_OSM32 model to extract spatial embeddings. Fine-grained partial dependence effects Instead of one coordinate pair per postal code, we define a fine-grained set of locations in the area between Lyon and Switzerland. We randomly sample a set of 10\,000 locations in this area. By calculating the partial dependence effect for this set of locations, we identify fine-grained effects in the relationship between location and predicted prices. We calculate the partial dependence effect for each location following Equation ( 7 ) using the GBM. Figure 17 : Partial dependence effect from the GBM model using spatial embeddings calculated in a selected area of France between Lyon and Switzerland. The used spatial embedding model is the EU32_GS96_OSM32 model. The selected area is indicated on the small map of France on the bottom left. The left-hand side shows the partial dependence effect calculated on the level of postal codes, and the right-hand side shows the partial dependence effect calculated on 10\ 000 randomly sampled points in the selected area. Figure 17 shows the partial dependence effects. The left-hand side displays results at the postal code level, while the right-hand side shows the fine-grained set of locations. Three localised patterns appear in the fine-grained map that are not visible at the postal code level, highlighted by red ovals. The first is a small, oblong area with higher predicted prices, corresponding to the touristically popular northwestern slopes of the Aravis range. The second is a wide oblong area with lower predicted prices, coinciding with the La Lauzière range. The La Lauzière mountain range is primarily not used for tourism and houses only a few resorts or ski areas. The third is an angular pattern of higher predicted prices matching the Le Trois Vallées area. This is the largest connected ski area in the world and is highly touristic. These examples demonstrate that the GBM has fitted a relationship between real estate prices and the spatial information captured in the spatial embeddings. Transfer learning based on spatial embeddings We compare the GBM’s capacity for spatial transfer learning between the model using latitude–longitude coordinates and the model using spatial embeddings. Spatial transfer learning refers to a model’s ability to produce accurate predictions in regions outside the spatial domain of its training data. The coordinate-based model can only extrapolate based on geographic position, whereas the embedding-based model can adapt more effectively by leveraging the spatial characteristics represented by the embeddings in the unseen region. We examine this effect by analysing the partial dependence for postal codes in the departments Bas-Rhin, Haut-Rhin, and Moselle, which are excluded from the French real estate dataset. Figure 18 : Selected area in France between the city of Nancy and the German border, as indicated on the inset map (bottom left). The left panel shows the empirically observed average transaction price per postal code, where white corresponds to postal codes without observations in the dataset, namely in the departments Bas-Rhin, Haut-Rhin, and Moselle. The middle panel shows the partial dependence effect calculated with the GBM using latitude and longitude as input. The right panel shows the partial dependence effect from the GBM using spatial embeddings. The grey line marks the boundary between regions included in the training data and regions without observations. The first panel of Figure 18 shows the empirical mean transaction price per postal code in the region between Nancy and the German/Swiss border; a map of France in the lower left highlights the selected area. A grey line marks the spatial extent of the training data, and postal codes in white indicate areas absent from the dataset. The second panel shows the partial dependence (PD) for this region obtained from the GBM using latitude and longitude as inputs. Because the excluded departments lie beyond the range of latitude and longitude values present in the training data, the GBM cannot form new splits in these areas. Instead, the model extrapolates by assigning these unseen locations to the nearest regions learnt during training, resulting in an unrealistic, piecewise-constant partial dependence effect. The third panel shows the partial dependence effect obtained from the GBM using spatial embeddings as input features. Here, the model captures a lower partial dependence effect in the central part of the region and a higher effect along the Swiss border. Both patterns are intuitive: the central area is predominantly rural with lower population density, whereas larger cities, such as Strasbourg, are located along the border. By using spatial embeddings, the model associates predictions with spatial characteristics rather than with absolute coordinates. This representation supports spatial transfer learning, enabling the model to generalise to unseen regions by exploiting similarities in spatial structure through the spatial embeddings. 5 Conclusion In this paper, we introduced a framework for constructing spatial embeddings using contrastive learning in a multi-view setting. To demonstrate the multi-view spatial embedding model, we combined satellite imagery and OpenStreetMap tags to learn low-dimensional representations of geographic locations. These embeddings are trained to align with coordinate-based encodings, allowing any dataset with latitude–longitude information to be enriched with spatial context without requiring direct access to the original spatial inputs. The paper is accompanied by a GitHub repository at https://github.com/freekholvoet/MultiviewSpatialEmbeddings , which provides the code for training the spatial embedding model. The trained models defined in Table 1 are available in 24 . We demonstrated the practical value of these embeddings in a real estate pricing application. Replacing raw coordinates with spatial embeddings consistently improved predictive performance across GLMs, GAMs, and GBMs. The embeddings captured spatial structure more effectively than traditional location features and provided interpretable spatial effects. Variable importance and partial dependence analyses showed that the embeddings learnt meaningful geographic patterns, including urban–rural differences, regional economic variation, and fine-grained effects related to topography and land use. These effects are difficult to model using raw coordinates or categorical location indicators such as postal codes. Moreover, the use of spatial embeddings enabled models to generalise to regions not seen during training by associating predictions with spatial characteristics rather than coordinates. This property is particularly relevant for insurance applications, where actuaries often need to assess risk in new or underrepresented areas. From an actuarial modelling perspective, spatial embeddings offer a flexible and scalable way to incorporate geographic information into pricing models. They overcome the limitations of entity embeddings and spatial smoothing methods and can be used in combination with other modelling techniques. The embeddings are smooth, transferable, and computationally efficient, making them suitable for large-scale applications in insurance analytics. A further advantage of the proposed framework is that it can be trained on modest computational hardware and easily adapted to new regions or additional spatial data sources, making it practical for in-house deployment at insurance companies and other organisations. This work represents a step toward integrating the principles of foundation models into actuarial science. By demonstrating how multimodal spatial pretraining produces reusable embeddings that enhance predictive accuracy and generalise across space, we show that actuaries can benefit from adopting foundation-model approaches. Just as language and vision models have been transferred to countless downstream tasks, spatial foundation models can serve as general-purpose representations that can be adapted for pricing, reserving, portfolio analytics, and emerging climate-related risks. While recent global-scale spatial foundation models, such as AlphaEarth, illustrate what is possible at the planetary scale, our work highlights a complementary direction: lightweight, region-specific spatial embeddings that can be retrained quickly, incorporate organisation-specific spatial views, and capture fine-grained local structure that global models may overlook. We encourage the actuarial community to explore and experiment with such models, to evaluate how pretrained spatial representations can be transferred across products, regions, and lines of business, and to impute domain expertise in shaping foundation models that are both scientifically rigorous and practically relevant for risk management. Declaration of interest statement The authors declare no potential conflicts of interest. Supplemental material The code to train the model architecture can be found via the Github repository: https://github.com/freekholvoet/MultiviewSpatialEmbeddings . The trained models, as defined in Table 1 , are available in 24 . Appendix A OpenStreetMap tags per category Table 4 lists the OpenStreetMap tags used in each of the six categories as defined in Section 2 . Each category lists the tag type, as defined by OpenStreetMap, along with the names of the tags collected per type. Table 4 : The OpenStreetMap tags, with the tag type, for each of the six categories defined in Section 2 . † † nicematrix-placeholder: NiceTabular (nicematrix) Appendix B Hyperparameter selection Hyperparameter selection for the spatial embedding model was carried out during model construction. As the embeddings are trained in a self-supervised manner, their quality cannot be directly evaluated using standard predictive metrics. Instead, the aim was to identify configurations that produced stable training behaviour and embeddings containing spatially informative structure. A range of model configurations was tested for the OpenStreetMap encoder, location encoder, and fusion layer, varying the number of filters, neurons, and learning rates. Each configuration was pretrained for a fixed number of epochs and evaluated on two criteria. First, the contrastive loss (CLIP loss) was monitored to ensure stable convergence. Second, the resulting embeddings were applied in small-scale downstream tasks, such as logistic regression for country classification and a regression model for population density prediction. For both downstream tasks, we compared the performance of models with the embedding vector as input versus those with latitude and longitude coordinates. Configurations showing both stable loss behaviour and high downstream classification accuracy were retained. The final hyperparameter values, reported in Section 3.4 , combine established settings from 27 with those identified through these preliminary tests. Smaller convolutional architectures ( 8 and 16 filters of size k=1 ) and a 128 -neuron fusion layer yielded consistent results, while larger models offered limited improvement and less stable optimisation. As in most self-supervised learning setups, the hyperparameter selection is therefore empirical, guided by training stability and representational quality rather than formal optimisation. Appendix C Land use classification codes Table 5 lists all land use codes in the dataset in Section 4.1 . The original description in French is given, along with a translation. Table 5 : Land-use classification codes for the variable code_nature_culture in the dataset introduced in Section 4.1 . The original French description is provided alongside the English translation. † † nicematrix-placeholder: NiceTabular (nicematrix)