CatTracks is an intelligent transit route optimization system designed for Merced County public transportation. The system combines Geographic Information Systems (GIS) data processing with advanced graph algorithms to provide optimal route planning for bus transit users.
- Smart Route Planning: Find optimal paths combining walking and bus transportation
- Real-time Address Lookup: Geocoding using Google Maps API with local database fallback
- Multi-modal Transportation: Seamlessly integrate walking and bus routes
- GIS Data Integration: Process geographical data from GeoPackage files
- Distance Optimization: Calculate shortest paths using Dijkstra's algorithm
- Interactive Route Generation: Step-by-step directions with distance and time estimates
- Installation
- Quick Start
- Project Structure
- Usage Examples
- API Documentation
- Configuration
- Contributing
- License
- C++ Compiler: GCC 9+ or Clang 10+ with C++17 support
- Python: 3.8 or higher
- CMake: 3.15 or higher
- vcpkg: For C++ package management
- Git: For version control
# Install vcpkg dependencies
vcpkg install cpr nlohmann-jsonpip install -r requirements.txtRequired Python packages:
geopandaspandasnumpyrequestsfiona
-
Clone the repository:
git clone https://github.com/suchithgali/CatTracksWebsite.git cd CatTracks -
Configure CMake:
mkdir build cd build cmake -DCMAKE_TOOLCHAIN_FILE=[path-to-vcpkg]/scripts/buildsystems/vcpkg.cmake .. -
Build the project:
make -j$(nproc)
# Use the automated setup script
./scripts/setup_api_keys.sh
# OR set manually
export GOOGLE_MAPS_API_KEY="your_google_maps_api_key"
export OPENROUTESERVICE_API_KEY="your_openrouteservice_api_key"cd src/python
python address_lookup.py # Generate address databasepython find_nearest.py
# Enter starting address: MERCED MALL TARGET
# Enter destination address: UC MERCEDcd ../../build
./c1_graph_buildercat ../output/optimal_route_path.txtCatTracks/
βββ README.md # Project documentation
βββ LICENSE # License file
βββ CMakeLists.txt # CMake configuration
βββ .gitignore # Git ignore rules
βββ requirements.txt # Python dependencies
β
βββ src/ # Source code
β βββ cpp/ # C++ implementation
β β βββ c1_graph_builder.cpp
β β βββ graph_builder.cpp
β β βββ multi_stop_graph_builder.cpp
β β βββ detailed_route_builder.cpp
β β βββ database_test.cpp
β βββ python/ # Python scripts
β βββ find_nearest.py
β βββ address_lookup.py
β βββ distance_converter.py
β βββ intersection_lookup.py
β βββ layer_lookup.py
β βββ remove_duplicates.py
β
βββ include/ # Header files
β βββ Graph.h
β βββ Node.h
β βββ Edge.h
β βββ ArrayList.h
β βββ LinkedList.h
β βββ json.hpp
β
βββ data/ # Data files
β βββ all_addresses.csv
β βββ all_intersections.csv
β βββ all_stops.csv
β βββ road_lengths_miles.csv
β βββ route_info.json
β βββ optimal_route_results.json
β
βββ output/ # Generated output files
β βββ optimal_route_path.txt
β
βββ geopkg/ # GeoPackage files
β βββ merced_county_site_address_pointsshp.gpkg
β βββ merced_intersections.gpkg
β βββ merced_road_centerlines.gpkg
β
βββ build/ # Build artifacts (auto-generated)
βββ cache/ # API response cache
βββ docs/ # Documentation
βββ examples/ # Usage examples
βββ scripts/ # Utility scripts
βββ vcpkg/ # Package manager
# Run the route finder
python src/python/find_nearest.py
# Input:
# Starting address: 781 IRMA DRIVE
# Destination: UC MERCED
# Output: Generates route_info.json with optimal path data# Build and run multi-stop planner
./build/multi_stop_graph_builder
# Processes multiple destinations for efficient routing# Convert road lengths to miles
python src/python/distance_converter.py
# Lookup specific intersections
python src/python/intersection_lookup.pySet your API keys as environment variables:
# Set Google Maps API key
export GOOGLE_MAPS_API_KEY="your_api_key_here"
# Set OpenRouteService API key
export OPENROUTESERVICE_API_KEY="your_api_key_here"For persistent setup, add these to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
echo 'export GOOGLE_MAPS_API_KEY="your_api_key_here"' >> ~/.zshrc
echo 'export OPENROUTESERVICE_API_KEY="your_api_key_here"' >> ~/.zshrc
source ~/.zshrcConfigure GIS data sources in the respective Python scripts:
- Address data:
geopkg/merced_county_site_address_pointsshp.gpkg - Intersection data:
geopkg/merced_intersections.gpkg - Road centerlines:
geopkg/merced_road_centerlines.gpkg
Run the database test suite:
./build/database_testValidate walking logic:
python src/python/test_walking_logic.py- Route Calculation: < 500ms for typical routes
- Address Lookup: < 100ms with local database
- Memory Usage: ~50MB for full Merced County dataset
- Accuracy: Β±10 meters for GPS coordinates
I welcome contributions! Please see my Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- C++: Follow Google C++ Style Guide
- Python: Follow PEP 8
- Documentation: Use clear, concise comments
This project is licensed under the MIT License - see the LICENSE file for details.
- Merced County for providing GIS data
- Google Maps API for geocoding services
- UC Merced for transit route information
- Open source community for supporting libraries
- Project Maintainer: Suchith Gali
- Project Repository: CatTracksWebsite
- Issues: GitHub Issues
- trip planning integration for the remaining bus routes
- Real-time bus tracking integration
- web ui application development
- Machine learning for traffic prediction
- Multi-language support
- Accessibility features for disabled users
- Integration with other transit systems
CatTracks - Making public transportation smarter, one route at a time.