Skip to content

Commit d3626fa

Browse files
committed
Trains: the desktop app's map, along the real tracks
- Every line follows the rails its trains run today, cut from AT's shapes; lines that share rails sit side by side and ease on and off the shared track; stations with platforms on different tracks get a bar joining them - Te Huia from The Strand to Hamilton - Trains snap onto their own line, pointing the way they're going - A quiet Diagram map (land, water, parks, suburb names), plus Satellite and Map; station names by importance as you zoom in - The map's lines, bars, stops and names are data-driven MapLibre layers - AT's line colours as the desktop app has them - Credits: made by AryanPCS (tap it), programmed with Claude Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011C2fAvFFcMRkaF7qSvRA1v
1 parent 676d630 commit d3626fa

8 files changed

Lines changed: 919 additions & 426 deletions

File tree

‎README.md‎

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,27 @@ the rest), sorted by how many are out right now.
153153

154154
## Trains
155155

156-
A live map of the post-CRL network, drawn after AT's official "Ngā Tereina"
157-
map. It has the red City Rail Link loop (Waitematā, Te Waihorotiu,
158-
Karanga-a-Hape, Grafton, Newmarket, Parnell), and E-W and O-W run side by side
159-
out west. Harbours and volcanic cones sit behind it.
160-
161-
- **Every train, live.** Markers glide between GPS fixes, show their direction
162-
of travel, and carry an orange or red dot when a train is running 2 or 5+
163-
minutes late.
164-
- **Pinch, pan and double-tap to zoom.** All 44 station names appear as you
165-
zoom in, placed so they never overlap.
166-
- **Tap a train** for its destination, speed, delay, how full it is and its
167-
carriage number. You also get its next ten stops with expected times.
168-
- **Tap a station** for live departures from every platform, with line,
169-
destination, delay and countdown.
156+
Auckland's rail network on a real map, drawn the way the desktop app draws it,
157+
with every train live on it.
158+
159+
- **The real tracks.** Each line follows the rails its trains run on today, cut
160+
from the shapes in AT's timetable. Where lines share rails they run side by
161+
side in AT's colours (E-W, S-C, O-W), easing on and off the shared track so
162+
they meet and part without crossing. Stations whose platforms are on different
163+
tracks get a bar joining them, as on AT's map. Straight lines stand in until
164+
the timetable has loaded.
165+
- **Te Huia** runs from The Strand out along the eastern line and on to
166+
Hamilton.
167+
- **Every train, live**, snapped onto its own line and pointing the way it's
168+
going, with an orange or red dot when it's running 2 or 5+ minutes late.
169+
- **Diagram, Satellite or Map.** Diagram is a quiet map (land, water, parks and
170+
suburb names) that lets the lines stand out. Station names appear as you zoom
171+
in, the most important first.
172+
- **Tap a train** for its destination, speed, delay, how full it is, and its
173+
next stops with expected times. **Tap a station** for live departures from
174+
every platform.
170175
- **Line filters** (E-W, S-C, O-W) with live counts, and a network overview
171-
showing how many trains on each line are running late.
172-
- **Diagram, Satellite or Map.** Switch from the schematic to every train at
173-
its real GPS position over aerial photos or a street map.
174-
- Light and dark map, following the system theme. Landscape puts the map
176+
showing how many trains on each line are running late. Landscape puts the map
175177
beside the panel.
176178

177179
## How it's built
@@ -258,4 +260,5 @@ Local builds need JDK 17, the Android SDK and Gradle 8.11:
258260
`gradle :app:assembleRelease`. Without the signing secrets, you get a
259261
debug-signed APK.
260262

261-
Not affiliated with Auckland Transport.
263+
Made in Tāmaki Makaurau by AryanPCS, programmed with Claude (Anthropic). Not
264+
affiliated with Auckland Transport.

‎app/src/main/java/nz/aryan/akllive/Settings.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ data class Settings(
8282
val dynamicColor: Boolean = false,
8383
val pureBlack: Boolean = false,
8484
val basemap: Basemap = Basemap.Satellite,
85+
/** the Trains map: the quiet diagram, satellite or streets */
86+
val trainView: Basemap = Basemap.Diagram,
8587
/** how long it takes to walk to your stop, for "leave in" */
8688
val walkMin: Int = 4,
8789
/** heads-up this many minutes before a tracked bus */
@@ -120,6 +122,7 @@ class Prefs(ctx: Context) {
120122
dynamicColor = p.getBoolean("dynamic", false),
121123
pureBlack = p.getBoolean("pureBlack", false),
122124
basemap = if (p.getString("basemap", null) == "streets") Basemap.Streets else Basemap.Satellite,
125+
trainView = enumOr(p.getString("trainView", null), d.trainView),
123126
walkMin = p.getInt("walkMin", d.walkMin),
124127
alertMin = p.getInt("alertMin", d.alertMin),
125128
haptics = p.getBoolean("haptics", true),
@@ -162,6 +165,7 @@ class Prefs(ctx: Context) {
162165
.putBoolean("dynamic", s.dynamicColor)
163166
.putBoolean("pureBlack", s.pureBlack)
164167
.putString("basemap", if (s.basemap == Basemap.Streets) "streets" else "satellite")
168+
.putString("trainView", s.trainView.name)
165169
.putInt("walkMin", s.walkMin)
166170
.putInt("alertMin", s.alertMin)
167171
.putBoolean("haptics", s.haptics)

‎app/src/main/java/nz/aryan/akllive/data/MapData.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ object MapData {
66
const val H = 240f
77
val LINE_IDS = arrayOf("E-W", "S-C", "O-W")
88
val LINE_NAMES = arrayOf("East West", "South City", "Onehunga West")
9-
val LINE_COLORS = longArrayOf(0xFF8CC63F, 0xFFDA291C, 0xFF1D9BD7)
9+
// AT's line colours, as the desktop app draws them
10+
val LINE_COLORS = longArrayOf(0xFF97C93D, 0xFFD52923, 0xFF00AEEF)
1011
// drawing paths (corners already rounded), x,y pairs in map units
1112
val LINE_DRAW: List<FloatArray> = listOf(
1213
f("20.00,54.00,20.00,67.00,20.00,79.65,20.00,79.73,20.00,79.82,20.01,79.91,20.01,80.00,20.02,80.09,20.02,80.18,20.03,80.26,20.04,80.35,21.24,90.45,21.32,90.96,21.44,91.45,21.60,91.92,21.79,92.37,22.02,92.80,22.30,93.21,22.61,93.61,22.96,93.99,35.48,106.52,47.11,118.14,47.56,118.55,48.04,118.91,48.53,119.21,49.05,119.46,49.59,119.65,50.16,119.79,50.75,119.87,51.36,119.90,63.00,119.90,78.00,119.90,92.00,119.90,102.64,119.90,103.25,119.87,103.84,119.79,104.41,119.65,104.95,119.46,105.47,119.21,105.96,118.91,106.44,118.55,106.89,118.14,113.02,112.02,121.52,103.52,130.02,95.02,138.52,86.52,154.03,71.77,154.47,71.32,154.85,70.84,155.17,70.33,155.43,69.80,155.64,69.24,155.78,68.66,155.87,68.06,155.90,67.42,155.90,53.00,155.90,41.90,155.99,40.49,156.28,39.27,156.74,38.24,157.40,37.40,158.24,36.74,159.28,36.27,160.49,35.99,161.90,35.90,186.00,35.90,216.00,35.90,240.00,35.90,264.00,35.90,290.10,35.90,291.51,35.99,292.73,36.27,293.76,36.74,294.60,37.40,295.26,38.24,295.73,39.27,296.01,40.49,296.10,41.90,296.10,62.00,296.10,86.00,296.10,110.38,296.07,110.99,295.99,111.58,295.85,112.15,295.66,112.69,295.41,113.21,295.11,113.70,294.75,114.18,294.34,114.63,271.21,137.76,270.95,138.05,270.72,138.35,270.53,138.66,270.38,138.98,270.26,139.33,270.17,139.68,270.12,140.05,270.10,140.43,270.10,142.00,270.10,153.00,270.10,164.00,269.66,170.81,269.65,171.47,269.70,172.11,269.82,172.73,270.01,173.32,270.26,173.88,270.58,174.43,270.96,174.94,271.40,175.44,293.48,197.52"),

0 commit comments

Comments
 (0)