GitHub Repo β†’

Open Street Map Navigator

A C++ application for navigating Northwestern University’s Evanston campus using OpenStreetMap data, with real-time CTA bus arrival predictions.

Overview

This project extends an OpenStreetMap parser to provide campus navigation features including:

  • Building and amenity search functionality
  • Nearest bus stop location with real-time arrival predictions
  • Interactive command-line interface for exploring the campus map

Features

  • Search buildings by full or partial name (case-insensitive)
  • Display detailed building information including:
    • GPS coordinates
    • Street address
    • Building perimeter nodes
    • Nearest northbound and southbound CTA bus stops

πŸ” Amenity Finder

  • Browse 32+ amenity types (restaurants, cafes, fast food, banks, etc.)
  • Search amenities by type or name
  • Find nearest fast-food restaurant to any building

🚌 Real-Time Bus Tracking

  • Lists 12 CTA bus stops around campus
  • Displays nearest bus stops for each building
  • Shows live bus arrival predictions using CTA Bus Tracker API

Technical Highlights

Object-Oriented Design

  • Inheritance hierarchy: Base Entity class inherited by Amenity and Building classes
  • Data encapsulation: Private data members with public getter methods
  • Class-based organization: Nodes, Buildings, Amenities, and BusStops container classes

Performance Optimizations

  • Binary search for node lookups
  • Reduced function calls from 2M+ to ~6K for typical operations

External Integrations

  • TinyXML2 for OSM file parsing
  • CURL for HTTP requests to CTA API
  • JSON parsing (nlohmann/json) for API responses
  • OpenStreetMap data format support

Commands

b [building_name]  - Search for buildings (empty = list all)
a [amenity_type]   - Search for amenities (empty = list types)
f building_name    - Find nearest fast food to building
s                  - List all CTA bus stops
$                  - Exit program

Example Usage

** NU open street map **

# of nodes: 15070
# of buildings: 70
# of amenity types: 32
# of amenities: 96
# of bus stops: 12

Enter command (b, a, f, s, $)> b tech

Technological Institute (Tech)
 Address: 2145 Sheridan Road
 Building ID: 151960667
 Coords: (42.0584481, -87.6753818)
 Perimeter nodes:
  388499217: (42.0589553, -87.6757029)
  ...

 Nearest southbound bus stop:
  18357: Sheridan & Haven, Southbound, NW corner
    vehicle #1834 traveling Southbound to Howard is 8 minutes away
    vehicle #1729 traveling Southbound to Howard is 23 minutes away
 
 Nearest northbound bus stop:
  18355: Sheridan & Haven, Northbound, East side
    vehicle #1842 traveling Northbound to Central is 5 minutes away

Project Structure

β”œβ”€β”€ main.cpp              # Main program and command processing
β”œβ”€β”€ entity.h/cpp          # Base class for map entities
β”œβ”€β”€ building.h/cpp        # Building class implementation
β”œβ”€β”€ buildings.h/cpp       # Building container class
β”œβ”€β”€ amenity.h/cpp         # Amenity class implementation
β”œβ”€β”€ amenities.h/cpp       # Amenity container class
β”œβ”€β”€ busstop.h/cpp         # Bus stop class
β”œβ”€β”€ busstops.h/cpp        # Bus stop container class
β”œβ”€β”€ node.h/cpp            # Map node (position) class
β”œβ”€β”€ nodes.h/cpp           # Node container with efficient lookup
β”œβ”€β”€ osm.h/cpp             # OSM file parsing utilities
β”œβ”€β”€ curl_util.h/cpp       # HTTP request utilities
β”œβ”€β”€ dist.h/cpp            # Distance calculation functions
β”œβ”€β”€ json.hpp              # JSON parsing library
β”œβ”€β”€ tinyxml2.h/cpp        # XML parsing library
β”œβ”€β”€ nu.osm                # OpenStreetMap data file
β”œβ”€β”€ bus-stops.txt         # CTA bus stop data (CSV)
└── makefile              # Build configuration

API Integration

CTA Bus Tracker API

  • Uses free API key from CTA Bus Tracker
  • Provides real-time bus arrival predictions