Skip to content

Commit

Permalink
feat: add product brand dataset
Browse files Browse the repository at this point in the history
Signed-off-by: The one with the braid <[email protected]>
  • Loading branch information
TheOneWithTheBraid committed Jan 2, 2025
1 parent 9855f25 commit 265996e
Show file tree
Hide file tree
Showing 12 changed files with 2,658 additions and 2,499 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
- name: Validate line-colors.csv
working-directory: ./validation
run: php check.php
- name: Install svgcleaner
run: sudo apt update && sudo apt install -y -qq wget && wget https://github.com/RazrFalcon/svgcleaner/releases/download/v0.9.5/svgcleaner_linux_x86_64_0.9.5.tar.gz svgcleaner/svgcleaner && sudo mv svgcleaner/svgcleaner /usr/local/bin && rm -rf svgcleaner svgcleaner_linux_*.tar.gz
- name: Ensure all product icons are cleaned
working-directory: ./products
run: for product in *.svg && do svgcleaner $product clean-$product && diff -u $product clean-$product || exit 1 ; done && rm clean-*.svg

deploy:
needs: [validate]
Expand Down
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
This repository is made for collecting line colors in public transport lines,
so they can be displayed on systems using DB HAFAS.

## Structure
## Contents

- [Line Colors](#line-colors)
- [Product Brands](#product-brands)

## Line Colors

### Structure

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
Expand All @@ -20,8 +27,9 @@ The `line-colors.csv` contains several columns:
- `pill`: Rectangle with completely rounded corners
- `trapezoid` A trapezoid shape with a broad top and a narrow bottom side
- `wikidataQid`: Wikidata QID for the line (if available, can be empty)
- `productBrand`: An optional `productBrand` from the product brands database in order to manually assign a particular product brand override. This is useful if e.g. an operator runs a single line entering another traffic association using different branding, such as DB Regio operating for Austrian S-Bahn networks.

## Contributing
### Contributing

If a line operates in a local transport network/"Verkehrsverbund", the network's line color shall be preferred.<br>
Local transport networks usually have line colors for:
Expand Down Expand Up @@ -54,7 +62,7 @@ Please keep the PR's small. If possible, create a small PR for each operator. <b
- You can use [this list](https://www.wikidata.org/wiki/User:Mkkagain/Verkehrslinien_in_Deutschland) to find the QID
- if there is no Wikidata item for the line, it would be great if you could [create one](https://www.wikidata.org/wiki/Special:NewItem)

## Examples
### Examples

### Die Länderbahn GmbH DLB, RE72

Expand Down Expand Up @@ -156,3 +164,21 @@ Entry: `hvv-hha,X35,,5-hvvhha-x35,#eb452e,#ffffff,,hexagon,`
- `wikidataQid` *not available*

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

## Product Brands (alpha)

In addition to the line schematics, this repository also collects product branding data for transport operators.

This is particularly useful when applications want to provide an authentic look and feel about train or transport
categories to users - independent of individual lines.

### Structure

- `shortOperatorName`: a meaningful name matching the product brand, such as `cd-railjet`, `sncf-ouigo` or `s-bahn-at`
- `hafasOperatorCode`: the operator code as in HAFAS. An empty String will *never* match (useful for manual assignments).
- `product`: the product String from HAFAS, such as `suburban`, `national` or `bus`. An empty String will *never* match (useful for manual assignments).
- `productName`: the productName String from HAFAS, such as `TGV` or `S`. An empty String will *never* match (useful for manual assignments).
- `shortName`: should be empty. An *optional* override to the [Wikidata short name](https://www.wikidata.org/wiki/Property:P1813). Only specify if unavailable in Wikidata or not meaningful.
- `iconName`: should be empty. An *optional* override for the [Wikidata logo image](https://www.wikidata.org/wiki/Property:P154). Only specify if unavailable in Wikidata or not meaningful. In case specified, the icon **must** be included into the [`icon-sources.json`](icon-sources.json) with corresponding source and attribution.
- `wikidataQid`: **mandatory** Wikidata QID for the product or anything to be considered as data source. If you don't find anything, maybe just create the dataset.

82 changes: 82 additions & 0 deletions icon-sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[
{
"iconName": "oebb-nightjet",
"contributors": [
{
"github": "TheOneWithTheBraid"
}
],
"sources": [
{
"name": "Wikimedia Commons",
"source": "https://commons.wikimedia.org/wiki/File:Nightjet_logo.svg",
"author": "Österreichische Bundesbahnen",
"license": "PD"
}
]
},
{
"iconName": "regio-s-bahn-bw",
"contributors": [
{
"github": "TheOneWithTheBraid"
}
],
"sources": [
{
"name": "Wikimedia Commons",
"source": "https://rsbahn.de/#downloads",
"author": "The one with the braid",
"license": "PD"
}
]
},
{
"iconName": "rer-ch-fribourg",
"contributors": [
{
"github": "TheOneWithTheBraid"
}
],
"sources": [
{
"name": "Wikimedia Commons",
"source": "https://commons.wikimedia.org/wiki/File:RER_Fribourg_Freiburg.svg",
"author": "SBB CFF FFS",
"license": "PD"
}
]
},
{
"iconName": "rer-ch-vaud",
"contributors": [
{
"github": "TheOneWithTheBraid"
}
],
"sources": [
{
"name": "Wikimedia Commons",
"source": "https://commons.wikimedia.org/wiki/File:RER_Vaudois.png",
"author": "SBB CFF FFS",
"license": "PD"
}
]
},
{
"iconName": "s-bahn-at",
"contributors": [
{
"github": "TheOneWithTheBraid"
}
],
"sources": [
{
"name": "Wikimedia Commons",
"source": "https://commons.wikimedia.org/wiki/File:S-Bahn_Austria.svg",
"author": "Siegele Roland & Jonathan Haas",
"license": "PD"
}
]
}
]
Loading

0 comments on commit 265996e

Please sign in to comment.