An exploration of the Extended Vehicle Energy Dataset (EVED).
Download the paper here.
This repository contains scripts and Jupyter notebooks for analyzing and processing the Extended Vehicle Energy Dataset (EVED). The project focuses on trajectory querying, map-matching, and energy consumption analysis using Python and SQLite.
- Language: Python 3.x
- Database: SQLite
- Package Manager:
pipwithpip-tools(viamakefile) - Key Frameworks/Libraries:
pandas,numpy,matplotlib(Data analysis)Cython(Performance optimizations for geometric calculations)pyquadkey2(Quadkey operations)tqdm(Progress bars)valhalla(Optional: Map-matching and routing)
- Infrastructure:
pyenv,docker(for Valhalla)
The project uses a makefile to manage the environment.
# Install Python version via pyenv, create venv, and sync dependencies
make install
# Compile Cython extensions
make cythonIf you plan to use map-matching features:
make install-valhalla
make run-valhallaFollow these steps in order to prepare the database (db/eved.db):
- Download Data: Run
01-download-data.ipynbto download and extract the EVED dataset. - Import Data: Run
02-import-data.ipynbto import CSV files into the SQLite database. - Calculate Bearings & Quadkeys:
Run the
calculate-bearings.pyscript. This calculates auxiliary columns (bearings and quadkeys) in thesignaltable../venv/bin/python calculate-bearings.py
- Calculate Trajectories:
Run the
calculate-trajectories.pyscript. This creates and populates tables for trajectory querying.Note: Both scripts will take quite a long time to run../venv/bin/python calculate-trajectories.py
Once the data is prepared, you can run the following analysis notebooks:
05-trip-estimation.ipynb: Travel time estimation using quadkeys.06-trajectory-querying.ipynb: Trajectory queries using space partitioning.07-edge-matching.ipynb: Map-matching analysis.08-road-network-analysis.ipynb: Road network exploration.
calculate-bearings.py: Calculates bearings and quadkeys for signal points.calculate-trajectories.py: Builds trajectory, link, and link_qk tables for efficient spatial querying.calculate-matches.py: TODO: Describe purpose.calculate-utm.py: TODO: Describe purpose.match-trips.py: TODO: Describe purpose.path-to-h3.py: TODO: Describe purpose.
01-11-*.ipynb: Analysis and data processing notebooks.db/: Database schema definitions (JSON/SQL) and Python API (api.py).geo/: Geometric and spatial calculation modules (includes Cython code).common/: Shared utility functions.raster/: Drawing and rasterization utilities.valhalla/: Configuration and scripts for running Valhalla in Docker.makefile: Environment management and build automation.
- TODO: List any required environment variables if applicable.
- TODO: Add information about running tests once they are implemented.
This project is associated with the following articles:
- Travel Time Estimation Using Quadkeys
- Trajectory Queries Using Space Partitioning
- Map-Matching for Trajectory Prediction
- Map-Matching for Speed Prediction
See the LICENSE file for details.