Malaysia Transit + SG-JB Transit
White paper · November 2026
Malaysia Transit and SG-JB Transit
Free, live public transport information for Malaysia, Singapore and the border between them: why the two exist, what they give riders, how they work, what they cost to run, and how to work with them.
13
areas of Malaysia live, from Kangar to Kuching, plus Singapore and Johor Bahru
13
languages, from Malay, English and Chinese to Tamil, Iban and Bidayuh
RM 0
for riders: no ads, no subscription, no sign-up needed
Malaysia Transit · malaysiatransit.techmavie.digital  ·  SG-JB Transit · sgjbtransit.techmavie.digitalVersion 1.1 · 27 November 2026
At a glance

One platform, two apps, every bus and train we can see

Malaysia Transit shows live buses, trains and ferries across 13 areas of Malaysia, on a website and in apps for iPhone, iPad and Android. SG-JB Transit does the same for Singapore, Johor Bahru and the crossings between them. Both are free, with no ads and no subscription, and one person builds and runs them: Aliff, under TechMavie Digital in Penang.

13
areas of Malaysia live, with Kota Kinabalu next
4
ways in: two websites, and two apps on the App Store and Google Play
19M+
requests served by the Malaysia Transit API
53%
of live times within 2 minutes of the bus, up from 32% (21 November 2026)
In five points

Contents

1The gap we set out to fill
2Built for daily use
3Why SG-JB Transit is its own app
4Principles
5The live map
6Stops and arrivals
7The journey planner
8Departures and timetables
9Track this bus and widgets
10Trip history and reports
11Fares and how to pay
12Languages, accounts, privacy
13Malaysia, area by area
14Singapore, Johor and the border
15Where the data comes from
16How the platform fits together
17Live times and punctuality
18Journey planning without Google
19Quality and checks
20Running costs
21Before and after Google
22How it is funded
23Ways to work together
24What comes next
ADocuments and downloads
BGlossary
CSources and credits
DEnhanced route lines from OpenStreetMap
EJourney planning with MOTIS and GrabMaps
Part 1

Why they exist

Malaysia has good public transport in more places than most people think, and much of it publishes live data. What riders lacked was one clear, free place to see it all.

1The gap we set out to fill

Information was scattered

Each operator has its own app, website or nothing at all: Rapid KL and Rapid Penang, BAS.MY in each city, KTM, the ferries, Causeway Link. A trip that uses two of them meant two apps, or guesswork.

The popular apps charge

Apps such as Moovit and Transit ask for a subscription to remove ads or unlock some features. A rider waiting for a bus in Kangar shouldn't have to pay to see when it comes.

Free maps don't tell the whole story

Google Maps and Apple Maps show some live times, but not a stop's whole timetable, the fare and how to pay each operator, whether buses keep their times, or the border crossings' details. Nor are they laid out the way riders here travel.

Tourists and locals alike

Visitors from Thailand, Indonesia, China, Korea or Japan, and Malaysians of every language, need the same clear answers. Both apps and websites speak 13 languages, including Tamil, Iban and Bidayuh.

Accountability. A timetable is a promise. Recording every bus shows, plainly and for everyone, how well each route keeps it, which helps riders plan and gives operators and agencies the evidence to improve. Section 10 and the arrival-times white paper describe how.

2Built for daily use

"I want to design the app and the web version to fit my own day-to-day use."Aliff, who builds and runs both

Both products started from one rider's real trips in Penang and beyond, and grew from what was missing on them: which bus is coming and where it is now, whether it has left its terminal, which stop to wait at, what to pay and how, and what to do at the border. Every feature since has been tried on real journeys first, on an iPhone, an iPad and Android, and fixed when it didn't hold up.

3Why SG-JB Transit is its own app

4Principles

Free for riders

No ads, no paywall, no account needed. Riders who want to can leave a tip ("Buy me a matcha latte").

Honest about what it knows

A live time says it's live; a timetabled one says it's scheduled; a bus at its terminal says "Not departed yet". Records say where they come from and their limits.

The operators' own data

Timetables, fares and payment rules come from the operators and agencies, checked against their published sources and dated.

Independent

Neither is a government app, nor affiliated with or endorsed by any government body or operator, including the Ministry of Transport, APAD, Prasarana, KTMB, BAS.MY and LTA.

Part 2

What riders get

The websites and the apps share the same features and data, worked out by the same server. The apps add what phones do best: alerts, a lock-screen Live Activity, widgets and an offline copy of timetables.

5The live map

Every bus with a live feed is on the map, labelled with its route and where it's going ("101 → Teluk Bahang"), with an arrow for its heading. Routes are drawn along OpenStreetMap's roads and railways, in one direction or both, with their stops. Nearby stops puts a pin where you are (or on a place you search for) and lists the closest stops with their next live buses.

6Stops and arrivals

A stop's sheet lists its live arrivals, coloured by punctuality, then its timetable. Bus approaching shows a bus coming to your stop on a map, the stops still to go numbered from the bus, and the buses after it. Today at this stop says how today's buses kept to their timetable ("13 of 16 on time · 3 late"). Stops that two areas share, such as Sungai Petani's, list both areas' buses.

7The journey planner

From any address or place to any other, by bus, train and ferry, now or at a chosen time. Each option reads down a timeline: where to walk, board and change, each ride's next bus or train (tap a live time to watch the bus come, or a timetabled one for its departures), the fare for adults and concessions, and how to pay on each operator. Journeys are planned by our own MOTIS planner and places come from GrabMaps (section 18). Trips into Singapore hand over to SG-JB Transit.

8Departures and timetables

Every route's next departures from its first stops, the operators' official timetables, and for Rapid KL, the MRT feeders and Rapid Penang, the times their buses usually leave, learned from four weeks of records, because their published timetables don't hold. Under each timetabled time, a coloured line says how its bus ran over the last week, and each route's actual timetable can be downloaded as a PDF, made fresh from the records whenever it's asked for.

9Track this bus and widgets

The bell beside a live arrival follows that bus and alerts you at 10 and 5 minutes, when it's almost there, and when to get off, on the lock screen as a Live Activity on iPhone or a live notification on Android. Home-screen widgets (My Stops and Where I Am) show your places' next buses at a glance.

10Trip history and reports

Since 21 November 2026 every bus with a live GPS feed is recorded every 30 seconds. The Trip history page shows each area's figures, the buses that just left, departures by the hour, how each service ran today, and any day or route since. On time means from 1 minute early to 5 minutes late against the bus's own timetabled time. Each area gets a weekly report (a PDF in 13 languages, ready every Monday at 04:00 from 30 November 2026), and Khazanah Research Institute's 2025 archive of Rapid KL and the MRT feeders is kept apart and labelled as such. SG-JB Transit records Singapore's cross-border services (160, 170, 170X and 950) and shows Johor Bahru's from Malaysia Transit's records.

11Fares and how to pay

The fare calculator and every journey give each operator's own fares, adult and concession, with notes where they matter (Bas Muafakat Johor free for Malaysians, KTMB's promotional fares, Causeway Link's section fares). How to pay lists each operator's ways to pay (cash, cards, QR, e-wallets and passes) with who can use each and how to get it, checked city by city: BAS.MY takes bank cards in Ipoh, Melaka, Johor Bahru and Kota Kinabalu, on some of Seremban's routes and rarely elsewhere, and Kangar takes cash only.

12Languages, accounts, privacy

Part 3

Coverage

Thirteen areas of Malaysia are live, from Perlis to Sarawak, and SG-JB Transit covers Singapore, Johor Bahru and the crossings between them.

13Malaysia, area by area

AreaBusesTrains and ferries
Klang ValleyRapid Bus KL, MRT feeder busesRapid Rail KL (LRT, MRT, Monorail), KTM Komuter, KLIA Ekspres and KLIA Transit
PenangRapid PenangPenang ferry, KTM Komuter Utara, SRT's shuttle to Hat Yai
KangarBAS.MY KangarKTM Komuter Utara, SRT's shuttle
Alor SetarBAS.MY Alor SetarKTM Komuter Utara, SRT's shuttle
IpohBAS.MY IpohKTM Komuter Utara
Kota BharuBAS.MY Kota BharuKTM Intercity
Kuala TerengganuBAS.MY Kuala Terengganu-
KuantanBAS.MY Kuantan-
SerembanBAS.MY Seremban (two operators)KTM Komuter, KTM Intercity
MelakaBAS.MY MelakaKTM Komuter
Johor BahruBAS.MY Johor Bahru, Bas Muafakat Johor, Causeway Link, Singapore's cross-border busesKTM Shuttle Tebrau, KTM Shuttle Selatan
Rest of JohorBas Muafakat Johor (Batu Pahat, Kluang, Muar, Segamat, Mersing and more)KTM Shuttle Selatan
KuchingBAS.MY Kuching, City Public Link's S19 to the Tebedu border-
Kota KinabaluComing soon

Live positions are shown wherever the operator publishes them; timetables and fares cover the rest.

14Singapore, Johor and the border

Singapore

Every bus service, with LTA's arrival times and where LTA places each bus, the MRT and LRT for journeys, and the cross-border buses: SBS Transit's and SMRT's 160, 170, 170X and 950, and Causeway Link's CW routes. Fares in Singapore dollars or ringgit, as the rider chooses.

Johor Bahru and the crossing

Johor's buses as on Malaysia Transit, Causeway Link's routes as it publishes them, KTM's Shuttle Tebrau between JB Sentral and Woodlands, and the time it takes to clear the border, shown as its own step in every cross-border journey.

Part 4

How it works

One server gathers the data, works out live times and records, plans journeys and answers the websites, the apps and other developers. Nearly everything it uses is open data or open source.

15Where the data comes from

SourceWhat it givesLicence or terms
data.gov.myTimetables (GTFS) and live bus positions (GTFS Realtime) for Rapid KL, the MRT feeders, Rapid Penang, BAS.MY and KTMCC BY 4.0
LTA DataMallSingapore's bus arrivals, routes, stops and first and last busesSingapore Open Data Licence
Operators' own pagesKTMB's timetable PDFs and fare tables, Causeway Link's routes and fares, Bas Muafakat Johor's live page (PAJ), the Penang ferry and SRT timetablesPublished by the operators; checked and dated
OpenStreetMapThe base map, the streets for walking and planning, and the route lines along roads and railways (Appendix D)ODbL (© OpenStreetMap contributors)
GrabMapsPlace and address search, through Amazon Location ServicePaid per request (section 20)
Khazanah Research InstituteA 2025 archive of Rapid KL's and the MRT feeders' bus positions, for history before our own recordsAs published, credited

16How the platform fits together

Sources Our server Riders and partners data.gov.my (GTFS, live) LTA DataMall Operators' timetables OpenStreetMap GrabMaps (places) KRI archive (2025) Live positions and arrival times Timetables, fares, how to pay Trip history recorder, reports MOTIS journey planner Alerts (APNs, FCM, Web Push) Map tiles (Cloudflare) Malaysia Transit website SG-JB Transit website iPhone, iPad, Android apps Developer API AI assistants (MCP) Weekly reports, PDFs
One server per product, on a single small virtual server, with the journey planner beside it and the map tiles on Cloudflare.

17Live times and punctuality

A live time is worked out from the bus's own position: it is placed on its route line, the distance left to the stop is measured along that line, and it is timed at the pace that service's buses are making right now, plus a short stop at each stop on the way. Run on the same buses at the same moments, times within 2 minutes of the real arrival went from 32% to 53%, and from 45% to 92% when the bus was under 3 minutes away. Punctuality is measured from the records, never assumed. The full method, with every figure, is in the white paper Live arrival times and punctuality (Appendix A).

18Journey planning without Google

Until November 2026 journeys and place search came from Google Maps. Two things made us move. Google's terms don't allow its route and place results to be shown on a non-Google map, and both products use their own OpenStreetMap map. And Google bills per request, so every new free rider would have raised the bill as the products grew.

MOTIS plans the journeys

An open-source journey planner (MIT licence), run on our own server. It plans on the operators' timetables and OpenStreetMap's streets, including the services Malaysia Transit puts together itself: KLIA Ekspres, the Penang ferry, SRT's shuttle to Hat Yai, Causeway Link's AA1, and Singapore's buses (from LTA's first and last buses and frequencies), MRT and LRT. Its data is refreshed every night and checked with a test journey before use. It was chosen over OpenTripPlanner, the best-known alternative, because it needs a fraction of the memory (it runs within 1.5 GB and answers in 9 to 110 milliseconds), so it fits beside the apps on one small server. On 25 test journeys across Malaysia it matched or beat Google on most, and it planned Seremban to KL Sentral, which Google couldn't.

GrabMaps finds the places

Place and address search comes from GrabMaps, through Amazon Location Service, for Malaysia, Singapore and Thailand, reordered so places near the rider come first. GrabMaps is built for South-East Asia, its terms allow its results on our own maps, and it costs a fraction of Google's prices (section 21). It is weaker than Google on English descriptions and short names, which the server's reordering partly makes up for.

The planner's answers keep the same shape as before, so the websites and apps needed no change to use them. Fares, payment guides, live times and tracking are added on top, as before. Appendix E tells the whole story: how MOTIS and GrabMaps work, how they compare with OpenTripPlanner and Google, and what they cost. Appendix D explains how the route lines are drawn along OpenStreetMap's roads and railways.

19Quality and checks

Part 5

Costs and sustainability

Both products run on very little, by design: open data, open source and one small server, so they can stay free for riders.

20Running costs

ItemWhat it doesCost
Server (netcup VPS)Both products' servers, the MOTIS journey planner, the trip history recorder and the analytics€12.60 a month
Journey planning (MOTIS)Every journey on both websites and both appsNothing per journey
Place search (GrabMaps)Suggestions as you type, the chosen place, addressesUS$0.20 per 1,000 suggestions,
US$0.50 per 1,000 lookups
Map tiles (Cloudflare)The base map, stored on R2 and served by a WorkerFree tier; US$5 a month
once traffic needs it
App builds and updates (Expo)Building both apps, and over-the-air updatesUS$19 a month, then
US$0.005 per user over 3,000
Apple Developer ProgramPublishing on the App StoreUS$99 a year
Google PlayPublishing on Google PlayUS$25, once
Data, alertsdata.gov.my, LTA DataMall, OpenStreetMap; Apple's and Firebase's push alertsFree
All in, at today's trafficServer, Expo, the App Store fee spread over the year, and a little place searchAbout US$45 a month

Prices as published on 27 November 2026: netcup's plan, Expo's Starter plan, Amazon Location Service in Asia Pacific (Malaysia), Cloudflare's Workers plans, Apple's and Google's developer fees. Amazon gives place search a free allowance for the first three months: 10,000 suggestions and 20,000 lookups a month.

What grows with riders: place search, a little per search; Expo's updates, once the apps pass 3,000 monthly users (US$85 a month at 20,000, for example); and in time, a larger server. What doesn't: journey planning, the map's data and the live feeds.

21Before and after Google

Google Maps Platform gives each service a free allowance of 5,000 to 10,000 requests a month, then charges for every 1,000 more. GrabMaps and MOTIS cost a fraction of that, and MOTIS nothing per journey:

ForGoogle Maps PlatformNow
Planning a journeyDirections: US$5.00 per 1,000 after 10,000 free a month, and each plan made several callsMOTIS: nothing per journey
Suggestions as you typeAutocomplete: US$2.83 per 1,000 after 10,000 freeGrabMaps: US$0.20 per 1,000
The chosen placePlace Details: US$5 to US$20 per 1,000, by detail levelGrabMaps: US$0.50 per 1,000
Address to positionGeocoding: US$5.00 per 1,000 after 10,000 freeGrabMaps: US$0.50 per 1,000
US$0
for 100,000 journeys a month with MOTIS, against at least US$450 with Google Directions
US$70
for 100,000 place searches a month with GrabMaps, against about US$990 with Google's Places UI Kit
95%
less for the two together at that traffic: about US$70 against about US$1,440
1
set of terms that fits our own maps: Google's don't allow its results on a non-Google map

Google's prices from its pricing page and Amazon's from its price list for Asia Pacific (Malaysia), both read on 27 November 2026; one suggestion request and one lookup per search, after the free allowances. A rider typing sends several suggestion requests, so real searches cost a little more on both.

22How it is funded

Part 6

Working together

This paper is for anyone who wants to work in this field with Malaysia Transit and SG-JB Transit: government and agencies, operators and partners, developers and the media, funders and sponsors.

23Ways to work together

Government and agencies

The records show how every route keeps its timetable, stop by stop and week by week. Live feeds with trip numbers, and timetables published as data rather than PDFs, would make every rider's times better. We would gladly share findings and help pilot improvements.

Operators and partners

Your routes, timetables, fares and ways to pay, shown correctly, in 13 languages, beside every other operator a rider needs. Send us changes before they happen, or a live feed, and riders see them on day one.

Developers and the media

The Malaysia Transit API (developer portal at developers.malaysiatransit.techmavie.digital) and AI assistant tools (MCP) give stops, live arrivals, timetables, fares and journeys. Journalists and researchers can ask for records and reports.

Funders and sponsors

Support keeps both products free and lets them reach more places: Kota Kinabalu next, more live feeds, more languages. Sponsorship that keeps the apps ad-free and independent is welcome.

24What comes next

Get in touch

Email hello@techmavie.digital · Threads @hiiialanhere
Malaysia Transit: malaysiatransit.techmavie.digital · SG-JB Transit: sgjbtransit.techmavie.digital
Built by Aliff under TechMavie Digital, Penang, Malaysia.

Appendices

Documents, glossary and sources

ADocuments and downloads

DocumentWhere
Enhanced route lines (white paper, Appendix D)malaysiatransit.techmavie.digital/white-paper-route-lines.html, and as a PDF
MOTIS and GrabMaps (white paper, Appendix E)malaysiatransit.techmavie.digital/white-paper-journey-planning.html, and as a PDF
Live arrival times and punctuality (white paper, PDF)malaysiatransit.techmavie.digital/downloads/malaysia-transit-arrivals-and-punctuality.pdf
How arrival times are worked outmalaysiatransit.techmavie.digital/arrival-times.html
Trip history, and how punctuality is measuredmalaysiatransit.techmavie.digital/trip-history.html
Weekly reports (PDF, each area, 13 languages)From the Trip history page, every Monday
Actual timetables (PDF, each route)Under each route's timetable on Departures
How to use (with clips)malaysiatransit.techmavie.digital/how-to.html
Frequently asked questionsmalaysiatransit.techmavie.digital/faq.html
Changelogmalaysiatransit.techmavie.digital/changelog.html · sgjbtransit.techmavie.digital/changelog.html
Privacy policiesmalaysiatransit.techmavie.digital/app-privacy.html, and in each app
Developer APIdevelopers.malaysiatransit.techmavie.digital

BGlossary

GTFSGeneral Transit Feed Specification: the standard file format for timetables, routes and stops.
GTFS RealtimeThe live companion to GTFS: where each vehicle is, updated every few seconds.
MOTISAn open-source journey planner, run on our own server.
GrabMapsGrab's maps and place data for South-East Asia, offered through Amazon Location Service.
OpenStreetMapThe free, open map of the world, made by volunteers.
ODbLOpen Database Licence: OpenStreetMap's licence. Its data, and data built from it, may be used by anyone, with credit, under the same licence.
pfaedleAn open-source tool from the University of Freiburg that matches timetables to OpenStreetMap's roads and railways, to draw route lines.
Map matchingFinding the path along a map's roads or railways that best fits a set of positions, such as a route's stops.
OTA updateAn over-the-air update: new app code delivered without a new store release.
MCPModel Context Protocol: a standard way for AI assistants to use tools such as transit data.
Not departed yetA live bus still at its trip's first stop: its time counts from its departure, not from now.

CSources and credits

Live and timetable data: data.gov.my (Ministry of Transport and the operators, CC BY 4.0); LTA DataMall (Land Transport Authority, Singapore Open Data Licence); KTMB, Causeway Link, Perbadanan Pengangkutan Awam Johor (Bas Muafakat Johor), Penang Port and the State Railway of Thailand's published timetables and fares. Maps and streets: © OpenStreetMap contributors (ODbL), drawn from Protomaps' builds. Place search: GrabMaps through Amazon Location Service. Journey planning: MOTIS (motis-project, MIT licence). Historical positions: Khazanah Research Institute's 2025 archive. Figures on live times and records: Live arrival times and punctuality, version 1.1, 23 November 2026.

Malaysia Transit and SG-JB Transit are independent apps, not government apps. They do not represent, and are not affiliated with or endorsed by, any government entity or transit operator.

Appendix D · Technical white paper

Enhanced route lines from OpenStreetMap

A route line is what the map draws for a route between its stops. Since 26 November 2026, Malaysia Transit and SG-JB Transit draw their Enhanced route lines from OpenStreetMap, the open map of the world, instead of Google Directions. Buses are matched to the roads with pfaedle, an open-source tool from the University of Freiburg made for exactly this job, and trains follow the railway track by a method of our own that also finds stations a timetable puts in the wrong place.

1,337
route patterns drawn: 1,210 bus patterns by pfaedle, 127 train patterns along the track
802
Singapore bus service directions, which LTA publishes with no lines at all
6–11 m
from the stops to the new lines, on average, across the eight BAS.MY timetables tested
23
KTM stations found off the railway or out of order in the timetable, reported back
In four points

Contents

D1What a route line is
D2Where the lines came from
D3Why Google's lines had to go
D4The options
D5OpenStreetMap, the map underneath
D6pfaedle, in brief
D7How pfaedle matches a route
D8Our build, step by step
D9Trains, along the track
D10Routes no timetable draws
D11The trial
D12What is built today
D13Against Google's lines
D14What the build found
D15How the apps use the lines
D16Rebuilding
D17Licence and credit
D18Limits and next steps
D19Sources
Appendix D · Background

Why route lines needed a new source

Riders read a route from its line. Most of the timetables we show don't draw one that follows the roads, and the service that used to draw them for us came with terms our maps can't meet.

D1What a route line is

A route line is the path the map draws for a bus or train route between its stops. Riders use it to see which roads a bus takes, where it turns and where to wait for it, and the apps draw each ride of a planned journey along it. Both products offer two styles, switched on the map under Route Style:

Basic

The stops joined by straight lines, or the operator's own line where its timetable has one. Always available, and honest about what the timetable says.

Enhanced

The route along the roads it really takes, and trains along their track. Labelled "✓ Enhanced along OpenStreetMap" where the line comes from this work.

Timetables in the GTFS format may carry each route's path (the optional shapes.txt file), but most of the ones we show don't carry one that follows the roads:

Prasarana's feeds (Rapid KL's buses and trains, the MRT feeders and Rapid Penang), BAS.MY's for Johor Bahru and Melaka (5 to 20 points per stop) and Rapid Kuantan's already have good lines of their own, and keep them. The server uses an Enhanced line where a timetable's own is too sparse to follow the roads: fewer than 1.5 points per stop, no line at all, or a KTM train.

D2Where the lines came from

Until 26 November 2026, Enhanced lines came from Google Directions, in three ways:

D3Why Google's lines had to go

Not allowed on our maps

Google's Service Specific Terms say Directions results "must not" be used "in conjunction with a non-Google map" (section 4.2). Our websites draw with Leaflet on an OpenStreetMap map, and the apps with MapLibre: neither is Google's.

Not allowed to keep

Only latitudes and longitudes may be cached, for up to 30 days (section 4.3), and the general terms forbid storing Google's content or making new content from it (section 3.2.3). Lines saved into timetables, or cached for good, did both.

Not the bus's roads

A directions service finds its own best way between each pair of stops: it doesn't know which roads the bus takes. Where a stop sat a little off the road, Google's line sometimes swerved onto another road to reach it.

A bill that grows

Every line asked for is a billed request (US$5.00 per 1,000 Directions calls after 10,000 free a month), and the risk was larger than the bill: breaking the terms lets Google suspend the account's Maps services, all at once.

D4The options

On 26 November 2026 the first plan was to fall back to Basic lines everywhere, until we asked whether Enhanced lines could come from somewhere other than Google. These were weighed:

OptionHow it worksVerdict
Basic lines onlyThe stops joined up, or the operator's lineAllowed and free, but gives up the road-following lines riders had
pfaedleMatches whole timetables to OpenStreetMap's roads and railways ahead of timeChosen Made for exactly this, open source, offline, about a minute per timetable
MOTIS's route shapesThe journey planner can work out lines for trips without one from its own street routing (its route_shapes setting)Not yet running when the lines were needed, and it would tie the route views to the planner. The planner now draws its rides along pfaedle's lines instead
ValhallaAn open-source router with a bus profile, which can snap points to the roads when a line is asked forOne more service to run and call while riders wait, as Google was. Building lines ahead of time is simpler, and each can be checked before anyone sees it
Google DirectionsDirections through the stopsNot allowed on our maps or to keep (section D3)

We trialled pfaedle on the server first (section D11). Its first lines looked better than Google's had, and they became the new Enhanced the same day.

Appendix D · Method

How the lines are made

Buses and trains are drawn by two methods, on the same OpenStreetMap data, into the same kind of file. Both run ahead of time, so riders never wait on them.

D5OpenStreetMap, the map underneath

OpenStreetMap is the free, editable map of the world, made by volunteers and published under the Open Database Licence. Besides drawing the base map of both products, it describes everything a route line needs:

WhatHow OpenStreetMap records itUsed for
Roadshighway=* ways, from motorways to service roads, with oneway and access tagsBus lines
Turn rulestype=restriction relations (no right turn, only straight on…)Bus lines
Railway trackrailway=rail ways, with service=siding, yard, crossover or spur for side trackTrain lines
Stops and stationsBus stops, platforms, stop positions and stations, with their namesPlacing stops; station positions

D6pfaedle, in brief

pfaedle is a free, open-source tool that gives a GTFS timetable its route lines by matching every trip to OpenStreetMap. It comes from the Chair of Algorithms and Data Structures at the University of Freiburg in Germany (Professor Hannah Bast's group), where Patrick Brosi wrote it and still develops it. It first appeared in 2018, with the paper "Sparse Map-Matching in Public Transit Networks with Turn Restrictions" (Bast and Brosi, ACM SIGSPATIAL 2018), and its method is the first part of Brosi's doctoral thesis, Automated Generation of Transit Maps (2022). It is written in C++ and published under the GNU General Public Licence, version 3.

Made for timetables

It reads a whole GTFS feed and works from what a timetable already has: each trip's stops in order, their positions and names, and their times.

Each mode on its own ways

Its settings cover buses and coaches, trams and subways, trains, ferries, gondolas and funiculars, each matched only to the kind of way it runs on.

Run ahead of time

It writes the lines into the timetable's shapes.txt. Nothing is asked of any service while riders use the apps.

Fast, and tested

In the thesis it matched every trip in Germany in 8.5 minutes (not counting reading the map), and got 90% of trips right on at least nine hops in ten, against 84% for the usual distance-based method, with lines 6.9 m from the true path on average.

D7How pfaedle matches a route to the roads

Map matching usually starts from a GPS trace: a position every second or so, close together. A timetable gives far less: only the stops, often hundreds of metres apart. Between two stops many paths are possible, and the job is to pick the one the bus really takes. pfaedle treats this as a hidden Markov model, the standard tool for map matching: the stops are what is observed, and where each stop really sits on the network is hidden. With the settings it ships with, it works like this:

Stop, as the timetable places it Candidate on a road Chosen path Basic line
Each stop gets candidate positions on the roads nearby (two shown per stop here). pfaedle chooses one per stop, and the roads between them, so that the whole trip costs least; the Basic line just joins the stops.
  1. A network for each mode. From the extract it builds a graph of the ways a mode may use, sorted into eight levels by their tags, each with an average speed. For buses, trunk and primary roads are level 1, secondary roads level 2, residential streets level 4 and service roads level 5, with speeds from 85 km/h on the fastest level down to 5 km/h on the slowest. OpenStreetMap's mapped bus routes are read too.
  2. Candidates for each stop. For each stop it gathers the places where the stop could be: stops and stations mapped in OpenStreetMap within 200 m, scored by how alike their names are to the timetable's, weighed with distance; the nearest points on roads within 100 m, down to service roads; and, as a last resort, the stop's own position. A candidate costs a little more the further it is from the stop, and a little more again if it isn't a mapped stop, or its name doesn't match.
  3. Hops between candidates. For each pair of candidates at consecutive stops, it finds the quickest path along the network, at each level's speed. Driving against a one-way street costs five times the time plus 5 minutes, and a banned turn 5 minutes: heavy penalties rather than outright bans. A U-turn costs 2 minutes, and stretches away from the line's own mapped bus route take a fifth longer.
  4. The timetable's times as a limit. Each hop's search stops at three times the time the timetable allows for it (at least a minute), and is widened up to three times if nothing is found. If no path fits even then, pfaedle reports "No viable hop found" and draws that hop straight.
  5. The best path overall. The candidates form one layer per stop, joined by the hops. The trip's line is the cheapest path through all the layers, one candidate per stop: a shortest-path search through the layers, which is how a hidden Markov model's most likely sequence (the Viterbi path) is found.
  6. Shared work. Trips of the same line with the same stops are merged into a tree of stop sequences and matched once, so a timetable of thousands of trips takes about a second.

D8Our build, step by step

One script, scripts/osm-lines/build.mjs, builds every line. It runs on the server beside the live apps, so it is careful with memory.

StepWhat happens
1. Pick the timetablesFrom the service areas the apps serve: every BAS.MY city but Kuantan, Bas Muafakat Johor, Causeway Link, City Public Link S19, the Singapore cross-border buses and, given LTA DataMall's routes, every Singapore bus service; for trains, KTMB, KLIA Ekspres and SRT's shuttle. A new BAS.MY city is picked up at the next build.
2. Find the trip patternsA pattern is one distinct sequence of stops: a route, a direction, a variant. Every trip with that sequence shares its line, so 1,338 patterns stand for all the trips. The stops are the ones the server lists, after it merges a timetable's stops into places, so the line's stop ids are the ones the apps receive.
3. Write a small timetableOne trip per pattern, with its stops and times, as a GTFS folder for pfaedle.
4. Run pfaedleIn a container from an image pinned to one exact build, matching buses only and every trip afresh. Each run is capped at 3 GB of memory and 2 CPUs at low priority, one at a time; none starts with less than 3.5 GB free, and a run is stopped after 45 minutes.
5. Check each lineThe quality gate below. A line that fails is not kept, and the server goes on showing the timetable's own line for that pattern.
6. Pin the stopsEach stop is pinned to its point on the line, in the stops' order. A stop's choices are its nearest points on up to 8 pieces of the line and the nearest point of every pass the line makes within 250 m of it: a loop that starts and ends at its terminal passes it twice, and the first stop belongs on the first pass even where the nearest pieces all lie on the last. A line that can't pass its stops in order isn't kept. The server can then cut the line between any two stops.
7. Simplify and storePoints closer than 2 m (buses) or 4 m (trains) to the simplified line are dropped, as the eye can't see them; stop points are always kept. Each line is stored as an encoded polyline (to about a metre), in one JSON file per timetable with its build time, the map data's date, the credit and the licence.
8. ReportEach timetable's patterns kept and not kept, and why; lines with a straight piece over 1.5 km (a road pfaedle couldn't follow there); and the stations left out of train lines.
The quality gate for bus lines

A line is kept only if it passes its stops in order, every stop is within 200 m of it, and, for patterns longer than 300 m, it is between 0.7 and 3 times as long as its stops joined up. The trial's worst kept cases were a stop 115 m from its line (a pole recorded well off the road) and a two-stop route 2.5 times its straight length, because its road really goes round. A line that is too short has cut a corner; one that is far too long has wandered.

D9Trains, along the track

pfaedle draws a train's line through every station, as it should. But KTMB's timetable places some stations well away from the railway, and a station in the wrong place pulls the line off the track: out to Sedenak, 509 m from the railway between Layang-Layang and Kulai; out to Kalumpang, placed about 7 km from the real station; and zigzagging to East Coast halts several kilometres off the line. So trains are drawn by a method of our own (scripts/osm-lines/railPaths.mjs), on the railway track pfaedle extracts from the map:

  1. Track. Only ways tagged railway=rail, the track KTM trains run on. Light rail, monorail, funicular, tram, disused and unbuilt track are left out. Sidings, yards, crossovers and spurs may be used but count three times their length, so the main line wins.
  2. Stations meet the track. Each station is matched to the nearest point on up to 8 nearby tracks, measured to the track itself, not to its mapped points: straight track can have points kilometres apart. KL Sentral has six tracks within 40 m, and the KLIA Ekspres line must find its own among them.
  3. Off the railway. A station with no track within 300 m is out of place, and left out of the line.
  4. The shortest way along the track. The line joins the stations in order by the shortest route along the track. A hop may be up to 3 times the straight distance, or 5 km more; a station the line can't reach in order within that is left out too.
  5. Doubling back. KTM trains don't reverse on the way, so a station that makes the line run past it and come back (by over 30% of the direct way, and over 1 km) is in the wrong place or the wrong order, and left out, the worst first. At most three stations in a row are left out.
  6. Close to the station. Where a station has several tracks nearby, the line uses the one that keeps it closest to the station: each metre between station and track counts like 5 m of track.
Station placed 509 m off the railway left out of the drawn line, kept in the timetable Track method: stays on the railway A line through every station: bends out
What happened at Sedenak, between Layang-Layang and Kulai. The black and white line is the track.

Left-out stations stay in the timetable and on the map; only the drawn line doesn't bend to them, and the server lists them with the line (skippedStops). Where stations are placed correctly, this method and pfaedle give the same line: on Komuter Utara both sit on the railway, and the track method places stations a few metres closer (17 m and 28 m on average, against 22 to 32 m). Long hops are real track, not errors: Ipoh to Kuala Kangsar is 51.7 km by rail for 25.3 km in a straight line, and Dabong to Kuala Krai 55.0 km for 27.3 km. Two settings were tuned on such cases: at 2 times the straight distance the method wrongly dropped Ipoh and Kuala Krai, and without the 5-to-1 weight lines started 261 m from Dabong and 198 m from Gua Musang, joined through a short station siding.

D10Routes no timetable draws

Appendix D · Results

The lines in numbers

pfaedle was tried in three rounds on 26 November 2026 before anything went live, on the same server and with the same caps as the build uses today.

D11The trial

Round 1: four timetables

TimetableTimePeak memoryTrips matchedStop to line
Singapore cross-border buses73 s437 MB1,565 of 1,56511.4 m
Causeway Link73 s446 MB1,015 of 1,0159.6 m
BAS.MY Kangar48 s353 MB344 of 3446.5 m
KTMB (rail)36 s131 MB265 of 26520.1 m

Stop to line: the median, over a timetable's patterns, of the average distance from each stop to the line. Most of each run (about 65 seconds) is spent reading the map file; the matching itself takes about a second per timetable.

Round 2: six more BAS.MY cities, and Komuter Utara

TimetableTimePeak memoryPatternsStop to line
Alor Setar61 s498 MB266.7 m
Kota Bharu55 s397 MB328.4 m
Kuala Terengganu49 s282 MB178.1 m
Kuching (with stand-in times)48 s293 MB226.6 m
Ipoh55 s328 MB2911.2 m
Seremban A61 s489 MB198.0 m
Seremban B73 s562 MB228.1 m

Ipoh's figure is the highest because its feed lists a separate pole for every route at shared stops. Komuter Utara's lines were good too: all 40 straight pieces over 2.5 km stay within 6 m of the real track, half within 1 m, because pfaedle draws straight track with few points.

Round 3: trains along the track

KTMB timetableTimeStationsLinesStations left outStraight gaps
Malaysia Transit's copy17 s18445230
data.gov.my's live feed54 s15686140

Every train line followed the railway with no straight gaps; each straight piece over 2.5 km is a single piece of mapped straight track (the longest, 5.8 km, crosses the Perlis and Kedah paddy belt). Kept stations sit within 150 m of their line, except two whose recorded positions are that far from the track.

D12What is built today

TimetableMethodPatterns keptFile
Singapore's buses (LTA DataMall)pfaedle802 of 802943 KB
KTMB (every KTM service)Track121 of 121417 KB
BAS.MY Melakapfaedle66 of 66113 KB
Bas Muafakat Johorpfaedle57 of 5751 KB
BAS.MY Johor Bahrupfaedle45 of 4566 KB
Causeway Linkpfaedle36 of 3638 KB
BAS.MY Kota Bharupfaedle32 of 3270 KB
BAS.MY Ipohpfaedle30 of 3050 KB
BAS.MY Alor Setarpfaedle27 of 2733 KB
BAS.MY Kangarpfaedle23 of 2340 KB
BAS.MY Kuchingpfaedle23 of 2331 KB
BAS.MY Seremban Bpfaedle22 of 2253 KB
BAS.MY Seremban Apfaedle18 of 1933 KB
BAS.MY Kuala Terengganupfaedle19 of 1932 KB
Singapore cross-border busespfaedle6 of 610 KB
KLIA Ekspres and KLIA TransitTrack4 of 45 KB
Causeway Link AA1pfaedle2 of 22 KB
City Public Link S19pfaedle2 of 23 KB
SRT Padang Besar–Hat YaiTrack2 of 22 KB
19 timetables1,211 pfaedle, 127 track1,337 of 1,3381.94 MB

Built on 26 November 2026 from OpenStreetMap data until 17 November 2026 (SRT's railway: an extract of 28 July 2026); on 27 November the bus lines' stops were pinned again, as step 6 of section D8 describes, the cross-border buses' lines built again on LTA DataMall's stop positions, and those and Singapore's built again with the 160, the 950 and the 170X drawn out to JB Sentral and back (section D10). One line doesn't pass its stops in order and isn't kept: Seremban A's Desa Rhu loop. KTMB's file serves all 11 KTM services in the apps, from Komuter Klang Valley to Shuttle Tebrau and the Intercity trains to Kota Bharu. BAS.MY Johor Bahru's and Melaka's own lines already follow the roads, so their route views keep them.

D13Against Google's lines

Google Directions (before)OpenStreetMap (now)
On our own mapsNot allowed (section 4.2)Allowed, with the credit
Keeping themCoordinates only, for 30 daysOurs to keep, and to share under the same licence
Which roadsGoogle's own best way between each pair of stopsThe quickest way through all the stops in order, weighing each stop's distance, road class, turns and mapped bus routes
A stop set back from the roadCould swerve onto another road to reach itPinned to the road beside it; a line too far from any stop isn't kept
TrainsThrough every station, even one placed off the lineAlong the track, leaving out stations placed off it, and reporting them
Fit with the mapGoogle's road geometry over an OpenStreetMap mapThe same roads the map draws
CostUS$5.00 per 1,000 requests after 10,000 free a monthNothing per line; about 20 minutes of our server per rebuild
Fresh roadsGoogle's current mapAs fresh as the extract: rebuilt every month or two
If it failsNo line, or a line that bends wrongThe quality gate falls back to the timetable's own line

On ordinary roads the two are very close: CW2's new line is 2.5 m from Google's on average. The difference shows where it matters to riders: at stops set back from the road, at terminals and interchanges, and on trains whose timetable puts a station in the wrong place.

D14What the build found

Drawing lines carefully is also a close check of the timetables. These findings are worth sending to KTMB and data.gov.my, and are listed with every build:

KTM stations off the railway. More than 5 km off: Mela, Sg Mengkuang Baru, Kuala Gris, Kemubu, Sri Mahligai, Kalumpang (placed near Lembah Beringin), Tembeling and Padang Piol. Closer in: Sri Bintang 4.5 km, Pahi 4.4 km, To' Uban 2.9 km, Aur Gading 1.6 km, Sri Jaya 1.4 km, Kg Berkam 1.1 km, Bertam 666 m, Sedenak 509 m, Dura 412 m, Sungai Temau 341 m and Holiday Plaza 307 m.

In the wrong place or order. "Mengkuang" is timetabled between Triang and Kemayan in Pahang but placed south of Kuala Krai in Kelantan, about 330 km up the line. Kubang Rusa and Teluk Gunong are listed in swapped order, and so are Kg Telang and Pdg Tungku.

Other timetable issues. On Kuching's Q11 to Q16 every stop has the same time (section D10). KTMB's live feed has no route lines at all, and codes its five Komuter services, Shuttle Selatan among them, as trams. The KTMB copy used in the trial had 8 stop times pointing at a station (37200) missing from its stop list, and 39 Komuter trips with no stops. BAS.MY's feeds, all but Johor Bahru's and Melaka's, have one line point per stop, and some poles recorded 40 to 115 m off the road. (Hat Yai is left out of KTM's lines only because the main extract stops at the border: not a timetable error.)

Appendix D · In use

Serving, upkeep and licence

The lines are plain files in the server's code. The server reads them when it starts, and riders get them with no outside service in the way.

D15How the apps use the lines

D16Rebuilding

Lines are rebuilt when a timetable's trips change a lot, and every month or two for newer map data. The whole build takes about 20 minutes on the server:

  1. Download a fresh Geofabrik extract (about 250 MB).
  2. In a scratch copy of the code, never the copy the live server runs from, run the builder with the extract, LTA DataMall's cached bus routes and SRT's railway extract.
  3. Read the report: patterns kept and not kept, straight pieces, stations left out.
  4. Look over each area's new lines against Basic on an internal review page.
  5. Commit the files; the server reads them on its next start. Copy the Singapore, cross-border, AA1 and KTMB files to SG-JB Transit.

Per timetable a run takes about a minute and under 0.5 GB of memory; extracting the railway for the train method takes 43 seconds at a 139 MB peak, and the track method itself seconds.

D17Licence and credit

D18Limits and next steps

D19Sources

pfaedle: github.com/ad-freiburg/pfaedle (code, default settings and README, read 27 November 2026); H. Bast and P. Brosi, "Sparse Map-Matching in Public Transit Networks with Turn Restrictions", Proceedings of ACM SIGSPATIAL 2018, pp. 480–483, doi:10.1145/3274895.3274957; P. Brosi, Automated Generation of Transit Maps, doctoral thesis, University of Freiburg, 2022, chapter 2, "Map-Matching Schedule Data", doi:10.6094/UNIFR/228990.

OpenStreetMap: openstreetmap.org/copyright (credit and licence); the Open Database Licence 1.0, opendatacommons.org/licenses/odbl/1-0; Geofabrik's Malaysia, Singapore and Brunei extract, download.geofabrik.de/asia/malaysia-singapore-brunei.html; the Overpass API, overpass-api.de.

Timetables: data.gov.my's GTFS feeds (CC BY 4.0); LTA DataMall's bus routes and stops (Singapore Open Data Licence); the GTFS reference for shapes.txt, gtfs.org.

Google Maps Platform: Service Specific Terms (version of 24 November 2026), cloud.google.com/maps-platform/terms/maps-service-terms; Terms of Service, cloud.google.com/maps-platform/terms; pricing, developers.google.com/maps/billing-and-pricing/pricing (read 27 November 2026).

Malaysia Transit's own records: how the lines are built (docs/osm-route-lines.md), the builder (scripts/osm-lines/), the line files (data/osm-lines/, built 26 November 2026, the bus lines' stops pinned again on 27 November), and the pfaedle trial report of 26 November 2026, with its three rounds.

Appendix E · Technical white paper

Journey planning with MOTIS and GrabMaps

Since 27 November 2026, every journey on Malaysia Transit's and SG-JB Transit's websites and apps is planned by MOTIS, an open-source journey planner we run on our own server, and every place search is answered by GrabMaps, through Amazon Location Service. Together they replaced Google Maps Platform, whose terms don't allow its results on our own maps, and whose bill grows with every rider.

27
timetables MOTIS plans on: 15 from data.gov.my, 10 of our own, Singapore's buses and trains
25
test journeys against Google: MOTIS quicker on 15, one of them a trip Google couldn't plan, and level on 1
35 s
to load the night's fresh timetables, checked with a test journey before use
US$70
for 100,000 place searches a month, against about US$990 with Google's Places UI Kit
In five points

Contents

E1What Google did for us
E2The terms
E3The bill
E4What we needed
E5MOTIS, in brief
E6How MOTIS plans a journey
E7MOTIS against the alternatives
E8Our MOTIS setup
E9Singapore and southern Thailand
E10How our server uses MOTIS
E11Results
E12GrabMaps, in brief
E13How place search works
E14GrabMaps against Google
E15The pair against Google alone
E16Trade-offs and risks
E17What comes next
E18Sources
Appendix E · Background

Why we left Google Maps Platform

Google planned our journeys and found our places for years. Its terms never fitted products with their own maps, and its bill was set to grow with every free rider.

E1What Google did for us

FeatureGoogle serviceUsed by
Planning a journeyDirections API: a transit search with alternatives, walking legs, and extra searches to piece together the S19, SRT and Causeway Link corridors by handBoth websites and both apps
Search as you typePlaces AutocompleteBoth websites and both apps
The chosen place's positionPlace DetailsBoth websites and both apps
Naming a point on the mapReverse geocoding and Place DetailsBoth websites and both apps
A typed address to a positionGeocoding APIThe developer API and the chatbot
Route lines along the roadsDirections API (replaced first: Appendix D)Both live maps

The apps never called Google themselves: they draw with MapLibre and ask only our servers. So everything could be replaced on the two servers, and the websites and apps kept working unchanged.

E2The terms

On 26 November 2026 we read Google Maps Platform's terms as they stood (the Service Specific Terms of 24 November 2026) against how both products used Google. For every service we used, the terms say Google's content "must not" be used "in conjunction with a non-Google map". Our websites draw with Leaflet on an OpenStreetMap map, and the apps with MapLibre.

ServiceNot with a non-Google mapWhat may be cached
DirectionsSection 4.2Latitudes and longitudes only, for 30 days (4.3)
PlacesSection 14.2Latitudes and longitudes only, for 30 days (14.3)
GeocodingSection 6.230 days; longer only per end user (6.3)
Places UI KitAllowed "with or without any map" (15.1)We would answer for not exporting its content or making content from it (15.3)

The review found five problems, the most serious first:

  1. Google's results drawn on non-Google maps, on both websites and in both apps.
  2. Google-made route lines kept for good in four of our timetables, and in a permanent cache on SG-JB Transit's server. The general terms forbid storing Google's content or building new content from it (section 3.2.3).
  3. Passing Google's results on. Malaysia Transit's public tools for AI assistants offered journey planning and place search to any client.
  4. Keeping results too long: plans cached for up to 10 minutes as whole answers, journey legs for 30 minutes, and share links for 7 days.
  5. No Google credit where its results showed.

Breaking the terms lets Google suspend access. If it did, everything Google-backed would stop at once: the journey planner, place search, geocoding and the AI tools, and possibly other projects on the same Google account. And a business partner can't take Google-derived routes or data from us, which closes off working with others on the planner's results.

E3The bill

Google gives each paid service a free monthly allowance, then charges for every 1,000 calls:

ForGoogle itemFree each monthThen, per 1,000
Journey plannerDirections (Essentials)10,000US$5.00
Directions Advanced (Pro)5,000US$10.00
Suggestions as you typeAutocomplete requests10,000US$2.83
The chosen placePlace Details: Essentials, Pro, Enterprise10,000 / 5,000 / 1,000US$5 / 17 / 20
Address to positionGeocoding10,000US$5.00
Places UI KitAutocomplete, per session; Query10,000 eachUS$10.00; US$1.00

Google Maps Platform's pricing list, read on 27 November 2026: the first paid tier after the free allowance.

At today's traffic the bill was small. But one journey search made several Directions calls (the main transit search, the walking legs, and the corridor searches), and both products are free for riders: a cost per search grows with every new rider and earns nothing back. The RTS Link between Johor Bahru and Singapore would bring far more people to the planner.

E4What we needed

Appendix E · The planner

MOTIS: the journey planner

MOTIS is an open-source journey planner from the research world, built to plan across whole countries on modest hardware. It reads the same open timetables and map the apps already use.

E5MOTIS, in brief

MOTIS began at the Technical University of Darmstadt in Germany, in Professor Karsten Weihe's algorithms group, as a research journey planner developed with Deutsche Bahn and the consultancy datagon. Its name first stood for "Multi Objective Travel Information System"; its own documentation now calls it the "Modular Open Transportation Information System". It became open source in 2020, and was rewritten from 2023 as MOTIS 2 (version 2.0 in December 2024), led by Felix Gündling of TU Darmstadt, whose company triptix offers support and hosting for it. It is written in C++ and published under the MIT licence. The version we run, 2.11.4 of 21 October 2026, was the newest release when this paper was written.

PartWhat it doesLicence
nigiriThe timetable and the transit searchMIT
osrRouting on OpenStreetMap's streets: walking, wheelchair, bike and car, with indoor levels and liftsMIT
cistaStoring all of it as compact binary data the server reads straight from diskMIT
adrPlace search and naming points (switched off in our setup)AGPL 3.0
tilesMap tiles from OpenStreetMap (not used: our maps have their own)MIT

Proven at scale. MOTIS powers Transitous, a free, community-run journey planning service started at the FOSDEM conference in 2024. By early 2025 it covered 94 regions with 1,417 timetables and 167 live feeds, and apps such as GNOME Maps, KDE Itinerary and Träwelling plan with it. Its public service is for open-source, non-commercial apps only, which is why we run our own copy (section E7).

E6How MOTIS plans a journey

EACH NIGHT: IMPORT OpenStreetMap streets27 GTFS timetables ImportMOTIS's data Streets for walking; stops linked to the streets; walking transfers between nearby stops; 45 days of timetable, packed for search About 950 MB on disk,switched in only if a testjourney plans EVERY JOURNEY: PLAN StartWalk to stopsTimetable searchWalk from stopsDestination up to 20 min, on streetsone more ride each roundup to 20 min, on streets A walk-only trip (up to 30 minutes) is offered beside the journeys when it is short enough.
MOTIS's two halves: an import that packs streets and timetables into its own data, and a search that answers each journey from that data in milliseconds.

The import reads the OpenStreetMap extract and every timetable, and builds MOTIS's own data: the street network for walking, each stop matched to the streets beside it, walking transfers between nearby stops routed along the streets, and the timetable for the days asked for. Each trip's running days are kept as a row of bits, so a year of timetable costs little more memory than a month. The data is written as binary images the server reads straight from disk, partly through memory-mapped files, without unpacking them first. That is why the server runs in a few hundred megabytes.

The search answers each journey from that data:

  1. First and last mile. From the start, it walks along the streets to every stop within the time allowed (20 minutes in our setup), and does the same backwards from the destination. A walk-only trip is offered too, when it is short enough.
  2. Round by round. The timetable search comes from the RAPTOR family (round-based public transit routing, Delling, Pajor and Werneck, 2012). Round one finds the earliest arrival at every stop with one ride; each further round adds one more ride, scanning only the routes through stops that improved in the round before, then the walking transfers from them. A journey is kept only if no other beats it on both arrival time and number of changes, so the answer is a short list of real choices: the quickest, and those with fewer changes.
  3. Across the whole hour. The search runs over the search window (an hour in our setup), so a rider is offered the good departures in that hour, not just one.
  4. Legs, with their lines. Each journey comes back as walks along the streets and rides with their route, stops, times and line.

MOTIS also reads timetables in NeTEx, live updates (GTFS Realtime, SIRI and others) and bike and scooter sharing (GBFS). Our setup needs none of these today.

E7MOTIS against the alternatives

OpenTripPlanner, the best-known open-source planner, was the first idea. On 26 November 2026 it was compared with everything else on offer, on licence and cost, memory, features, whether it would fit our server, and the work involved:

OptionLicence and costMemory and serverVerdict
MOTIS 2, self-hostedMIT: free, commercial use allowed; credit OpenStreetMapMeasured: import 1 min 16 s at a 2.7 GB peak, then about 365 MB to runChosen
OpenTripPlanner 2, self-hostedLGPL: freeKeeps all its data in memory: its documentation puts all of Finland at a little over 10 GBToo heavy for our server
Transitous (hosted MOTIS)Free, but only for open-source, non-commercial apps, and it may stop serving any appNothing to runRuled out by its usage policy
Valhalla, GraphHopperOpen source—Strong for walking and driving, weaker for timetabled transit: walking routers only
Our own planner engineOurs—Possible (there was one before Google), but it would rebuild what MOTIS does
Paid routing servicesPer requestNothing to runThe same per-request bill and terms questions as Google
Keep Google DirectionsUS$5.00 per 1,000 after 10,000 freeNothing to runNot allowed with our maps

Why not OpenTripPlanner

OpenTripPlanner is the best-known open-source planner. It was started in 2009 with funding from Portland's transit agency, TriMet, is written in Java and published under the LGPL, and runs national journey planners for Entur in Norway and Digitransit in Finland. Its second version (2020), led by Entur, brought a RAPTOR-based transit search. It is mature and well documented. But it keeps all its data in memory, and its own documentation puts all of Finland at a little over 10 GB, and Germany at 95 GB: more than our server could spare beside the live apps. MOTIS imported our whole region at a 2.7 GB peak and serves it in a few hundred megabytes.

Two comparisons published elsewhere point the same way:

Where OpenTripPlanner is ahead: a longer record as a national planner, a larger community and more documentation. For one small server, MOTIS's memory use decided it.

The others

E8Our MOTIS setup

The 27 timetables

FromTimetables
data.gov.my (15)KTMB; BAS.MY in Alor Setar, Ipoh, Johor Bahru, Kangar, Kota Bharu, Kuala Terengganu, Kuching, Melaka and Seremban (two); Prasarana's Rapid KL buses, Rapid KL trains, MRT feeder buses and Rapid Penang
Ours (10)Causeway Link, and its AA1 airport bus (the only bus to Senai Airport); the Singapore cross-border buses; City Public Link S19; SRT's Padang Besar–Hat Yai shuttle; KLIA Ekspres and KLIA Transit; the Penang ferry; BAS.MY Kuantan; Bas Muafakat Johor, in Johor Bahru and the rest of Johor
Built from LTA DataMall and OpenStreetMap (2)Singapore's buses, and Singapore's MRT and LRT (section E9)

Readying the timetables

MOTIS reads timetables strictly, and plans only on dates a timetable's calendar covers. A preparation step repairs what it can before every import, and prints what it changed:

The settings that matter

SettingOursWhat it means
Days loaded45, from todayJourneys can be planned up to six weeks ahead
Walking transfersAlong the streets, up to 15 minutesChanging between nearby stops follows real footpaths, not straight lines
Least time to change2 minutesWhere a timetable doesn't say
Walking links between stopsWithin 100 mStops this close are joined by a walking transfer
Stops matched to streetsWithin 25 m (250 m worked out ahead)How far a stop may be from the street it is matched to for walking
Route shapesKeptA timetable's own lines are kept for each ride
Place search, live updatesOffGrabMaps finds places; data.gov.my publishes no delay predictions to feed in

The nightly refresh

Every night at 04:15 Malaysia time (03:15 in Europe's summer), a script fetches data.gov.my's feeds (keeping the last good copy of any that fails), takes our own timetables from the running Malaysia Transit server and Singapore's data from SG-JB Transit's, rebuilds Singapore's two timetables, readies them all and imports them into a copy of MOTIS's data. MOTIS switches to the new data only if the import worked, and switches back if it then can't plan a test journey from KL Sentral to KLCC. An import of new timetables alone takes about 35 seconds at a 1.2 GB peak; with new streets, about 1½ minutes at a 2.7 GB peak. No import starts with less than 3.5 GB of memory free.

E9Singapore and southern Thailand

Neither place had what MOTIS needs out of the box, so we built it.

Singapore's buses

LTA DataMall publishes each service's stops, its first and last buses, and how often it runs in four parts of the day, but no timetable. So trips run from the first bus to the last, at the middle of LTA's range for that part of the day ("09–16" minutes becomes every 12½); AM peak 06:30–08:59, AM off-peak 09:00–16:59, PM peak 17:00–19:29, and PM off-peak the rest. Times along the route come from LTA's distances at 25 km/h, at least a minute a stop. Weekdays, Saturdays and Sundays run apart, and public holidays on Sunday times. Result: 584 services and 152,170 trips. Services 160, 170, 170X and 950 come from our cross-border timetable instead.

Singapore's MRT and LRT

LTA publishes station codes and order, but no timetables or positions. So each line's stations, in order, and their positions come from OpenStreetMap's route relations, and trains run at the usual headways: every 3 minutes in weekday peaks (07:00–09:00, 17:00–20:00), 5 otherwise and 6 after 20:00; LRT every 4, 6 and 8; the Changi Airport branch every 7. First trains 05:30 (06:00 on Sundays and holidays), last 23:45 from each end; 45 km/h between stations (LRT 30), plus half a minute at each. Result: 9 lines and 434 platforms, each drawn along its track. The Jurong Region Line joins when it opens.

E10How our server uses MOTIS

The websites and apps never talk to MOTIS. They ask our servers, which ask MOTIS and turn its answer into the journeys riders see.

StepWhat the server does
AskOne plan request (/api/v6/plan) from the start to the destination, leaving at or arriving by the time asked, over a one-hour search window, with up to 20 minutes' walk at each end and up to 30 minutes for a walk-only trip.
ChooseMOTIS gives every good journey in the hour searched: 28 for Tampines to HarbourFront at 08:30, with a train every few minutes. The server keeps those arriving soonest (leaving latest, for "arrive by"), at most two of each combination of routes so other ways still show, and drops any journey more than twice as long as the shortest, or more than 30 minutes longer, whichever allows more. (With AA1 hourly, Senai Airport to Eco Galleria once also offered a 763-minute overnight trip through Singapore beside a 155-minute one.)
Hard-to-place pointsA point MOTIS can't place on its street map, such as a footway inside a mall that doesn't join the streets, is planned from the nearest stop within 700 m, with a straight walk to it.
Same shape as beforeThe answer is turned into the shape Google's answers had (walking and transit steps), so the planner's route matching, stops, fares, filters and sorting stay exactly as they were, and the websites and apps needed no change.
DrawEach ride is drawn along its route's Enhanced line from OpenStreetMap (Appendix D), as the route views draw it.
AddFares in ringgit and Singapore dollars (with Causeway Link's free-transfer rule), how to pay on each operator, live times and approaching buses on top of the plan, share links, and the hand-off between the two apps.

The switch is a setting on each server. Until Google's code is deleted, removing one setting brings Google back with a redeploy, as a way back if anything goes badly wrong.

E11Results

The trial (26 November 2026)

MOTIS 2.11.4 on the VPS, capped at 3 GB and 2 CPUs at low priority, with the Malaysia–Singapore–Brunei map and 23 timetables. The import took 1 minute 16 seconds at a 2.7 GB peak and 918 MB on disk; the server then used about 365 MB and answered each journey in 9 to 110 milliseconds. It was as good as or better than the Google-based planner on most of 22 test journeys, and planned directly on our own timetables, the ferry, S19, Causeway Link and SRT's shuttle among them. What it got wrong at first came from our data, not from MOTIS:

In the trialCauseFix
KLIA T1 to KL Sentral offered the next day's 05:00 trainOur KLIA timetable held one sample train per directionAll 305 trains (118 KLIA Ekspres, 187 KLIA Transit): 08:39 by KLIA Ekspres, 30 minutes
No Penang ferry tripsService names in two cases; a calendar that ended on 31 December 2025; terminals marked as stationsRebuilt from the ferry's schedule with all three fixed
Komtar to Penang Airport by bus 302 (117 minutes)The test's airport point was off the terminalAt the terminal MOTIS offers 401E and 102
No trip to a point in Hat YaiThailand's streets weren't in the mapSongkhla merged in: Kangar to Hat Yai town plans door to door
No trip from a point inside Ipoh ParadeThe point couldn't be placed on the street mapPlanned from the nearest stop within 700 m
Calendars ending too soonToday-only calendars; KTMB's ending 10 December, Rapid Penang's 20 DecemberCalendars run on for 60 days before each import
Causeway Link trips after midnight ran backwardsTimes written 00:xx instead of 24:xxFixed in the build script (28 trips)

Fixing our timetables for a strict planner also fixed the live sites' departure pages, which read the same files.

Against Google (Friday 27 November 2026, from 08:30)

JourneyMOTISGoogleRoutes
KL Sentral → Suria KLCC1930Kelana Jaya line (both)
Bangsar South → Mid Valley2537
SS2 Petaling Jaya → Bukit Bintang5255T816, Kajang line (both)
KLIA T1 → KL Sentral3035KLIA Ekspres (both)
Shah Alam Seksyen 7 → KL Sentral75106753, 750; Google: LRT
Kajang → Putrajaya Sentral6376
Seremban → KL Sentral122errorN50, N57, KLIA Ekspres
Komtar → Penang Airport6750401E (102 also offered, 52); Google: 102
Penang Sentral → Weld Quay1939Ferry (both)
Batu Ferringhi → Komtar4345102 (both)
Bukit Mertajam → Penang Sentral5645701; Google: CT14, KTM
JB Sentral → Larkin Sentral2922CW2 (both)
JB Sentral → Kranji MRT2126160; Google: 170X
Taman Universiti → JB Sentral6453J31, J30; Google: P211, J30
Kulai → JB Sentral6499J30; Google: P411, J30
Kuching Waterfront → Kuching Sentral1436Q15; Google: Q14
Serian → Tebedu6260S19 (both)
Ipoh station → Ipoh Parade1012A33B (both)
Melaka Sentral → Jonker Street2222M22; Google: M13
Kangar → Hat Yai town187176R11, SRT shuttle; Google adds R105
Kangar → Hat Yai Junction179169The same
KB Mall → Kota Bharu bus terminal2927D50 (both)
Pasar Payang → UMT Kuala Terengganu6066T10 (both)
Kuantan Sentral → East Coast Mall4126C30, C50; Google: C33
Alor Setar station → Aman Central1218K50; Google: K30

Minutes door to door; the quicker in bold. MOTIS was quicker on 15, level on 1, and Google quicker on 9, by 2 to 17 minutes.

Appendix E · Place search

GrabMaps: finding the places

A journey starts with a place a rider types: a mall, a condominium, a clinic, an address. GrabMaps knows South-East Asia's places, and its terms let us show them on our own maps.

E12GrabMaps, in brief

GrabMaps is the map of Grab, South-East Asia's ride-hailing and delivery company. Grab began building it in 2017, launched it as a service for businesses in June 2022, and runs its own apps on it. Its data comes from Grab's own community: millions of rides and deliveries a day, its driver and delivery partners (some paid to collect places, street names and street-level imagery with Grab's own cameras), merchants and customers, on OpenStreetMap as the base layer. Amazon says a local team of more than 1,000 people maintains it.

Amazon Location Service has offered GrabMaps since January 2023, and since March 2026 through its newer Places operations, with nothing to set up beyond a key, in two regions: Asia Pacific (Singapore) and Asia Pacific (Malaysia), which we use. It covers eight countries and over 500 cities: Malaysia, Singapore, Thailand, Indonesia, the Philippines, Vietnam, Myanmar and Cambodia. Brunei is not among them.

E13How place search works

Our servers call four of Amazon Location Service's Places operations, in its Asia Pacific (Malaysia) region, where they answer with GrabMaps' data:

OperationUsed forPrice bucket
SuggestThe search box: suggestions as the rider types (GrabMaps has no Autocomplete)Label: US$0.20 per 1,000
GetPlaceThe position and address of the suggestion pickedCore: US$0.50 per 1,000
ReverseGeocodeA name for a point picked on the map, and "where am I"Core: US$0.50 per 1,000
SearchTextA typed address or place name to one position, for the developer APICore: US$0.50 per 1,000

E14GrabMaps against Google

Google's own answer to the terms problem is Places UI Kit, which may be shown on any map. It would have done, had it worked the way our search does. It doesn't, and the comparison on 26 November 2026 went like this:

Google Places UI KitGrabMaps through AmazonPhoton (OpenStreetMap)
With our mapsAllowed (15.1)Allowed: Amazon's terms (Service Terms, section 82) put no limit on showing GrabMaps' results on our mapsAllowed, with the credit
PlacesGoogle's: the most completeGrab's own, curated for South-East AsiaOpenStreetMap's: thinner for shops, condominiums and buildings
Works like our searchNo: Google's own widget, not our list; no React Native version, so native work in both apps; a suggestion gives only an id, and its position needs a second, paid componentYes: our server calls it and answers as before, so nothing else changesYes, self-hosted
Planning from the placeA grey area (15.3): would need Google's written OKFine: don't store results unless the request says so, keep Grab's credit, and don't merge Grab's places into OpenStreetMap dataFine
At 100,000 searches a monthAbout US$990About US$70Free, on our server

GrabMaps was chosen, with self-hosted Photon recommended as a fallback (and for Brunei, which GrabMaps doesn't cover). MOTIS has an OpenStreetMap place search of its own, but OpenStreetMap has fewer of Malaysia's shops and condominiums than Google or Grab, so it is switched off and GrabMaps does the job.

Prices, side by side

Amazon, Asia Pacific (Malaysia)Per 1,000
Suggest (Label, what we ask for)US$0.20
Suggest with extra fields (Core)US$0.50
GetPlace, ReverseGeocode, SearchText (Core)US$0.50
With hours, contacts and similar (Advanced)US$1.50
Marked for keeping (Stored)US$4.00
Searches a monthGrabMapsPlaces UI Kit
10,000US$7Nothing (free allowance)
100,000US$70US$990

Amazon's price list for Asia Pacific (Malaysia), published 11 September 2026, and Google's pricing list, both read on 27 November 2026. One suggestion request and one lookup per search, after the free allowances; Amazon's free tier gives 10,000 suggestions and 20,000 lookups a month for the first three months. Suggestions go out as the rider types: a search with five suggestion requests costs about US$1.50 per 1,000 searches, still a fraction of Google's.

Quality, from the live test

Appendix E · Together

What the change adds up to

MOTIS and GrabMaps each do one job well. Together they cover everything Google did for our planner, on terms that fit our products.

E15The pair against Google alone

Google alone (before)MOTIS and GrabMaps (now)
Allowed with our mapsNo: Directions, Places and Geocoding results may not be shown on a non-Google mapYes: MOTIS is ours (MIT licence, OpenStreetMap streets), and Amazon allows GrabMaps' results on our maps
Suspension riskPlanner, search and geocoding could all stop at onceNo Google dependency left in the planner or search
Journey costUS$5 per 1,000 Directions calls after 10,000 free, several calls per searchNothing per journey, on the server already paid for
Search costUS$2.83 to US$20 per 1,000 calls after the free allowanceUS$0.20 per 1,000 suggestions, US$0.50 per 1,000 lookups
As riders growGrows with every free riderPlanner: only server capacity. Search: grows, slowly
Our own timetablesGoogle planned on its own data; our services needed hand-built workarounds (S19, SRT, Causeway Link)Planned directly on our timetables, plus Singapore's
Trips Google failed onSeremban to KL Sentral returned an errorPlanned: peak Seremban Line trains when they run, otherwise a bus and KLIA Ekspres
SpeedA call out to Google for each search9 to 110 ms per plan, inside our server
Keeping and sharingCoordinates only, for 30 days; nothing passed onJourney results are ours; GrabMaps' answers aren't kept
Working with partnersA partner can't take Google-derived routes or dataRouting and route lines are ours to offer, with the OpenStreetMap credit
US$0
for 100,000 journeys a month with MOTIS, against at least US$450 with Google Directions
US$70
for 100,000 place searches a month, against about US$990 with Places UI Kit
95%
less for the two together at that traffic: about US$70 against about US$1,440
€12.60
a month for the server that runs the planner, both products' servers and more

E16Trade-offs and risks

Upkeep is ours

MOTIS is one more container to keep healthy on a server whose memory is tight. A failed nightly refresh keeps yesterday's data, so someone has to notice. New street maps are loaded by hand every month or two, and MOTIS's version is pinned, so upgrades are a deliberate job.

Only as good as the timetables

data.gov.my's feeds have quirks (today-only calendars, descriptions where route numbers go, stop positions that slow some trips), and the preparation step repairs what it can. Singapore's timetables are built from frequencies, not published.

No live delays in plans

data.gov.my publishes bus positions, not delay predictions, so plans follow the timetable. Our own live-arrival times are shown on top of each planned ride.

No second planner

With Google switched off, there is nothing to fall back to if MOTIS is down. Place search deliberately doesn't fall back to Google, since that is exactly what the terms forbid: a GrabMaps outage says suggestions are unavailable. Everything runs on one server.

GrabMaps' weak spots

English descriptions, short names and Brunei (section E14). The recommended Photon fallback isn't built yet.

Licences and terms to keep

Credit "© OpenStreetMap contributors" where its data shows. Don't store GrabMaps' answers, keep Grab's credit, and never merge Grab's places into OpenStreetMap-licensed data. MOTIS's own code is MIT, but its place-search library, adr, is under the AGPL, whose extra duties apply to changed copies offered over a network; we run the official image unchanged, with place search off.

E17What comes next

E18Sources

MOTIS: github.com/motis-project/motis (README, setup guide, API specification, and release 2.11.4 of 21 October 2026); its libraries nigiri, osr and tiles (github.com/motis-project), cista (github.com/felixguendling/cista) and adr (github.com/triptix-tech/adr); the FOSDEM 2025 talk "GNOME Maps meets Transitous meets MOTIS". RAPTOR: D. Delling, T. Pajor and R. F. Werneck, "Round-Based Public Transit Routing", ALENEX 2012.

Transitous: transitous.org, and its usage policy, transitous.org/api.

OpenTripPlanner: docs.opentripplanner.org (history, version comparison, system requirements and deployments).

Comparisons: SKI+, "Open Source Routers – A comprehensive comparative market research", version 1.1, November 2025 (oev-info.ch); TransCAPI, "Replacing OpenTripPlanner with MOTIS for Great Britain", 16 October 2026 (transcapi.com).

Other planners: Navitia, github.com/hove-io/navitia; R5, github.com/conveyal/r5; Valhalla, github.com/valhalla/valhalla; GraphHopper, github.com/graphhopper/graphhopper.

GrabMaps' history: Grab's press release of 8 June 2022; Amazon's announcements of 10 January 2023 and 31 March 2026; Amazon's GrabMaps page (countries, regions and data).

Google Maps Platform: Service Specific Terms (version of 24 November 2026), cloud.google.com/maps-platform/terms/maps-service-terms; Terms of Service, cloud.google.com/maps-platform/terms; pricing, developers.google.com/maps/billing-and-pricing/pricing; Places UI Kit, developers.google.com/maps/documentation/javascript/places-ui-kit (all read 26–27 November 2026).

Amazon Location Service and GrabMaps: pricing and free tier, aws.amazon.com/location/pricing; AWS's price list for Asia Pacific (Malaysia), published 11 September 2026; Places price buckets, docs.aws.amazon.com/location/latest/developerguide/places-pricing.html; GrabMaps' countries and regions, docs.aws.amazon.com/location/latest/developerguide/GrabMaps.html; data attribution, docs.aws.amazon.com/location/latest/developerguide/data-attribution.html; AWS Service Terms, section 82, aws.amazon.com/service-terms (read 26–27 November 2026).

Place search fallback: Photon, github.com/komoot/photon.

Data: data.gov.my's GTFS feeds (CC BY 4.0); LTA DataMall (Singapore Open Data Licence); OpenStreetMap (© OpenStreetMap contributors, ODbL), through Geofabrik's extracts.

Malaysia Transit's own records: the plan, comparisons and trial results (docs/google-maps-replacement-plan.md), the server scripts and nightly refresh (scripts/motis/), the planner client (lib/motisPlanner.js) and the place search client (lib/grabMapsPlaces.js).