Skip to content

Commit 3a6e3cb

Browse files
committed
Bus photos from the AT Metro Wiki, saved on the phone, on the Home cards too
Each model points at its wiki page and takes that page's lead photo; the loose Commons searches that turned up a boat for the eT12 are gone, and Commons is only a fallback when the file name names the model. Photos are fetched ahead of time and kept in app storage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011C2fAvFFcMRkaF7qSvRA1v
1 parent 4ba61c1 commit 3a6e3cb

7 files changed

Lines changed: 160 additions & 66 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ Hillsborough, both directions (stop 8669 to Britomart, 8664 to Waikowhai).
8484
</p>
8585
<p align="center"><sub>Fleet · A model's page · Fleet dex</sub></p>
8686

87-
- **Fleet**: every bus model in Auckland with a real photo (from Wikimedia
88-
Commons, credited on each), how many are out right now, and who runs them.
87+
- **Fleet**: every bus model in Auckland with a real photo (from its
88+
[AT Metro Wiki](https://atmetro.fandom.com) page, credited on each), how
89+
many are out right now, and who runs them. The photos are saved on the
90+
phone, and the bus coming to your stop shows its photo too.
8991
- **A model's page**: specs, a short history, the fleet numbers each operator
9092
uses, and a live map of every one of them on the road.
9193
- **Fleet dex**: every model that pulls up at your Home stops gets spotted and

‎app/src/main/assets/models.json‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
[
22
{
3-
"id": "et12", "name": "CRRC eT12 MAX", "maker": "CRRC", "electric": true, "decks": 1, "axles": 3,
3+
"id": "et12", "wiki": ["CRRC eT12 MAX"], "key": "eT12", "name": "CRRC eT12 MAX", "maker": "CRRC", "electric": true, "decks": 1, "axles": 3,
44
"specs": [["Length", "12.7 m"], ["Seats", "37–40"], ["Motor", "240 kW"], ["Top speed", "80 km/h"], ["In Auckland since", "2022"]],
55
"about": "A long three-axle electric bus from Zhejiang CRRC, and the most common electric bus in Auckland. NZ Bus brought in the first ones in 2022–23, Tranzurban's arrived in late 2024 for the 11T and 11W, and Ritchies has been adding batches through 2025 and 2026. NZ Bus's NB5778–5786 wear the Tāmaki Link colours."
66
},
77
{
8-
"id": "ed12", "name": "CRRC eD12 MAX", "maker": "CRRC", "electric": true, "decks": 2,
8+
"id": "ed12", "wiki": ["CRRC eD12 MAX"], "key": "eD12", "name": "CRRC eD12 MAX", "maker": "CRRC", "electric": true, "decks": 2,
99
"specs": [["Length", "12.0 m"], ["Height", "4.25 m"], ["Motor", "350 kW"], ["Top speed", "90 km/h"], ["In Auckland since", "2024"]],
1010
"about": "Auckland's first fully electric double-decker. Kinetic unveiled it in March 2024 and NB5400 went into service on the 18, 25B and 25L that April. Tranzurban's fleet has run the 12 and WX1 since April 2025: the ocean-blue ones on the 12, the Shore-liveried ones on the WX1."
1111
},
1212
{
13-
"id": "es12", "name": "CRRC eS12 MAX", "maker": "CRRC", "electric": true, "decks": 1, "axles": 2,
13+
"id": "es12", "wiki": ["CRRC eS12 MAX"], "key": "eS12", "name": "CRRC eS12 MAX", "maker": "CRRC", "electric": true, "decks": 1, "axles": 2,
1414
"specs": [["Length", "11.3 m"], ["Seats", "31–33"], ["Motor", "240 kW"], ["Top speed", "80 km/h"], ["In Auckland since", "2021"]],
1515
"about": "The shorter, two-axle CRRC electric. It started on the City Link with NZ Bus in 2021 (two of those now do the Inner Link), and Ritchies runs a big fleet of them."
1616
},
1717
{
18-
"id": "c13e", "name": "Geely C13E", "maker": "Geely", "electric": true, "decks": 1, "axles": 3,
18+
"id": "c13e", "wiki": ["Geely C13E"], "key": "C13E", "name": "Geely C13E", "maker": "Geely", "electric": true, "decks": 1, "axles": 3,
1919
"specs": [["Built by", "Farizon (Geely)"], ["In Auckland since", "2024"]],
2020
"about": "A three-axle electric bus from Farizon, Geely's commercial-vehicle brand. Kinetic's NZ Bus put the first ones into service in June 2024, and a second batch with bigger batteries joined in 2025 on routes between the city and the North Shore."
2121
},
2222
{
23-
"id": "c10e", "name": "Geely C10E", "maker": "Geely", "electric": true, "decks": 1,
23+
"id": "c10e", "wiki": ["Geely C10E"], "key": "C10E", "name": "Geely C10E", "maker": "Geely", "electric": true, "decks": 1,
2424
"specs": [["Built by", "Farizon (Geely)"], ["Runs", "Inner and Outer Link"]],
2525
"about": "The shorter sibling of the Geely C13E, from the same Farizon factory. Kinetic's NZ Bus runs them on the Inner Link and Outer Link; NB6103 was the first to carry passengers on the Outer Link."
2626
},
2727
{
28-
"id": "e12", "name": "Yutong E12", "maker": "Yutong", "electric": true, "decks": 1, "axles": 2,
28+
"id": "e12", "wiki": ["Yutong E12"], "key": "Yutong E12", "name": "Yutong E12", "maker": "Yutong", "electric": true, "decks": 1, "axles": 2,
2929
"specs": [["Seats", "26 on the Airport Link"], ["In Auckland since", "2020"]],
3030
"about": "A two-axle electric bus from Zhengzhou Yutong. Go Bus brought them in for the Airport Link in 2020; luggage racks down both sides cut the seats to 26 (the city version seats 34–36)."
3131
},
3232
{
33-
"id": "e13", "name": "Yutong E13", "maker": "Yutong", "electric": true, "decks": 1, "axles": 3,
33+
"id": "e13", "wiki": ["Yutong E13"], "key": "Yutong E13", "name": "Yutong E13", "maker": "Yutong", "electric": true, "decks": 1, "axles": 3,
3434
"specs": [["Seats", "36"], ["Carries", "up to 78"], ["In Auckland since", "2020"]],
3535
"about": "Yutong's three-axle electric. Howick & Eastern introduced it on route 70 in 2020; Ritchies and Tranzurban run a few as well."
3636
},
3737
{
38-
"id": "e200", "name": "Alexander Dennis Enviro200", "maker": "Alexander Dennis", "electric": false, "decks": 1, "axles": 2,
38+
"id": "e200", "wiki": ["Alexander Dennis Enviro 200", "Alexander Dennis Enviro200"], "key": "Enviro200", "name": "Alexander Dennis Enviro200", "maker": "Alexander Dennis", "electric": false, "decks": 1, "axles": 2,
3939
"specs": [["Seats", "35–37"], ["Doors", "2"], ["In Auckland since", "2011"]],
4040
"about": "The diesel workhorse of NZ Bus. It arrived in 2011 on the City Link, and at its peak NZ Bus ran more than 300 of them across Auckland, Tauranga and Wellington. Bodies came from Kiwi Bus Builders and Alexander Dennis; the last ones for mainland Auckland were built in 2015."
4141
},
4242
{
43-
"id": "e200mmc", "name": "Alexander Dennis Enviro200 MMC", "maker": "Alexander Dennis", "electric": false, "decks": 1, "axles": 2,
43+
"id": "e200mmc", "wiki": ["Alexander Dennis Enviro 200 MMC", "Alexander Dennis Enviro200 MMC", "Alexander Dennis Enviro 200"], "key": "Enviro200", "name": "Alexander Dennis Enviro200 MMC", "maker": "Alexander Dennis", "electric": false, "decks": 1, "axles": 2,
4444
"specs": [["In Auckland since", "2017"]],
4545
"about": "The second-generation Enviro200 (MMC stands for Major Model Change), in Auckland since 2017. Ritchies also runs a shorter single-door version, the Enviro200 Midi."
4646
},
4747
{
48-
"id": "e200evxlb", "name": "BYD ADL Enviro200EV XLB", "maker": "BYD", "electric": true, "decks": 1, "axles": 3,
48+
"id": "e200evxlb", "wiki": ["BYD ADL Enviro200EV", "Alexander Dennis Enviro200EV", "Alexander Dennis Enviro 200 EV", "BYD ADL Enviro 200EV"], "key": "Enviro200EV", "name": "BYD ADL Enviro200EV XLB", "maker": "BYD", "electric": true, "decks": 1, "axles": 3,
4949
"specs": [["Length", "12.6 m"], ["Battery", "348 kWh"], ["Seats", "36"], ["Carries", "up to 78"], ["In Auckland since", "2021"]],
5050
"about": "A three-axle electric built as a partnership: BYD's batteries and driveline under an Alexander Dennis body. It seats 36 and carries up to 78 people, with two wheelchair spaces."
5151
},
5252
{
53-
"id": "e500", "name": "Alexander Dennis Enviro500", "maker": "Alexander Dennis", "electric": false, "decks": 2, "axles": 3,
53+
"id": "e500", "wiki": ["Alexander Dennis Enviro 500", "Alexander Dennis Enviro500"], "key": "Enviro500", "name": "Alexander Dennis Enviro500", "maker": "Alexander Dennis", "electric": false, "decks": 2, "axles": 3,
5454
"specs": [["Length", "12.5 m"], ["Height", "4.2 m"], ["Seats", "55 up, 31–36 down"], ["Engine", "Cummins ISL9"]],
5555
"about": "The big three-axle diesel double-decker. NZ Bus's 5000 series work the busiest isthmus routes (the 18, 25B, 25L, 27H, 27W, 30 and 75), and their size makes them a favourite for full-body ads. Bodies were assembled by Kiwi Bus Builders or Zhuhai Granton."
5656
},
5757
{
58-
"id": "e500mmc", "name": "Alexander Dennis Enviro500 MMC", "maker": "Alexander Dennis", "electric": false, "decks": 2, "axles": 3,
58+
"id": "e500mmc", "wiki": ["Alexander Dennis Enviro 500 MMC", "Alexander Dennis Enviro500 MMC", "Alexander Dennis Enviro 500"], "key": "Enviro500", "name": "Alexander Dennis Enviro500 MMC", "maker": "Alexander Dennis", "electric": false, "decks": 2, "axles": 3,
5959
"specs": [["Length", "12.5 m"], ["Height", "4.2 m"], ["Seats", "55 up, 31–36 down"], ["Engine", "Cummins ISL9"]],
6060
"about": "The updated Enviro500 body, bought by Ritchies (including Birkenhead Transport) and Bayes, mostly from 2018 on, and assembled by Zhuhai Granton. Same size as the original: 12.5 m long and 4.2 m tall."
6161
},
6262
{
63-
"id": "bci6123", "name": "BCI CitiRider FBC6123", "maker": "BCI", "electric": false, "decks": 2, "axles": 3,
63+
"id": "bci6123", "wiki": ["BCI CitiRider", "BCI CitiRider FBC6123"], "key": "CitiRider", "name": "BCI CitiRider FBC6123", "maker": "BCI", "electric": false, "decks": 2, "axles": 3,
6464
"specs": [["In Auckland since", "2018"]],
6565
"about": "A three-axle double-decker from Australian builder BCI. Tranzurban brought them in July 2018 when it took over the Northern Express NX2."
6666
},
6767
{
68-
"id": "k320", "name": "Scania K320UB", "maker": "Scania", "electric": false, "decks": 1, "axles": 3,
68+
"id": "k320", "wiki": ["Scania K320", "Scania K320UB"], "key": "K320", "name": "Scania K320UB", "maker": "Scania", "electric": false, "decks": 1, "axles": 3,
6969
"specs": [["Engine", "320 hp"]],
7070
"about": "A Swedish chassis with a 320 hp engine, always built three-axle in Auckland to keep road-user charges down. The body depends on the operator: Kiwi Bus Builders (46–49 seats) on Tranzurban's NX2 buses, and Bonluck on the ex-Pavlovich fleet, which has big screens inside showing the next stop."
7171
},
7272
{
73-
"id": "k270", "name": "Scania K270UB", "maker": "Scania", "electric": false, "decks": 1, "axles": 3,
73+
"id": "k270", "wiki": ["Scania K270", "Scania K270UB"], "key": "K270", "name": "Scania K270UB", "maker": "Scania", "electric": false, "decks": 1, "axles": 3,
7474
"specs": [["Engine", "270 hp"]],
7575
"about": "Scania's 270 hp chassis, three-axle like most big diesels here. NZ Bus's 2100 series have DesignLine bodies (the last eleven have the Enviroline design); Ritchies' were bodied by Kiwi Bus Builders."
7676
},
7777
{
78-
"id": "man16250", "name": "MAN 16.250", "maker": "MAN", "electric": false, "decks": 1, "axles": 2,
78+
"id": "man16250", "wiki": ["MAN 16.250"], "key": "16.250", "name": "MAN 16.250", "maker": "MAN", "electric": false, "decks": 1, "axles": 2,
7979
"specs": [["Seats", "37–43"], ["Body", "Enviroline"]],
8080
"about": "A two-axle MAN with the Enviroline body built in Rolleston, Canterbury, by Global Bus Ventures (formerly DesignLine). Go Bus runs most of them; Ritchies has some, partly from Birkenhead Transport."
8181
},
8282
{
83-
"id": "man18290", "name": "MAN 18.290", "maker": "MAN", "electric": false, "decks": 1, "axles": 3,
83+
"id": "man18290", "wiki": ["MAN 18.290"], "key": "18.290", "name": "MAN 18.290", "maker": "MAN", "electric": false, "decks": 1, "axles": 3,
8484
"specs": [["Engine", "290 hp"], ["Weight rating", "18 t"], ["Body", "Enviroline"]],
8585
"about": "A three-axle MAN (the name means 18 tonnes and 290 hp), mostly with Global Bus Ventures' Enviroline body; one Ritchies bus has a Malaysian Gemilang body instead. Go Bus and Ritchies run them."
8686
},
8787
{
88-
"id": "man17223", "name": "MAN 17.223", "maker": "MAN", "electric": false, "decks": 1, "axles": 3,
88+
"id": "man17223", "wiki": ["MAN 17.223"], "key": "17.223", "name": "MAN 17.223", "maker": "MAN", "electric": false, "decks": 1, "axles": 3,
8989
"specs": [["Built", "2002–2007"]],
9090
"about": "A tag-axle bus built by DesignLine in Ashburton between 2002 and 2007, first bought by Stagecoach for Auckland. Most of NZ Bus's have been retired in favour of electrics, but a handful are still running."
9191
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import nz.aryan.akllive.data.BusDeparture
3131
import nz.aryan.akllive.data.BusRepo
3232
import nz.aryan.akllive.data.BusTrip
3333
import nz.aryan.akllive.data.Fleet
34+
import nz.aryan.akllive.data.Photos
3435
import nz.aryan.akllive.data.FleetState
3536
import nz.aryan.akllive.data.LiveRepo
3637
import nz.aryan.akllive.data.Nz
@@ -158,6 +159,8 @@ class AppViewModel(app: Application) : AndroidViewModel(app) {
158159
init {
159160
Fleet.load(app)
160161
Timetable.init(app)
162+
// every model's photo onto the phone early, so a bus's photo is there the moment it shows up
163+
viewModelScope.launch { delay(5_000); try { Photos.prefetch(app) } catch (_: Exception) { } }
161164
viewModelScope.launch { loop(30_000) { refreshBuses() } }
162165
viewModelScope.launch {
163166
while (true) {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ class BusModel(
1515
/** label -> value, e.g. "Length" -> "12.7 m" */
1616
val specs: List<Pair<String, String>>,
1717
val about: String,
18+
/** its page(s) on the AT Metro Wiki, best first */
19+
val wiki: List<String> = emptyList(),
20+
/** what a photo or page title has to mention to be this bus, e.g. "eT12" */
21+
val key: String = "",
1822
) {
1923
val doubleDeck: Boolean get() = decks >= 2
2024

@@ -59,6 +63,8 @@ object Fleet {
5963
axles = if (o.has("axles")) o.getInt("axles") else null,
6064
specs = (0 until specs.length()).map { k -> specs.getJSONArray(k).let { it.getString(0) to it.getString(1) } },
6165
about = o.optString("about"),
66+
wiki = o.optJSONArray("wiki")?.let { w -> (0 until w.length()).map { w.getString(it) } } ?: emptyList(),
67+
key = o.optString("key"),
6268
)
6369
}
6470
val byId = ms.associateBy { it.id }

0 commit comments

Comments
 (0)