An algorithm and a Java application to help users find the best route from one location to another on the University of Ghana (UG) campus
# UG-Navigation
An algorithm and Java application to help users find the best route from one location to another on the University of Ghana (UG) campus.
## Setup
### Prerequisites
- **Python 3.6+** (for generating road graph CSV files)
- **JDK 17+** (for compiling and running Java)
Verify your tools:
```bash
python --version
javac -version
java -version
```
If `javac`/`java` is not found, install a JDK and add its `bin` folder to your PATH.
## Quick Start (Recommended)
Run from the project root.
### 1) Build road graph data
```bash
python scripts/build_road_graph.py --geojson "export (3).geojson" --mode drive
```
This creates:
- `data/road_drive_nodes.csv`
- `data/road_drive_edges.csv`
### 2) Compile Java sources
```bash
javac -d . src/ug/campus/*.java
```
### 3) Run the app
```bash
java -cp . ug.campus.Main
```
You will be prompted for:
- source name
- destination name
- optional landmark keyword
### Non-interactive use
POI names are resolved first and then snapped to the selected road graph, so POI
IDs are never used directly as road-node IDs. Use flags for scripts and tools:
```bash
java -cp . ug.campus.Main --mode walk --from "Commonwealth Hall" --to "Balme Library" --via "Great Hall" --format json
```
Available options: `--mode drive|walk`, `--from `, `--to `,
`--via `, and `--format text|json`. `--from` and `--to` must be
provided together; otherwise the app uses the interactive prompts.
## Platform Notes
### Windows PowerShell (optional JAVA_HOME usage)
If you prefer using `JAVA_HOME` directly:
```powershell
$env:JAVA_HOME = 'D:\jdk-26.0.2'
& "$env:JAVA_HOME\bin\javac" -d . src/ug/campus/*.java
& "$env:JAVA_HOME\bin\java" -cp . ug.campus.Main
```
### Linux/macOS
If Java is installed and on PATH, the same `javac` / `java` commands above work directly.
## Behavior Notes
- `Main` loads the requested drive or walk graph (`road_drive_*` or `road_walk_*`).
- If a place name does not match exactly, the app suggests similar names.
## N …