Poly2Vec is a unified encoding framework that encodes points, polylines, and polygons into a fixed-length representation for spatial reasoning tasks.
Our approach is presented in the following paper accepted to ICML 2025:
Poly2Vec: Polymorphic Fourier-Based Encoding of Geospatial Objects for GeoAI Applications
Maria Despoina Siampou, Jialiang Li, John Krumm, Cyrus Shahabi, Hua Lu
📄 Check out the paper
We recommend using a Conda environment with Python ≥ 3.9:
conda create -n poly2vec python=3.9
conda activate poly2vec
Then install the dependencies:
pip install -r requirements.txt
We utilized two OpenStreetMap (OSM) datasets in our evaluation: Singapore and New York. The required data can be downloaded from Geofabrik.
- Points (POIs):
amenity
,shop
,tourism
,leisure
- Polylines (Roads):
motorway
,trunk
,primary
- Polygons (Buildings):
building
-
Place the downloaded
.osm.pbf
files into the./data/
directory. -
Run the preprocessing script to extract and normalize geometries:
python utils/data_preprocessing.py
his will generate the following files inside each dataset folder:
poi_normalized.pkl
roads_normalized.pkl
buildings_normalized.pkl
Run the following script:
python utils/data_generation.py
You will get files like polygon_polygon_topological_relationship_data.pt
in each dataset's folder.
Specify your training setup in the config.json
file.
To train a model on the New York polygon-polygon topological relation dataset using Poly2Vec:
python run.py \
-dataset_name "NewYork" \
-dataset_type1 "polygons" \
-dataset_type2 "polygons" \
-task "multi-relation" \
-data_file "./data/NewYork/polygon_polygon_intersect_data.pt" \
-encoder_type "poly2vec" \
-data_path "./data/NewYork" \
-num_classes 6
If you found Poly2Vec
useful, please consider citing us:
@inproceedings{
siampou2025polyvec,
title={Poly2Vec: Polymorphic Fourier-Based Encoding of Geospatial Objects for Geo{AI} Applications},
author={Maria Despoina Siampou and Jialiang Li and John Krumm and Cyrus Shahabi and Hua Lu},
booktitle={Forty-second International Conference on Machine Learning},
year={2025},
url={https://openreview.net/forum?id=kWyov6XrXs}
}