Skip to content

Project that demonstrates the difference in performance between two pathfinding algorithms: Dijkstra and A* search.

Notifications You must be signed in to change notification settings

macronym/osm_router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo Video

https://youtu.be/r-YQiXv5MA8

Proposal Gdoc:

Links to download CSV data for building the database:

Instructions for setting up the repo

programming languages

  • c++ 17 is required.
  • python 3.12 is required.

setting up directories

  1. clone the repo into a directory on your computer.
  2. create a folder named data in the project root.
  3. put the edges_bboxed.csv and nodes_bboxed.csv files into the data dir.
  4. create a folder named db in the project root.
  5. create a folder named dist in the project root. This is where you should direct your build system to put compiled binaries.

dependencies

  • the Python tqdm package is used to display loading bars on the script that builds the database, it will need to be installed with pip install tqdm
  • You will need to install SFML so that #include <SFML/Graphics.hpp> etc.. works.
  • sqlite3 should be installed on your system so that sqlite_orm works (sqlite_orm needs to be able to do #include <sqlite3.h>).
  • Configure your build tool to also include the packages in the include/ directory, the header files for tomlplusplus and sqlite_orm live here.
  • When compiling, you need to link all of the required libraries. Example build command: gcc -std=c++17 -g src/*.cpp -o dist/app.out -lsfml-graphics -lsfml-window -lsfml-system -lsqlite3 -Iinclude/. This command will link all of the required SFML components, link sqlite3, and add all of the packages in the include/ directory.

creating the database

  • Below is an exmaple Makefile that defines tasks for building the DB. Since the CSV data linked above is already filtered to Florida only, you do not need to run the filter_csv command.
  1. Create the db by running the create_db make command
  2. Populate the db by running the fill_db command (make take ~15 minutes)
  3. Remove unused edges and nodes by running the clean_db command, this removes bike and walking paths from the database (only car accessible roads are used)
  • after these steps, the db directory should contain a sqlite database that is ready to use by the app.
osm4routing: # converts pbf to nodes.csv and edges.csv
	cd ./data && osm4routing us-south-latest.osm.pbf

filter_csv: # filter nodes/edges to the lat/lon bbox defined in the py file
	python ./dev/scripts/filter_to_bbox.py

create_db:
	python ./dev/scripts/create_db.py

fill_db:  # fill the database with node/edge data from the CSV's defined in the populate_db.py file
	python ./dev/scripts/populate_db.py

clean_db:
	python ./dev/scripts/cleanup_db.py

Technical diagrams

chunking and viewport

chunk model viewport model viewport buffer

coordinate systems

displaycoordmodel geocoordmodel

About

Project that demonstrates the difference in performance between two pathfinding algorithms: Dijkstra and A* search.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.5%
  • Python 1.5%