Skip to content

TrainyApp/line-colors

 
 

Repository files navigation

Public transport line colors

This repository is made for collecting line colors in public transport lines. Because of our switch to Transitous, colors from countries other than Germany can now be collected and used as well. If your feed does not yet have its own .csv file and you would like to contribute colours, you can create a .csv (e.g. line-colors-xxx.csv) and submit it via a pull request (or open an issue).

Structure

First, you need to determine which file to use:

  • line-colors.csv is used for the DELFI feed (Germany)
  • line-colors-CH.csv is used for the opentransportdata.swiss feed (Switzerland)
  • line-colors-VBN.csv is used for the VBN feed (Verkehrsverbund Bremen-Niedersachsen)

The line-colors.csv contains several columns:

  • shortOperatorName: Short operator name (i.e. vehicle keeper marking/"Halterkürzel" or another identifier for EVU) and a local transport network abbreviation
  • lineName: Displayed line name
  • hafasOperatorCode - only present in line-colors.csv: DEPRECATED - used to identify the correct line, if line id is not distinct. Can be empty!
  • hafasLineId - only present in line-colors.csv: DEPRECATED - identifies the HAFAS line - you can get this by requesting a departure for the line from HAFAS (i.e. using db-rest playground)
  • backgroundColor: Color-Hexcode for the display background color
  • textColor: Color-Hexcode for the text color
  • borderColor Color-Hexcode for the border of the shape
  • shape: Specifies the shape of the icon --> see examples below
    • circle: Just a circle
    • hexagon A pill with pointy tips
    • rectangle: Just a rectangle
    • rectangle-rounded-corner: Rectangle with rounded corners
    • pill: Rectangle with completely rounded corners
    • trapezoid A trapezoid shape with a broad top and a narrow bottom side
    • diagonal1: A rectangle with a dual color background seperated by a line from the bottom right to the top left
  • wikidataQid: Wikidata QID for the line (if available, can be empty)
  • delfiAgencyID/GTFSAgencyID: Agency ID (for example train operating company) that is used in the (DELFI) GTFS feed You can find the delfiAgencyID in DELFI's GTFS dataset), otherwise it's the agency name and ID stated in your network's GTFS file
  • delfiAgencyName/GTFSAgencyName: Agency name that is used in the (DELFI) GTFS feed

Projects using this data

  • Transitous | community-run provider-neutral international public transport routing service
  • Träwelling | check-in service to log your public transit journeys ( indirect use via Transitous)
  • Träwelldroid | Android app for Träwelling (indirect use via Träwelling and Transitous)

Contributing

If a line operates in a local transport network/"Verkehrsverbund", the network's line color shall be preferred.
Local transport networks usually have line colors for:

  • suburban lines / "S-Bahn"
  • subway lines / "U-Bahn"
  • tramway lines / "Straßenbahn, Stadtbahn"
  • bus lines / "Bus"

If a single line operates in multiple transport networks, the color communicated by the operator shall be preferred.

I'd be very happy if this file could expand very fast, so please feel free to add more lines by opening a PR.
Please keep the PR's small. If possible, create a small PR for each operator.

BUT FIRST

  • Check that entries are sorted first by shortOperatorName and then lineName
  • Reference a source in your PR where data can be proved (somewhere from the internet, like a timetable PDF...)
    • Also add it to sources.json.
  • All entries in the CSV (except lineName) shall be in lower case

THEN

  • Please checkout at the latest commit of the main branch and create a new branch from there
  • Ensure that the validation tests (after pr is created) pass

optionally but recommended: Wikidata (why?)

  • try to find the Wikidata QID for the line and add it to the wikidataQid column
  • if there is no Wikidata item for the line, it would be great if you could create one

Examples

Die Länderbahn GmbH DLB, RE72

RE 23


  • shortOperatorName: alex-dlb
  • lineName: RE 23
  • hafasOperatorCode: alex-die-landerbahn-gmbh-dlb
  • hafasLineId: re23
  • backgroundColor: #ffffff
  • textColor: #006666
  • borderColor #006666
  • shape: rectangle
  • wikidataQid Q130542294

Entry: alex-dlb,RE 23,alex-die-landerbahn-gmbh-dlb,re23,#ffffff,#006666,#006666,rectangle,Q130542294

DB Regio AG S-Bahn München, S7

S7


  • shortOperatorName: mvv-db-sbm
  • lineName: S7
  • hafasOperatorCode: db-regio-ag-s-bahn-munchen
  • hafasLineId: 4-800725-7
  • backgroundColor: #8a372f
  • textColor: #ffffff
  • borderColor does not apply
  • shape: pill
  • wikidataQid not available

Entry: mvv-db-sbm,S7,db-regio-ag-s-bahn-munchen,4-800725-7,#8a372f,#ffffff,,pill,

KVV: Albtal-Verkehrs-Gesellschaft mbH, S1

S1


  • shortOperatorName: kvv-avg
  • lineName: S1
  • hafasOperatorCode: albtal-verkehrs-gesellschaft-mbh
  • hafasLineId: 4-a6s8-8
  • backgroundColor: #6e692a
  • textColor: #ffffff
  • borderColor does not apply
  • shape: rectangle-rounded-corner (a pill with less rounded corners)
  • wikidataQid not available

Entry: kvv-avg,S8,albtal-verkehrs-gesellschaft-mbh,4-a6s8-8,#6e692a,#ffffff,,rectangle-rounded-corner,

HVV: Hadag, 62

62


  • shortOperatorName: hvv-had
  • lineName: 62
  • hafasOperatorCode: not available
  • hafasLineId: 6-hvvhad-62
  • backgroundColor: #009bb6
  • textColor: #ffffff
  • borderColor does not apply
  • shape: trapezoid (a shape with a broad top and a narrow bottom side)
  • wikidataQid not available

Entry: hvv-had,62,,6-hvvhad-62,#009bb6,#ffffff,,trapezoid,

HVV: Hamburger Hochbahn AG, X35

62


  • shortOperatorName: hvv-hha
  • lineName: X35
  • hafasOperatorCode: not available
  • hafasLineId: 5-hvvhha-x35
  • backgroundColor: #eb452e
  • textColor: #ffffff
  • borderColor does not apply
  • shape: hexagon (a pill with pointy tips)
  • wikidataQid not available

Entry: hvv-hha,X35,,5-hvvhha-x35,#eb452e,#ffffff,,hexagon,

S-train Liege: SNCB, S41

S41


  • shortOperatorName: liege-s
  • lineName: S41
  • hafasOperatorCode: sncb
  • hafasLineId: 4-88-41
  • backgroundColor: #0f6030
  • textColor: #ffffff
  • borderColor #ffffff
  • shape: circle
  • wikidataQid not available

Entry: liege-s,S41,sncb,4-88-41,#0f6030,#ffffff,#ffffff,circle,

About

Fork of Traewelling/line-colors with patches required for us

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 73.3%
  • PHP 18.0%
  • JavaScript 5.1%
  • Python 3.6%