The Brief
Nairobi’s matatu and bus network is one of Africa’s largest decentralized public-transport systems, yet it lacks a comprehensive digital navigation layer. Operating largely on a fill-and-go model without conventional fixed timetables, the network is managed by numerous independent SACCOs and remains poorly represented in mainstream mapping applications. As a result, passengers struggle to discover routes, identify stops, plan transfers, and navigate unfamiliar journeys, relying heavily on local knowledge and word of mouth. The challenge was to build a reliable navigation experience around a dynamic and fragmented transport ecosystem, combining geospatial data, multimodal routing, location-aware guidance, and conversational assistance into a single mobile application.
Approach
- 01
Integrated the Digital Matatus dataset as the foundational GTFS source for Nairobi’s transit stops, route alignments, and transfer points, providing structured network data for journey planning.
- 02
Deployed OpenTripPlanner 2.4 in Docker, combining the Nairobi GTFS feed with an OpenStreetMap walking graph to calculate multimodal journeys involving transit and walking connections.
- 03
Stored transit stops in PostGIS using geographic data types and spatial indexing. Implemented ST_DWithin queries and K-nearest-neighbor fallbacks to support efficient, location-aware stop discovery.
- 04
Built a tiered GeocodingService that prioritizes local GTFS data before falling back to the Google Maps API, improving transit-specific place resolution and reducing unnecessary external geocoding requests.
- 05
Developed Kwame, a conversational trip-planning assistant powered by GPT-4o-mini, Whisper speech-to-text, and text-to-speech capabilities. The assistant enables natural-language journey queries through text and voice interactions.
- 06
Introduced domain-specific routing factors, including the Fill-Time Factor and Mshukiwa Factor, derived from historical GPS data to better reflect the operational realities of Nairobi’s matatu network.
- 07
Implemented a navigation engine that projects the user’s GPS position onto route polylines to estimate progress along a journey, providing more stable navigation guidance than proximity-only step detection.
- 08
Designed a data-conscious architecture using local caching for static GTFS datasets and MQTT-based vehicle telemetry infrastructure to support efficient data access and prepare the platform for real-time transit tracking.
- 09
Improved the navigation experience through exponentially smoothed GPS updates, throttled map-camera movements, and progressive stop rendering based on zoom level.
- 10
Enforced service-window checks derived from GTFS calendar data and implemented caching for OpenTripPlanner results and geocoding responses to improve responsiveness and reduce repeated computation.
Result
Developed a public-transit navigation platform that brings stop discovery, multi-leg journey planning, and guided navigation into a single mobile experience tailored to Nairobi’s matatu network. Integrated Kwame to support conversational trip planning through text and voice, while implementing geospatial search, route-aware GPS positioning, and optimized map rendering for a smoother user experience. Established a scalable routing and data infrastructure using OpenTripPlanner, PostGIS, GTFS caching, and an MQTT-ready telemetry pipeline, laying the technical groundwork for the future expansion of real-time transit tracking and intelligent mobility services.

