wikillm

Paper · 2021-11-07 · cs.LG

A Review of Location Encoding for GeoAI: Methods and Applications

Survey of location encoders, which turn a point's coordinates into a learned embedding for GeoAI models. It groups single-point encoders (discretization, direct, sinusoidal, multi-scale) and neighbourhood aggregation encoders (kernel, global, local, hierarchical) under one formulation, and compares them on multi-scale, distance and direction properties. No experiments of its own.

Location encoderPositional encodingGraph neural networkgeospatiallocation-encodingsurvey

arXivPDFMarkdown11 min read

AI-compiled by claude-haiku-5-5 on 2026-11-12, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Neural networks work with numbers, but a place on Earth is just a latitude and a longitude, and two raw numbers say little about what is nearby or in which direction. A location encoder is a small network that turns a point into a longer list of numbers, called an embedding, so that a larger model can learn from it more easily. Researchers have built many such encoders, and each one does this in a different way.

This review sorts those encoders into groups. Some look only at the point itself. Some cut the map into tiles, some use wave patterns at several zoom levels, and some also look at the other points around it. The review asks which of them keep nearby places looking alike, which ones respect direction, and which ones can be reused for new places without retraining. It also sketches how the same idea can be used for lines, shapes, networks and images.

TL;DR

  • A location encoder maps a 2D or 3D point to an embedding, so that a downstream model can be simpler and need less data §1, §3.
  • Encoders split into single-point ones, which use only the point, and aggregation ones, which also pool a neighbourhood §4.
  • The authors check each encoder for four traits: whether it has a fixed number of learnable parameters, whether it works at several scales, whether it keeps nearby points close, and whether it responds to direction. Most of these judgements are empirical, not proofs §4.3, tab. 1.
  • The paper has no experiments of its own and no code. Use it as a map of the design space, then read the cited papers for numbers §6.

Problem

Many GeoAI tasks need a model to read a location, such as a sensor site, a species occurrence or a point of interest. Raw coordinates often give a complicated decision surface that a simple learner cannot fit well. Encoding the location first lets a simple model work with less training data §1, fig. 1, §3. The paper argues that kernel methods need their kernel centres stored at inference time, and that neural networks need much domain knowledge to be designed with low bias and low variance at once §3.

Two properties are proposed as desirable: distance preservation, meaning nearby locations get similar embeddings, and direction awareness, meaning that locations in similar directions from a reference point get similar relative embeddings §2, fig. 2. The paper also asks encoders to be inductive, so that a trained encoder can embed unseen locations without retraining, and task independent §2.

Method

The review gives one formulation for each of its two categories §4. It then classifies the published encoders under them. The steps below follow the paper's own structure.

  1. Single-point encoder. The embedding of a location x is a learnable network applied to a position embedding psi(x). The position embedding is a deterministic function of x that normalises or expands the coordinates §4.1, eq. 1. The learnable part is usually a multi-layer perceptron. One variant uses a deeper block with residual connections §4.1.
  2. Discretization. psi(x) is a one-hot indicator of the grid cell that x falls into. The one-hot variant uses the identity as its learnable part. The tile variant replaces it with a trainable embedding table, one row per cell §4.1.1.
  3. Direct. psi(x) is the normalised coordinate pair itself. Different works normalise differently, for example to [-1, 1) by a constant, by the centroid of a trajectory, or to [0, 1] §4.1.2.
  4. Sinusoidal. The Mac Aodha-style encoder wraps longitude and latitude with sine and cosine functions, scaling each to [-1, 1] first §4.1.3, eq. 2. The review notes that wrapping makes the two poles identical §4.1.3.
  5. Multi-scale sinusoidal. psi(x) concatenates, for each scale s from 0 to S-1, sine and cosine features of x at a frequency set by s §4.1, eq. 3. Three concrete versions are given:
    • Transformer-style: frequency base S, with exponent (s+1)/S §4.1.4, eq. 4.
    • Theory (Space2Vec): project x onto three unit vectors 120 degrees apart, and use wavelengths that grow geometrically from a minimum to a maximum scale §4.1.4, eq. 5. This variant is limited to 2D.
    • Grid (Space2Vec): the same wavelengths, applied to each coordinate separately, so it works in any dimension §4.1.4, eq. 6.
  6. Aggregation encoder. The encoder starts from any single-point embedding. Each of M layers pools the previous-layer embeddings of a neighbourhood with a permutation-invariant operator, combines the result with the point's own embedding, and a final readout produces the output §4.2, eq. 7. Neighbourhoods can be the k nearest points, all points within a radius, the points in the same voxel, or all points §4.2.
  7. Kernel. The neighbourhood is a fixed set of q centres. The feature vector is the kernel value between x and each centre, and an MLP reads it. The RBF version draws its centres from the training points. The GPS2Vec version places centres on grid cells inside UTM zones and uses an exponential kernel §4.2.1.
  8. Global. The neighbourhood is the whole point set. PointNet embeds each point, applies a shared MLP per point, takes an element-wise max over the set, and concatenates the result back with each point's embedding §4.2.2, eq. 7.
  9. Local. The neighbourhood is a radius, a voxel or the k nearest points. VoxelNet pools points inside each voxel with max pooling and concatenates the result §4.2.3. The spatial-aware graph attention model (SAGAT) weights each neighbour by a softmax over attention scores that take the centre's and the neighbour's embeddings and the encoded displacement x - x_i as input. Several heads are averaged, and the review generalises the original model to several layers §4.2.3, fig. 4. The dynamic graph CNN (DGCNN) recomputes its k nearest neighbours in embedding space at each layer and applies an edge convolution §4.2.3.
  10. Hierarchical. A point set encoder samples a subset per level, groups neighbours around each sampled point and aggregates them. A decoder then interpolates features back to all points, in a U-Net-like shape. PointNet++, PointCNN and a graph-convolutional GAN follow this pattern §4.2.4, fig. 5.
  11. Comparison. The review tabulates each encoder on dimension, parametric or not, multi-scale or not, distance preservation and direction awareness §4.3, tab. 1. It also notes that adding a location encoder inside a graph model as the node encoder is a simple way to add spatial information §5.3.

Pseudocode below is a sketch in our own words. Each line that corresponds to a formula in the paper cites its source.

Pseudocode
# Single-point location encoder  [§4.1, eq. 1]
# Input: location x (2 or 3 coordinates); output: embedding of size d

def single_point_encoder(x, position_encoder, learnable_net):
    # 1. Map the raw location to a position embedding  [§4.1]
    position = position_encoder(x)
    # 2. Map the position embedding to the location embedding  [§4.1]
    return learnable_net(position)
Pseudocode
# Discretization encoder  [§4.1.1]
# one-hot variant: learnable_net is the identity
# tile variant: learnable_net is a trainable table with one row per tile

def discretization_encoder(x, tiles, table=None):
    # 1. Find the id of the tile that contains x  [§4.1.1]
    tile_id = tile_lookup(x, tiles)
    # 2. One-hot vector over all tiles  [§4.1.1]
    one_hot = indicator(tile_id, num_tiles=len(tiles))
    # 3. Identity for one-hot, trainable row for tile  [§4.1.1]
    if table is None:
        return one_hot
    return table[tile_id]
Pseudocode
# Sinusoidal wrap of longitude and latitude  [§4.1.3, eq. 2]

def sinusoidal_position(lon, lat):
    # 1. Scale longitude from [-180, 180] to [-1, 1]  [§4.1.3, eq. 2]
    lon_scaled = lon / 180.0
    # 2. Scale latitude from [-90, 90] to [-1, 1]  [§4.1.3, eq. 2]
    lat_scaled = lat / 90.0
    # 3. Sine and cosine of pi times each scaled value  [§4.1.3, eq. 2]
    return [
        sin(pi * lon_scaled), cos(pi * lon_scaled),
        sin(pi * lat_scaled), cos(pi * lat_scaled),
    ]
Pseudocode
# Multi-scale position encoder, grid variant  [§4.1.4, eq. 6]
# Input x: (dim,), dim in {2, 3}; scales s = 0 .. S-1; S >= 2 is required
# Output: (S * 2 * dim,)

def grid_position(x, num_scales, min_scale, max_scale):
    # 1. Ratio between the largest and smallest scale  [§4.1.4]
    ratio = max_scale / min_scale
    features = []
    for s in range(num_scales):
        # 2. Wavelength of scale s, growing geometrically  [§4.1.4, eq. 6]
        wavelength = min_scale * ratio ** (s / (num_scales - 1))
        for coordinate in x:
            # 3. Scale each coordinate by the wavelength  [§4.1.4, eq. 6]
            phase = coordinate / wavelength
            features += [cos(phase), sin(phase)]
    return features
Pseudocode
# Multi-scale position encoder, theory variant (2D only)  [§4.1.4, eq. 5]
# Input x: (2,); output: (S * 6,)

def theory_position(x, num_scales, min_scale, max_scale):
    # 1. Three unit vectors 120 degrees apart  [§4.1.4, eq. 5]
    directions = [unit(0), unit(120), unit(240)]
    # 2. Ratio between the largest and smallest scale  [§4.1.4]
    ratio = max_scale / min_scale
    features = []
    for s in range(num_scales):
        # 3. Wavelength of scale s  [§4.1.4, eq. 5]
        wavelength = min_scale * ratio ** (s / (num_scales - 1))
        for u in directions:
            # 4. Project x on u, divide by the wavelength  [§4.1.4, eq. 5]
            phase = dot(x, u) / wavelength
            features += [cos(phase), sin(phase)]
    return features
Pseudocode
# Kernel-based encoder  [§4.2.1]
# centres: q fixed points, from the training set or a grid

def kernel_encoder(x, centres, kernel, learnable_net):
    # 1. Kernel value between x and each centre  [§4.2.1]
    kernel_features = [kernel(x, c) for c in centres]
    # 2. Learnable network reads the q kernel features  [§4.2.1]
    return learnable_net(kernel_features)
Pseudocode
# Generic aggregation encoder  [§4.2, eq. 7]
# points: the point set P (x is one of them); neighbours(p): N(p)

def aggregation_encoder(x, points, neighbours, layers, readout):
    # 1. Layer-0 embedding of every point  [§4.2, eq. 7]
    h = {p: single_point_encoder(p) for p in points}
    for layer in layers:
        # 2. Pool neighbours' previous-layer embeddings  [§4.2, eq. 7]
        pooled = {p: pool([h[n] for n in neighbours(p)]) for p in points}
        # 3. Combine each point with its pooled neighbourhood  [§4.2]
        h = {p: combine(h[p], pooled[p]) for p in points}
    # 4. Read out the final embedding of x  [§4.2, eq. 7]
    return readout(h[x])

Hyperparameters

The review is a survey and states no training setup of its own. Values below are the free parameters that the review names for each encoder. Where a paper gives a value, the review does not repeat it.

NameValueWhereNotes
number of scales Snot stated§4.1.4, eq. 3must be at least 2 in the wavelength formulas of eq. 5 and eq. 6
minimum scale lambda_minnot stated§4.1.4called the critical parameter that sets the finest resolution
maximum scale lambda_maxnot stated§4.1.4the review says it can be set from the extent of the study region
scale ratio glambda_max / lambda_min§4.1.4derived, not a free parameter
tile count M (one-hot, tile)not stated§4.1.1finer tiles need more parameters
tile count for multi-level discretizationnot stated§4.1.1the review cites a multi-level scheme without values
high-frequency components excluded for noisy datatop 10% of frequencies, per the cited work§4.1.4the review reports this for the transformer-style encoder
number of kernel centres qnot stated§4.2.1sets both memory and the MLP size
RBF bandwidth sigmanot stated§4.2.1
GPS2Vec grid and UTM zone setupnot stated§4.2.1the attenuation coefficient is named but not valued
neighbour count k (kNN, DGCNN, GCN)not stated§4.2.3, §4.2.4
attention headsnot stated§4.2.3
aggregation layers Mnot stated§4.2the original SAGAT uses one layer; the review generalises to M >= 1
neighbourhood radius rnot stated§4.2.3, §4.2.4
ViT patch size (raster)not stated§5.4named as important, not valued

Results

This review reports no experiments of its own. The claims below are the review's summary of other papers. They are author-reported in those papers and were not checked here.

Claim relayed by the reviewSettingSource
Multi-scale theory and grid encoders outperform tile, direct, Mac Aodha-style and RBF encodersPOI type classification and geo-aware image classification§4.3 (Mai et al., 2020)
The theory encoder outperforms the direct encodergeographic question answering§4.3 (Mai et al., 2020)
PointNet++ outperforms PointNetpoint cloud classification and segmentation§4.3 (Qi et al., 2017)
Adding time as an extra input to the Mac Aodha-style encoder gives a small gain of 0.25% to 1.37%setting not described in the review§6

Paper vs code

No official code. The paper states: "There is no code implementation for this review paper" §6, Data and Codes Availability Statement. The raw arXiv metadata has no code link. I did not run a GitHub search, because the paper's own statement settles it and searches for survey topics mostly return awesome-lists, which are not code.

Within the paper there are no implementation claims to compare. Formulas in §4 are the survey's generalisations. Where a variant is marked with an asterisk, the survey has changed the original model: SAGAT is generalised to several layers and to any single-point encoder §4.2.3, and the adapted kernel replaces the original's precomputed density map with a per-location bandwidth §4.2.1.

Pitfalls

  • Table 1 mixes evidence types. The distance and direction columns are the authors' judgements from response maps of trained encoders, not proofs. The only "Yes+" entry, for the theory encoder, is backed by a proof in the cited work §4.1.4, tab. 1. "-" means unknown, not "no".
  • Contradiction on the direct encoder. Table 1 marks the direct encoder as distance preserving. The comparison text, reading the same response maps, lists the direct encoder both among the distance-preserving encoders and among the ones that are not §4.3. Treat this entry as unresolved.
  • Direction awareness is partly by-product. The review notes that the direction result for the multi-scale encoder comes from visualisations, and that no theoretical proof was given §2. The direction-awareness property is stated as an inequality over inner products, and the review gives no test for it.
  • Only the compiled sections are covered. The source contains an application section and a future-work file that the main document does not include. This card follows the compiled paper: applications are reduced to the spatial data types in §5, and the future-work list is taken from §6.
  • Symbol reuse in the Transformer-style formula. The number of scales S is also used as the frequency base, and the exponent is (s+1)/S §4.1.4, eq. 4. The review does not discuss other bases.
  • Wavelength formulas divide by S-1. Eqs. 5 and 6 use S-1 in the exponent, so S = 1 is undefined there. The review does not say how that case is handled.
  • Poles collapse in the Mac Aodha-style encoder. North and South pole map to the same features, and the encoding is not spherical-distance preserving §4.1.3.
  • Neighbourhood encoders are costly. The review states that aggregation encoders are slower at inference than single-point encoders, and that adding a point changes the embeddings of its neighbours §4.3. Kernel encoders store their centres at test time and perform poorly in data-sparse areas §4.2.1.
  • No spherical distance preservation. The review states that none of the encoders it covers preserves distance on the sphere surface, and it calls for a spherical-aware design for large global data sets §5.4, §6.
  • Graph shortcuts lose direction. The review argues that building a distance-weighted graph over points drops the spatial layout and therefore direction information §5.3. This is the authors' argument, not a measured result.
  • Scope of the 2D claim. The theory encoder is inspired by grid-cell research and is defined only for 2D points §4.1.4, §4.3.

Lineage

  • Builds on: Vaswani et al. (2017), whose sinusoidal position encoding inspired the multi-scale encoders §4.1.4; the grid-cell-inspired learnable representation of Gao et al. (2018), which the theory encoder extends §4.1.4; PointNet, PointNet++, VoxelNet, GAT and DGCNN for the aggregation families §4.2.
  • Compared against: tile, direct, Mac Aodha-style, RBF kernel and GPS2Vec encoders, all in tab. 1.
  • Superseded by: not known from content in this wiki.

Source and license

Adapted from “A Review of Location Encoding for GeoAI: Methods and Applications” by Gengchen Mai, Krzysztof Janowicz, Yingjie Hu, Song Gao, Bo Yan, Rui Zhu, Ling Cai, Ni Lao (arXiv:2111.04006), used under CC0 1.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.