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 poly2vecThen install the dependencies:
pip install -r requirements.txtWe provide a link to the preprocessed data used for all the experiments (including RegionDCL)
https://drive.google.com/drive/folders/119KvtA1K9CbII6TMMSPXkd1Yjrxhv9-P?usp=sharing
We also describe the preprocessing steps followed to obtain the data:
We utilized two OpenStreetMap (OSM) datasets in our evaluation: Singapore and New York. The required data can be either downloaded from Geofabrik, or programmatically using OSMnx.
- Points (POIs): amenity,shop,tourism,leisure
- Polylines (Roads): motorway,trunk,primary
- Polygons (Buildings): building
pois_sg = ox.geometries_from_place("Singapore", tags={"amenity": True, "shop": True, "tourism": True, "leisure": True})
- 
Place the downloaded .osm.pbffiles into the./data/directory.
- 
Run the preprocessing script to extract and normalize geometries: 
python utils/data_preprocessing.pyThis 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.pyYou 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 6If you found Poly2Vec useful, please consider citing us:
@inproceedings{siampoupoly2vec,
  title={Poly2Vec: Polymorphic Fourier-Based Encoding of Geospatial Objects for GeoAI Applications},
  author={Siampou, Maria Despoina and Li, Jialiang and Krumm, John and Shahabi, Cyrus and Lu, Hua},
  booktitle={Forty-second International Conference on Machine Learning},
  year={2025}
}