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

Representing lines improperly synced into HAFAS data #243

Open
TheOneWithTheBraid opened this issue Dec 6, 2024 · 0 comments
Open

Representing lines improperly synced into HAFAS data #243

TheOneWithTheBraid opened this issue Dec 6, 2024 · 0 comments

Comments

@TheOneWithTheBraid
Copy link
Contributor

Many trains and public transport lines all around Europe are actually present in HAFAS.

I sadly figured out that even though the individual trains are present, there often is no correct line provided in the data.

In my case, I was trying to figure out how to represent the Réseau Express Métropolitain Européen (REME) Strasbourg : Each train number in HAFAS is given an individual line id (e.g. ter30700 - ter30743 for the fluo A09 line).

I'm wondering whether for such cases we could implement a range description to accumulate invalid line numbers into one unified line.

An example of this could be the famous page ranges we know from printing dialogs. I could imagine using the following pattern to describe such a range of lines into one unified line :

*ter*(30700 - 30709; 30711; 30713 - 30718; 30720 - 30736; 30738 - 30741; 30743)

Whereas Strings in * represent a non-integer part of the line name and the descriptor in () indicates the numbers to match. This should a) not break existing implementations simply checking the String of the CSV column since the match should be false and b) is less overhead to implement than regular expressions.

Alternatively, well - one could simply add regular expressions to the line identifier column.

Example of invalid SNCF lines in the present CSV representation

With current duplication

sncf,A09,,ter30700,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30701,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30702,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30703,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30704,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30705,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30706,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30707,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30708,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30709,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30711,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30713,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30714,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30715,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30716,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30717,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30718,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30720,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30721,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30722,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30723,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30724,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30725,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30726,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30728,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30729,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30730,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30731,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30732,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30733,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30734,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30735,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30736,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30738,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30739,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30740,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30741,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30743,#0e3692,#ffffff,,rectangle,
sncf,A09,,ter30743,#0e3692,#ffffff,,rectangle,

With a printer-like range description

sncf,A09,,*ter*(30700 - 30709; 30711; 30713 - 30718; 30720 - 30736; 30738 - 30741; 30743),#0e3692,#ffffff,,rectangle,

Using regular expressions

sncf,A09,,ter307((0[0-9])|(11)|(1[3-8])|(2[0-9])|(3[0-6])|(3[8-9])|(4[0-3])),#0e3692,#ffffff,,rectangle,

Preview :

preview of fluo line A09

This issue is related to #208 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant