This tool helps NGOs, transit agencies, or researchers analyze GTFS (bus stop) data to:
- 🧮 Detect redundant bus stops (too close together)
- 🧭 Identify underserved areas (no stop within 400m)
- 🤖 Use LLMs (via Groq) to explain what action to take
- 🗺️ Visualize results on an interactive map
- 📄 Export results as CSV for planning or reporting
BUSDATA/
├── .env # 🔐 Groq API key
├── app.py # 📌 One-click Streamlit UI
├── busDataset_fixed.xlsx # ✅ GTFS stops with lat/lon
├── gap_detection.py # 🧭 Detect coverage gaps
├── llm_reasoning.py # 🤖 LLM suggestions
├── map_visualizer.py # 🗺️ Optional standalone map generator
├── redundant_stops_directional.py # 🔁 Redundant stop detector (with direction support)
├── redundant_stops_directional.csv # 📝 Output of redundant stop pairs
├── redundant_stops_with_llm.csv # 🤖 LLM merge suggestions
├── requirements.txt # 📦 Dependencies
├── transit_map.html # 🗺️ Optional static map preview
├── utils.py # 🔧 Shared helper functions
│
└── gtfs_data/ # 📥 Raw GTFS input files
├── routes.txt
├── stop_times.txt
├── stops.txt
└── trips.txt
Just run:
streamlit run app.pyInside the web app:
- 📤 Upload
busDataset_fixed.xlsx - 🧮 Click Detect Redundancies
- 🤖 Click Generate LLM Suggestions
- 🧭 Click Find Gaps
- 🗺️ Click Show Map
- 📄 Download CSVs as needed
# 1. Detect close stops (same route + direction)
python redundant_stops_directional.py
# 2. Generate merge suggestions via LLM
python llm_reasoning.py
# 3. Find underserved areas
python gap_detection.py
# 4. Generate interactive map (optional)
python map_visualizer.pyInstall all dependencies:
pip install -r requirements.txtContents of requirements.txt:
streamlit
streamlit-folium
pandas
folium
openpyxl
python-dotenv
shapely
requests
Create a .env file in the root with your Groq API key:
GROQ_API_KEY=your_groq_key_here| File | Description |
|---|---|
redundant_stops_directional.csv |
Pairs of stops <125m apart, same route + direction |
redundant_stops_with_llm.csv |
Suggested merges with LLM explanations |
coverage_gaps.csv |
Areas >400m from nearest stop |
transit_map.html |
Optional static map (if not using Streamlit) |