Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regex matching rules for large groups of uniform line icons #35

Open
echtnurich opened this issue Sep 25, 2023 · 1 comment
Open
Labels
needs-discussion This issue / pull request needs to be discussed. specification Changes at specification

Comments

@echtnurich
Copy link
Contributor

echtnurich commented Sep 25, 2023

I think it would be a big time-saver to allow regex rules for matching a lot of lines to the same design icon.

For example, i've managed to break almost 300 Bus and Ferry lines that share a number space down into 6 rules:
echtnurich/line-colors - [proposal-regex] /line-colors.csv

I've used regex101.com to validate these.
It also helps with understanding the use of named matching groups to extract the line (or operator) from the hafasLineId.

I'm not sure what syntax would be optimal to actually implement, so for now I'm going to leave it at the proposal for further discussion.

Examples

Primary Metrobuses

^5\-hvv(?'operator'hha|vhh)\-(?'line'\d)$

  • 5-hvvvhh-1
  • 5-hvvhha-7

Secondary Metrobusses

^5\-hvv(?'operator'hha|vhh)\-(?'line'[1-2]\d)$

  • 5-hvvhha-17
  • 5-hvvvhh-21

Citybuses

^5\-hvv(?'operator'hha|vhh)\-(?'line'[0-5,7-9]\d\d)$

  • 5-hvvhha-261
  • 5-hvvvhh-286

Nightbuses

^5\-hvv(?'operator'hha|vhh)\-(?'line'[6]\d\d)$

  • 5-hvvvhh-601
  • 5-hvvhha-607

Expressbuses

^5\-hvv(?'operator'hha|vhh)\-x(?'line'\d{1,2})$

  • 5-hvvvhh-x3
  • 5-hvvhha-x35

Ferries

^6\-hvv(?'operator'had)\-(?'line'[6-7]\d)$

  • 6-hvvhad-62
  • 6-hvvhad-73
@jheubuch jheubuch added specification Changes at specification needs-discussion This issue / pull request needs to be discussed. labels Sep 26, 2023
@ghost
Copy link

ghost commented May 25, 2024

especially for hamburg, this would be a nice addition.

hamburg buses usually don't use different line colours, except for some maps online.

a wildcard for hvv routes would be kinda nice, but that might need some discussion imo.

MetroBus/city buses/regional buses

  • red on bus stops
  • hexagon

night bus

  • black on bus stops and, afaik, maps
  • hexagon

express buses ("XpressBus")

  • green on bus stops
  • hexagon

ferries

  • blue everywhere
  • trapezoid

(and, of course, that'd be a nice addition for networks without colour usage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion This issue / pull request needs to be discussed. specification Changes at specification
Projects
None yet
Development

No branches or pull requests

2 participants