GeoVectors: A Linked Open Corpus of OpenStreetMap Embeddings on World Scale

Nicolas Tempelmeier, Simon Gottschalk, Elena Demidova

Abstract

GeoVectors is a massive, open-source corpus providing pre-computed machine learning embeddings for over 980 million OpenStreetMap (OSM) entities. By capturing both the geographic locations and semantic tags of map features on a global scale, it bridges the gap between raw, heterogeneous geographic data and ready-to-use features for downstream machine learning and Semantic Web applications.

Introduction

OpenStreetMap (OSM) represents the most comprehensive source of open geographic data globally, comprising billions of nodes, ways, and relations. Despite its richness, OSM data is notoriously difficult to integrate directly into machine learning workflows. The dataset's sheer scale (over 1.4 TB) and its reliance on unstructured, free-text "tags" create significant hurdles. Unlike natural language processing (NLP) or general knowledge graphs, which benefit from standard pre-trained embeddings like BERT or TransE, geographic data has historically lacked a domain-independent, world-scale equivalent.

GeoVectors addresses this gap by providing a pre-trained corpus of OSM entity embeddings. This resource allows researchers to treat geographic features as dense vectors, facilitating their use in neural networks much like word vectors in NLP.

Methodology

The GeoVectors framework decouples the two primary dimensions of geographic data: semantics (what an entity is) and spatial location (where it is). This results in two distinct embedding types:

GV-NLE (Geographic Embeddings)

To capture spatial relationships, the authors adapted Neural Location Embeddings (NLE). They constructed a massive weighted graph where OSM entities serve as nodes. Edges connect each entity to its 50 geographically nearest neighbors, with weights determined by Haversine distance. Latent representations are learned using DeepWalk, a random walk algorithm. To accommodate new entities without full graph retraining, an encoding step averages the embeddings of an entity's nearest neighbors.

GV-Tags (Semantic Embeddings)

To handle the unstructured nature of OSM tags, the authors treated key-value pairs as text. They utilized pre-trained fastText word embeddings (trained on Common Crawl and Wikipedia) to compute a weighted average of word vectors for the keys and values associated with each entity. This approach leverages sub-word information to handle the diverse and often messy tagging conventions in OSM.

The GeoVectors generation pipeline, illustrating the training and encoding phases for OSM snapshots.

Knowledge Graph Integration

To ensure semantic interoperability, the embeddings are integrated into an RDF Knowledge Graph. This includes a SPARQL endpoint and identity links to external datasets such as Wikidata and DBpedia, aligning GeoVectors with Semantic Web standards.

The GeoVectors Corpus

The resulting GeoVectors Corpus contains embeddings for over 980 million OSM entities across 180 countries. It is based on OSM country-level snapshots from late 2020 and is published under an Open Database License. This world-scale resource provides a standardized foundation for geographic machine learning tasks.

Evaluation and Results

The utility of GeoVectors was validated through two primary case studies designed to test the separation of spatial and semantic information.

  1. Type Assertion (Semantics): Predicting the Wikidata class of an OSM entity (e.g., "church building"). Using a Multilayer Perceptron (MLP), the GV-Tags embeddings achieved an 85.95% F1-score, whereas the spatial GV-NLE embeddings performed poorly (41.69% F1). This confirms that GV-Tags effectively captures entity meaning.
  2. Link Prediction (Spatial): Predicting an entity's country of origin. In this task, GV-NLE embeddings excelled, reaching a 96.03% F1-score with an MLP. In contrast, GV-Tags performed poorly (25.39% F1), demonstrating that GV-NLE accurately encodes geographic boundaries.
Performance metrics for the Link Prediction (Spatial) task, comparing GV-Tags and GV-NLE embeddings.

Key Insights

  • Bifurcated Representation: Geographic entities require separate spatial and semantic vectors. A "coffee shop" in London and one in Sydney are semantically identical but spatially unrelated. Decoupling these allows downstream models to prioritize the relevant feature space.
  • NLP Effectiveness on Tags: Simple aggregation of sub-word aware NLP embeddings (fastText) is surprisingly effective at capturing the semantics of unstructured map tags.
  • Graph-Based Geography: Treating geographic proximity as a graph problem allows standard network embedding techniques to map the physical world into a dense vector space successfully.

Conclusion and Future Work

While the current GeoVectors V1.0 corpus is based on 2020 data, the authors have open-sourced the generation framework to allow for regular updates. Future work includes using GeoVectors to enrich general-purpose knowledge graphs and supporting complex spatio-temporal analytics, such as mobility prediction and location-aware recommendation systems. By providing a world-scale, ready-to-use geographic feature set, GeoVectors significantly lowers the barrier to entry for advanced geographic data science.

Summary updated

BibTeX
@inproceedings{tempelmeier2021geovectors,
  author = {Nicolas Tempelmeier and Simon Gottschalk and Elena Demidova},
  title = {{GeoVectors: A Linked Open Corpus of OpenStreetMap Embeddings on World Scale}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2021},
  doi = {10.1145/3459637.3482004},
}
Figure