This project visualizes city road graphs using data from OpenStreetMap. It utilizes OpenGL and GLFW for rendering, providing an interactive 3D visualization of urban road networks.
- Python 3.x
- C++17 compatible compiler
- CMake (3.10 or later recommended)
- osmnx
- json
- OpenGL
- GLFW
- GLM (OpenGL Mathematics)
- GLAD
- Install Python and pip:
sudo apt-get update
sudo apt-get install python3 python3-pip
- Install required Python libraries:
pip3 install osmnx json
- Install CMake and necessary development libraries:
sudo apt-get install cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
- Clone the repository:
git clone https://github.com/yourusername/city-road-graph-visualizer.git
cd city-road-graph-visualizer
The application has not been tested on macOS or Windows. The setup process may be similar to Ubuntu, but additional steps might be required. Contributions for installation instructions on these platforms are welcome.
-
Configure the visualization: Edit the
config.txt
file to set desired parameters such as city, node size, edge size, and some other configuration. -
Import and parse OpenStreetMap data:
python3 import/main.py
This will generate nodes.txt
and edges.txt
files with the necessary data for visualization.
- Build and run the project:
mkdir build
cd build
cmake ..
cmake --build . --target run
When the application is running, the following controls are available:
- WASD keys: Move around
- Up/Down arrow keys: Zoom in/out
- Left/Right arrow keys: Roll the camera
- R key: Reset camera view
To clean up build files:
rm -rf build/*
To rebuild and run after cleanup, follow step 3 in the Usage section.
If you encounter any issues, please check the following:
- Ensure all dependencies are correctly installed
- Verify that the
config.txt
file is properly configured - Check that the Python script successfully generated the
nodes.txt
andedges.txt
files
If problems persist, please open an issue on the project's GitHub page.
The application uses the osmnx library to fetch data from OpenStreetMap. As such, it is subject to the limitations of both osmnx and OpenStreetMap. Very large cities or complex road networks may cause performance issues or fail to load properly.
Contributions to this project are welcome, especially for improving compatibility with different operating systems. Please follow these steps:
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to the branch
- Create a new Pull Request
- OpenStreetMap contributors for providing the map data
- GLFW, GLAD, and GLM projects for graphics and mathematics libraries
- osmnx library for facilitating OpenStreetMap data retrieval
For issues, feature requests, or questions, please open an issue on the project's GitHub