Open Street Map - Northwestern University Campus
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
π’ Building Search
- 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
Entityclass inherited byAmenityandBuildingclasses - Data encapsulation: Private data members with public getter methods
- Class-based organization:
Nodes,Buildings,Amenities, andBusStopscontainer 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