add Leitpunkte
(by johann150, with some modification by stuebinm)
This commit is contained in:
parent
a7823fc059
commit
128198f070
3 changed files with 696 additions and 13 deletions
7
data/README.md
Normal file
7
data/README.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
## data sources
|
||||||
|
|
||||||
|
- `leitpunkte.csv` from <https://assets.static-bahn.de/dam/jcr:0024ef49-e411-4ceb-8326-8317760ec52e/6)%20Leitpunktkuerzel.pdf> (published 11.12.2022)
|
||||||
|
The relevant information was extracted from the PDF manually.
|
||||||
|
More curent versions may be listed at <https://www.bahn.de/agb> as "Leitpunktkürzel" in the section "Entfernungswerk des Deutschlandtarifs".
|
||||||
|
|
||||||
|
The RL100-Code combination was added manually and is not guaranteed to be accurate. Some places do not have a one-to-one mapping between Leitpunkt and RL100.
|
649
data/leitpunkte.csv
Normal file
649
data/leitpunkte.csv
Normal file
|
@ -0,0 +1,649 @@
|
||||||
|
Leitpunktkürzel;Tarifpunkt;DS100
|
||||||
|
A;Augsburg Hbf;MA
|
||||||
|
AA;Aalen Hbf;TA
|
||||||
|
AB;Aschaffenburg Hbf;NAH
|
||||||
|
ABG;Altenburg;LA
|
||||||
|
AC;Aachen Hbf;KA
|
||||||
|
ACH;Achern;RAH
|
||||||
|
ACSG;Aachen Süd(Gr);KXA
|
||||||
|
ADE;Adelebsen;HADB
|
||||||
|
AIC;Aichach;MAI
|
||||||
|
ALL;Allersberg(Rothsee);NALB
|
||||||
|
ALT;Altenbeken;HA
|
||||||
|
AN;Ansbach;NAN
|
||||||
|
AND;Andernach;KAND
|
||||||
|
ANG;Angermünde;WA
|
||||||
|
APO;Apolda;UAP
|
||||||
|
ARD;Arnsdorf(Dresden);DAF
|
||||||
|
ARN;Arnstadt Hbf;UA
|
||||||
|
ASCH;Ascheberg(Holst);AAG
|
||||||
|
ASL;Aschersleben;LAL
|
||||||
|
AU;Aue(Sachs);DAU
|
||||||
|
AUL;Aulendorf;TAU
|
||||||
|
AUS;Au(Sieg);KAU
|
||||||
|
AZ;Alzey;FALZ
|
||||||
|
B;Berlin Friedrichstr;BFRI
|
||||||
|
BA;Bamberg;NBA
|
||||||
|
BAAL;Baalberge;LBB
|
||||||
|
BAB;Babenhausen(Hess);FBA
|
||||||
|
BACK;Backnang;TB
|
||||||
|
BAD;Baden-Baden;RBB
|
||||||
|
BALI;Bad Liebenwerda;BBLW
|
||||||
|
BAS;Basel Bad Bf;RB
|
||||||
|
BB;Böblingen;TBO
|
||||||
|
BBG;Bernburg Hbf;LBG
|
||||||
|
BCH;Berlin-Charlottenbg.;BCHB
|
||||||
|
BEB;Bebra;FB
|
||||||
|
BED;Bedburg(Erft);KBE
|
||||||
|
BEGR;Bad Bentheim(Gr);HXB
|
||||||
|
BELZ;Bad Belzig;BBIG
|
||||||
|
BENS;Bensheim;FBH
|
||||||
|
BENT;Bad Bentheim;HBTH
|
||||||
|
BER;Bernau(b Berlin);BBRN
|
||||||
|
BETZ;Betzdorf(Sieg);EBZ
|
||||||
|
BF;Steinfurt-Burgstein.;EBFT
|
||||||
|
BGS;Berlin Gesundbrunnen;BGS
|
||||||
|
BHBF;Berlin Hbf;BL
|
||||||
|
BHS;Berlin-Hohenschönh.;BHSH
|
||||||
|
BHV;Bremerhaven Hbf;HBH
|
||||||
|
BI;Bielefeld Hbf;EBIL
|
||||||
|
BIET;Bietigheim-Bissingen;TBM
|
||||||
|
BILL;Billerbeck;EBB
|
||||||
|
BIN;Bingen(Rhein) Hbf;FBGK
|
||||||
|
BIW;Bischofswerda;DBW
|
||||||
|
BIZ;Biederitz;LBZ
|
||||||
|
BKH;Berlin-Karlshorst;BKH
|
||||||
|
BKL;Bad Kleinen;WK
|
||||||
|
BLAM;Blankenberg(Meckl);WBL
|
||||||
|
BLF;Blankenf(Teltow-Fl);BBF
|
||||||
|
BLG;Bad Blankenburg(Th);UBL
|
||||||
|
BLH;Blankenheim(Sangerh);FBLA
|
||||||
|
BLI;Berlin-Lichtenberg;BLO
|
||||||
|
BN;Bonn Hbf;KB
|
||||||
|
BNBE;Bonn-Beuel;KBB
|
||||||
|
BNG;Burg-u.Ndr Gemünden;FBNG
|
||||||
|
BNGO;Bonn-Bad Godesberg;KBBG
|
||||||
|
BO;Bochum Hbf;EBO
|
||||||
|
BOB;Berlin Ostbahnhof;BHF
|
||||||
|
BOH;Bocholt;EBCH
|
||||||
|
BOK;Berlin Ostkreuz;BOK
|
||||||
|
BOP;Boppard Hbf;KBOP
|
||||||
|
BOR;Borken(Westf);EBK
|
||||||
|
BORS;Borsdorf(Sachs);LBOR
|
||||||
|
BOT;Bottrop Hbf;EBTH
|
||||||
|
BR;Bruchsal;RBR
|
||||||
|
BRAC;Bielefeld-Brackwede;EBWE
|
||||||
|
BRB;Brandenburg Hbf;LB
|
||||||
|
BRE;Bretleben;UBR
|
||||||
|
BRI;Brilon Wald;EBRW
|
||||||
|
BRIT;Britz;WBR
|
||||||
|
BROI;Lengede-Broistedt;HBST
|
||||||
|
BRT;Bretten;RBT
|
||||||
|
BRV;Bremervörde;ABV
|
||||||
|
BS;Braunschweig Hbf;HBS
|
||||||
|
BSFL;Flgh. BER T5 Schöne;BFHS
|
||||||
|
BSK;Berlin Südkreuz;BPAF
|
||||||
|
BSP;Berlin-Spandau;BSPD
|
||||||
|
BSU;Bad Schandau;DAS
|
||||||
|
BT;Bayreuth Hbf;NBY
|
||||||
|
BTF;Bitterfeld;LBT
|
||||||
|
BUCH;Buchholz(Nordheide);ABLZ
|
||||||
|
BUE;Büchen;ABCH
|
||||||
|
BUEN;Bünde(Westf);HBDE
|
||||||
|
BUEZ;Bützow;WB
|
||||||
|
BULL;Bullay(DB);SBY
|
||||||
|
BULO;Buchloe;MBU
|
||||||
|
BUT;Buttstädt;UBU
|
||||||
|
BWA;Berlin-Wannsee;BWS
|
||||||
|
BWK;Berlin Westkreuz;BWKR
|
||||||
|
BZ;Bautzen;DBZ
|
||||||
|
BZG;Berlin Zoolg. Garten;BZOO
|
||||||
|
C;Chemnitz Hbf;DC
|
||||||
|
CA;Calau(Nl);BC
|
||||||
|
CALO;Calbe(Saale) Ost;LCBO
|
||||||
|
CALW;Calbe(Saale) West;LCBW
|
||||||
|
CAMB;Camburg(Saale);UCB
|
||||||
|
CB;Cottbus Hbf;BCS
|
||||||
|
CE;Celle;HC
|
||||||
|
CO;Coburg;NC
|
||||||
|
COC;Cochem(Mosel);SCOC
|
||||||
|
COE;Coesfeld(Westf);ECMF
|
||||||
|
COEL;Cölbe;FCOE
|
||||||
|
CON;Coburg Nord;NCN
|
||||||
|
COS;Coswig(Anh);LCW
|
||||||
|
COSD;Coswig(b Dresden);DCW
|
||||||
|
CR;Crailsheim;TC
|
||||||
|
CW;Calw;TCW
|
||||||
|
D;Düsseldorf Hbf;KD
|
||||||
|
DA;Darmstadt Hbf;FD
|
||||||
|
DD;Dresden Hbf;DH
|
||||||
|
DDN;Dresden-Neustadt;DN
|
||||||
|
DE;Dessau Hbf;LD
|
||||||
|
DEL;Delmenhorst;HD
|
||||||
|
DERN;Derneburg(Han);HDBG
|
||||||
|
DFL;Düsseldorf Flugh.;KDF
|
||||||
|
DH;Diepholz;HDIP
|
||||||
|
DIL;Dillenburg;FDIL
|
||||||
|
DILL;Dillingen(Saar);SDL
|
||||||
|
DL;Döbeln Hbf;DDE
|
||||||
|
DN;Düren;KDN
|
||||||
|
DO;Dortmund Hbf;EDO
|
||||||
|
DOD;Dortmund-Dorstfeld;EDDP
|
||||||
|
DOKI;Doberlug-Kirchhain;BDKO
|
||||||
|
DON;Donauwörth;MDT
|
||||||
|
DOWH;Dortmund Signal Idu.;EDWH
|
||||||
|
DOWW;Dortmund-Wickede W;EDWW
|
||||||
|
DS;Donaueschingen;RDO
|
||||||
|
DU;Duisburg Hbf;EDG
|
||||||
|
DUED;Dürrröhrsdorf;DRR
|
||||||
|
DUEL;Dülmen;EDUL
|
||||||
|
DZ;Delitzsch;LDL
|
||||||
|
E;Essen Hbf;EE
|
||||||
|
EALT;Essen-Altenessen;EEAL
|
||||||
|
EB;Eilenburg;LEG
|
||||||
|
EBB;Eberbach;REA
|
||||||
|
EF;Erfurt Hbf;UE
|
||||||
|
EGID;St Egidien;DEG
|
||||||
|
EICH;Eichenberg;HEBG
|
||||||
|
EIL;Lutherstadt Eisleben;LEL
|
||||||
|
EILS;Eilsleben(Magdeb);LEI
|
||||||
|
ELMS;Elmshorn;AEL
|
||||||
|
ELW;Elsterwerda;BEW
|
||||||
|
ELXL;Elxleben;UEX
|
||||||
|
ELZE;Elze(Han);HELZ
|
||||||
|
EMD;Emden Hbf;HE
|
||||||
|
EMM;Emmerich;EEM
|
||||||
|
EMMG;Emmerich(Gr);EXEM
|
||||||
|
ENG;Engers;KENR
|
||||||
|
ER;Erlangen;NER
|
||||||
|
ERK;Erkelenz;KERZ
|
||||||
|
ESA;Eisenach;UEI
|
||||||
|
ESW;Eschwege-Niederhone;FONH
|
||||||
|
ESWE;Eschwege;FEG
|
||||||
|
EU;Euskirchen;KEU
|
||||||
|
EUTG;Eutingen im Gäu;TET
|
||||||
|
EW;Eberswalde Hbf;WE
|
||||||
|
F;Frankfurt(Main)Hbf;FF
|
||||||
|
FB;Friedberg(Hess);FFG
|
||||||
|
FBE;Falkenberg(Elster);ILF
|
||||||
|
FD;Fulda;FFU
|
||||||
|
FDS;Freudenstadt Hbf;TFS
|
||||||
|
FF;Frankfurt(Oder);BFP
|
||||||
|
FFMF;Frankfurt(M)Flugh.;FFLF
|
||||||
|
FFMN;Frankfurt-Niederrad;FNI
|
||||||
|
FFMS;Frankfurt(Main)Süd;FFS
|
||||||
|
FG;Freiberg(Sachs);DFR
|
||||||
|
FH;Frankfurt-Höchst;FHOE
|
||||||
|
FIN;Finnentrop;EFP
|
||||||
|
FINK;Finkenkrug;BFIN
|
||||||
|
FIW;Finsterwalde(Nl);BFW
|
||||||
|
FKB;Frankenberg(Eder);FFRK
|
||||||
|
FL;Flensburg;AF
|
||||||
|
FLOE;Flöha;DFL
|
||||||
|
FN;Friedrichshafen St.;TFS
|
||||||
|
FOER;Förderstedt;LFD
|
||||||
|
FOFR;Forbach(fr);XFFB
|
||||||
|
FOR;Forst(Lausitz);BFO
|
||||||
|
FR;Freiburg(Brsg)Hbf;RF
|
||||||
|
FREI;Freilassing;MFL
|
||||||
|
FRIJ;Bad Friedrichsh Hbf;TBF
|
||||||
|
FROE;Fröndenberg;EFOE
|
||||||
|
FROS;Frose;LFE
|
||||||
|
FRT;Frankenthal Hbf;RFT
|
||||||
|
FRW;Bad Freienwalde;WFW
|
||||||
|
FS;Freising;MFR
|
||||||
|
FSTD;Frankfurt(M)Stadion;FSP
|
||||||
|
FUB;Fürstenberg(Havel);WF
|
||||||
|
FUE;Fürth(Bay)Hbf;NF
|
||||||
|
FUGR;Furth im Wald(Gr);NXFU
|
||||||
|
FW;Fürstenwalde(Spree);BFUW
|
||||||
|
G;Gera Hbf;UG
|
||||||
|
GAI;Gaimersheim;MGH
|
||||||
|
GAM;Gammertingen;TGMT
|
||||||
|
GAP;Garmisch-Partenk.;MGP
|
||||||
|
GC;Glauchau(Sachs);DGL
|
||||||
|
GE;Gelsenkirchen Hbf;EG
|
||||||
|
GEES;Geestgottberg;LGG
|
||||||
|
GELN;Gelnhausen;FGEL
|
||||||
|
GELT;Geltendorf;MGE
|
||||||
|
GEM;Gemünden(Main);NGM
|
||||||
|
GER;Germersheim;RGE
|
||||||
|
GERO;Gerolstein;SGR
|
||||||
|
GERS;Gerstungen;UGT
|
||||||
|
GF;Gifhorn;HGI
|
||||||
|
GG;Groß Gerau;FGER
|
||||||
|
GHA;Geithain;LGH
|
||||||
|
GHCB;Großenhain Cottb Bf;DGC
|
||||||
|
GHW;Gensingen-Horrweiler;FGHO
|
||||||
|
GI;Gießen;FG
|
||||||
|
GLA;Gladbeck West;EGBW
|
||||||
|
GLK;Geilenkirchen;KGEK
|
||||||
|
GNT;Genthin;LGN
|
||||||
|
GODE;Riedstadt-Goddelau;FGE
|
||||||
|
GOE;Göttingen;HG
|
||||||
|
GOES;Gößnitz;DGZ
|
||||||
|
HAUS;Hausach;RHA
|
||||||
|
HB;Bremen Hbf;HB
|
||||||
|
HBS;Halberstadt;LHB
|
||||||
|
HCH;Hechingen;THCH
|
||||||
|
HD;Heidelberg Hbf;RHA
|
||||||
|
HDL;Haldensleben;LHL
|
||||||
|
HDO;Holzdorf(Elster);LHZ
|
||||||
|
HE;Helmstedt;HHLM
|
||||||
|
HEBO;Herborn(Dillkr);FHRB
|
||||||
|
HEI;Heide(Holst);AHI
|
||||||
|
HENN;Hennigsdorf(b Bln);BHND
|
||||||
|
HER;Herne;EHER
|
||||||
|
HERB;Herbertingen;THT
|
||||||
|
HERL;Herlasgrün;DHN
|
||||||
|
HERP;Hersbruck(r Pegnitz);NHR
|
||||||
|
HERS;Bad Hersfeld;FBHF
|
||||||
|
HERV;Hervest-Dorsten;EHDT
|
||||||
|
HERZ;Herzogenrath;KHEZ
|
||||||
|
HESE;Hesepe;HHES
|
||||||
|
HET;Hettstedt;LHE
|
||||||
|
HF;Herford;EHFD
|
||||||
|
HH;Hamburg-Sternschanze;ASTZ
|
||||||
|
HHAL;Hamburg-Altona;AA
|
||||||
|
HHBD;Hamburg-Bergedorf;ABG
|
||||||
|
HHDA;Hamburg Dammtor;ADF
|
||||||
|
HHH;Hamburg Hbf;AH
|
||||||
|
HI;Hildesheim Hbf;HHI
|
||||||
|
HIDH;Hiddenh.-Schweicheln;HHIS
|
||||||
|
HL;Lübeck Hbf;AL
|
||||||
|
HM;Hameln;HHM
|
||||||
|
HML;HannoverMesseLaatzen;HHML
|
||||||
|
HN;Heilbronn Hbf;TH
|
||||||
|
HNB;Herrnburg;WHB
|
||||||
|
HO;Hof Hbf;NHO
|
||||||
|
HOCK;Hockeroda;UHR
|
||||||
|
HOE;Höchst(Odenw);FHT
|
||||||
|
HOLT;Holthusen;WHO
|
||||||
|
HOLZ;Holzminden;HHZM
|
||||||
|
HOM;Homburg(Saar)Hbf;SHO
|
||||||
|
HOR;Horb;THB
|
||||||
|
HORK;Horka;BHR
|
||||||
|
HORR;Horrem;KHR
|
||||||
|
HOS;Hosena;BHC
|
||||||
|
HOSP;Hochspeyer;SHY
|
||||||
|
HRB;Herrenberg;THE
|
||||||
|
HRO;Rostock Hbf;WR
|
||||||
|
HST;Stralsund Hbf;WSR
|
||||||
|
HU;Hanau Hbf;FH
|
||||||
|
HUS;Husum;AHM
|
||||||
|
HY;Hoyerswerda;BHW
|
||||||
|
HZ;Herzberg(Harz);HHB
|
||||||
|
IBB;Ibbenbüren;HI
|
||||||
|
IGGR;Igel(Gr);SXIG
|
||||||
|
IMM;Immendingen;RIM
|
||||||
|
IN;Ingolstadt Hbf;MIH
|
||||||
|
IS;Iserlohn;EIL
|
||||||
|
IZ;Itzehoe;AIZ
|
||||||
|
JB;Jüterbog;BJUE
|
||||||
|
JE;Jessen(Elster);LJN
|
||||||
|
JP;Jena Paradies;UJP
|
||||||
|
JS;Jena Saalbf;UJS
|
||||||
|
JUEB;Jübek;AJ
|
||||||
|
JW;Jena West;UJW
|
||||||
|
K;Köln Hbf;KK
|
||||||
|
KA;Karlsruhe Hbf;RK
|
||||||
|
KADU;Karlsruhe-Durlach;RKDU
|
||||||
|
KAHL;Kahl(Main);FKLM
|
||||||
|
KALD;Kaldenkirchen;KKAK
|
||||||
|
KAM;Kamen;EKAM
|
||||||
|
KAMZ;Kamenz(Sachs);DKA
|
||||||
|
KAUF;Kaufering;MKFG
|
||||||
|
KB;Korbach Hbf;FKOB
|
||||||
|
KBFL;Köln/Bonn Flughafen;KFKB
|
||||||
|
KBR;Königsbrück;DKB
|
||||||
|
KDEU;Köln Messe/Deutz;KKDZ
|
||||||
|
KE;Kempten(Allgäu)Hbf;MKP
|
||||||
|
KEGR;Kehl(Gr);RXKL
|
||||||
|
KEHL;Kehl;RKL
|
||||||
|
KEHR;Köln-Ehrenfeld;KKER
|
||||||
|
KF;Kaufbeuren;MKFB
|
||||||
|
KH;Bad Kreuznach;SBKN
|
||||||
|
KI;Kiel Hbf;AK
|
||||||
|
KL;Kaiserslautern Hbf;SKL
|
||||||
|
KLB;Kirchenlaibach;NKL
|
||||||
|
KLE;Kleve;KKLV
|
||||||
|
KLG;Kißlegg;TKG
|
||||||
|
KO;Koblenz Hbf;KKO
|
||||||
|
KOEB;Koblenz-Ehrenbreit.;KKOE
|
||||||
|
KOEN;Königsbach(Baden);TKB
|
||||||
|
KOET;Köthen;LK
|
||||||
|
KOLZ;Koblenz-Lützel;KKOL
|
||||||
|
KON;Könnern;LKO
|
||||||
|
KR;Krefeld Hbf;KKR
|
||||||
|
KREI;Kreiensen;HK
|
||||||
|
KREU;Kreuztal;EKT
|
||||||
|
KS;Kassel-Wilhelmshöhe;FKW
|
||||||
|
KSHB;Kassel Hbf;FK
|
||||||
|
KTW;Kettwig;EKG
|
||||||
|
KUF;Kufstein;XAKN
|
||||||
|
KW;Königs Wusterhausen;BKW
|
||||||
|
L;Leipzig Hbf;LL
|
||||||
|
LA;Landshut(Bay)Hbf;MLA
|
||||||
|
LAA;Laage(Meckl);WLA
|
||||||
|
LAGE;Lage(Lippe);ELAG
|
||||||
|
LAUD;Lauda;TL
|
||||||
|
LAUT;Lauterbach(Hess)Nord;FLAU
|
||||||
|
LAWL;Langwedel;HLGW
|
||||||
|
LB;Ludwigsburg;TLU
|
||||||
|
LBB;Lübbenau(Spreewald);BLN
|
||||||
|
LBG;Velbert-Langenberg;ELBG
|
||||||
|
LCH;Laucha(Unstrut);ULCH
|
||||||
|
LD;Landau(Pfalz)Hbf;RLA
|
||||||
|
LEES;Leese-Stolzenau;HLST
|
||||||
|
LEHR;Lehrte;HLER
|
||||||
|
LEIF;Leinefelde;UL
|
||||||
|
LER;Leer(Ostfriesl);HLEE
|
||||||
|
LETM;Letmathe;ELE
|
||||||
|
LEUT;Leutkirch;TLK
|
||||||
|
LEVM;Leverkusen Mitte;KLMI
|
||||||
|
LG;Lüneburg;ALBG
|
||||||
|
LHFL;Leipzig/Halle Flugh;LFLU
|
||||||
|
LI;Lindau-Insel;MLI
|
||||||
|
LIF;Lichtenfels;NLF
|
||||||
|
LIPP;Lippstadt;ELPP
|
||||||
|
LIRE;Lindau-Reutin;MLIR
|
||||||
|
LLEU;Leipzig-Leutzsch;LLEL
|
||||||
|
LM;Limburg(Lahn);FL
|
||||||
|
LMS;Limburg Süd;FLIS
|
||||||
|
LN;Lübben(Spreewald);BLB
|
||||||
|
LOEB;Löbau(Sachs);DL
|
||||||
|
LOEH;Löhne(Westf);HL
|
||||||
|
LOH;Lohmen;DLO
|
||||||
|
LOLL;Lollar;FLOL
|
||||||
|
LOW;Löwenberg(Mark);WLO
|
||||||
|
LPLA;Leipzig-Plagwitz;LLP
|
||||||
|
LSZ;Bad Langensalza;ULS
|
||||||
|
LU;Ludwigshafen(Rh)Hbf;RL
|
||||||
|
LUEN;Lünen Hbf;ELUE
|
||||||
|
LUF;Ludwigsfelde;BLF
|
||||||
|
LWL;Ludwigslust;WL
|
||||||
|
M;München Hbf;MH
|
||||||
|
MA;Mannheim Hbf;RM
|
||||||
|
MAK;Marktredwitz;NMR
|
||||||
|
MALS;Malsfeld;FMFH
|
||||||
|
MARG;Markkleeberg-Großst;LMAG
|
||||||
|
MCK;Mühlacker;TM
|
||||||
|
MD;Magdeburg Hbf;LM
|
||||||
|
MDR;Magdeburg-Rothensee;LMR
|
||||||
|
MEHL;Mehltheuer;DMEH
|
||||||
|
MEI;Meißen;DME
|
||||||
|
MELL;Mellingen(Thür);UMEN
|
||||||
|
MER;Merseburg Hbf;LMG
|
||||||
|
MERK;Merklingen - S. Alb;TMKL
|
||||||
|
MET;Mellrichstadt Bf;NME
|
||||||
|
MG;Mönchengladbach Hbf;KM
|
||||||
|
MH;Mülheim(Ruhr)Hbf;EMLR
|
||||||
|
MI;Minden(Westf);HM
|
||||||
|
MIDO;Michendorf;BMIP
|
||||||
|
MIL;Miltenberg;NM
|
||||||
|
MIN;Mindelheim;MMH
|
||||||
|
MIW;Mittweida;DMW
|
||||||
|
MM;Memmingen;MM
|
||||||
|
MOST;München Ost;MOP
|
||||||
|
MPAS;München-Pasing;MP
|
||||||
|
MR;Marburg(Lahn);FMBG
|
||||||
|
MS;Münster(Westf)Hbf;EMST
|
||||||
|
MT;Montabaur;FMT
|
||||||
|
MUE;Mühldorf(Oberbay);MMF
|
||||||
|
MZ;Mainz Hbf;FMZ
|
||||||
|
MZBI;Mainz-Bischofsheim;FMB
|
||||||
|
N;Nürnberg Hbf;NN
|
||||||
|
NAU;Nauen;BNAU
|
||||||
|
NB;Neubrandenburg;WN
|
||||||
|
NDD;Neudietendorf;UND
|
||||||
|
NDF;Narsdorf;LNA
|
||||||
|
NDH;Nordhausen;UN
|
||||||
|
NE;Neuss Hbf;KN
|
||||||
|
NEA;Neustadt(Aisch)Bahnh;NNA
|
||||||
|
NECK;Mosbach-Neckarelz;RNZ
|
||||||
|
NENN;Bad Nenndorf;HNDF
|
||||||
|
NEUD;Neustadt(Dosse);WNS
|
||||||
|
NEUF;Neufahrn(Niederbay);MNFR
|
||||||
|
NEUK;Neukieritzsch;LNK
|
||||||
|
NEUS;Neustadt(Sachs);DNE
|
||||||
|
NEUZ;Neuzelle;BNZ
|
||||||
|
NFS;Nürnberg Frankensta;NSTD
|
||||||
|
NGM;Neckargemünd;RNM
|
||||||
|
NHM;Bad Nauheim;FBNA
|
||||||
|
NI;Nienburg(Weser);HNBG
|
||||||
|
NIDA;Nidderau;FHWD
|
||||||
|
NIDD;Nidda;FND
|
||||||
|
NIDH;Niedernhausen(Ts);FNSD
|
||||||
|
NILA;Niederlahnstein;KNL
|
||||||
|
NK;Neunkirchen(Saar)Hbf;SNK
|
||||||
|
NKN;Neukirchen(b Sulzb);NNS
|
||||||
|
NMB;Naumburg(Saale)Hbf;UNM
|
||||||
|
NMK;Neumark(Sachs);DNM
|
||||||
|
NMO;Neumarkt(Oberpf);NNT
|
||||||
|
NMS;Neumünster;AN
|
||||||
|
NMV;Neumarkt-St Veit;MNR
|
||||||
|
NMW;Neuenmarkt-Wirsberg;NNE
|
||||||
|
NOE;Nördlingen;MNL
|
||||||
|
NOM;Northeim(Han);HN
|
||||||
|
NOR;Norden;HNN
|
||||||
|
NP;Neuruppin West;WNRW
|
||||||
|
NR;Neuwied;KNE
|
||||||
|
NST;Nordstemmen;HNOS
|
||||||
|
NW;Neustadt(Weinstr)Hbf;RN
|
||||||
|
NWAL;Niederwalgern;FNL
|
||||||
|
NZ;Neustrelitz Hbf;WNT
|
||||||
|
OB;Oberhausen Hbf;EOB
|
||||||
|
OBRO;Rödermark-Ob.Roden;FORD
|
||||||
|
OD;Bad Oldesloe;AO
|
||||||
|
OEB;Oebisfelde;LOE
|
||||||
|
OERL;Oerlinghausen;EOER
|
||||||
|
OEYN;Bad Oeynhausen;HOY
|
||||||
|
OF;Offenbach(Main)Hbf;FO
|
||||||
|
OG;Offenburg;RO
|
||||||
|
OHA;Osterode a. H. Mitte;HOTM
|
||||||
|
OKZ;Oberkotzau;NOKP
|
||||||
|
OL;Oldenburg(Oldb)Hbf;HOLD
|
||||||
|
OLD;Oldenburg(Holst);AOL
|
||||||
|
OO;Oberoderwitz;DOZ
|
||||||
|
OR;Oranienburg;BOR
|
||||||
|
ORTR;Ortrand;BORT
|
||||||
|
OS;Osnabrück Hbf;HO
|
||||||
|
OST;Osterburken;TO
|
||||||
|
OZ;Oschatz;DOT
|
||||||
|
P;Potsdam Hbf;BPD
|
||||||
|
PA;Passau Hbf;NPA
|
||||||
|
PB;Paderborn Hbf;EPD
|
||||||
|
PE;Peine;HP
|
||||||
|
PEG;Pegnitz;NPZ
|
||||||
|
PEGA;Pegau;LPG
|
||||||
|
PF;Pforzheim Hbf;TPH
|
||||||
|
PIR;Pirna;DPI
|
||||||
|
PL;Plauen(Vogtl) ob Bf;DP
|
||||||
|
PLA;Plaaz;WPZ
|
||||||
|
PLAT;Plattling;NPL
|
||||||
|
PLO;Plochingen;TP
|
||||||
|
PLTH;Plaue(Thür);UPL
|
||||||
|
PPIR;Potsdam Pirschheide;BPDP
|
||||||
|
PRIB;Priemerburg;WPI
|
||||||
|
PRIE;Priestewitz;DPR
|
||||||
|
PRO;Probstzella;UPR
|
||||||
|
PRWK;Pritzwalk;WPR
|
||||||
|
PS;Pirmasens Nord;SPSN
|
||||||
|
PULS;Pulsnitz;DPUL
|
||||||
|
PUMS;Puttgarden(MS);AXP
|
||||||
|
PUTT;Puttgarden;APU
|
||||||
|
PW;Pasewalk;WP
|
||||||
|
PZ;Prenzlau;WPL
|
||||||
|
QFT;Querfurt;LQ
|
||||||
|
QLB;Quedlinburg;LQB
|
||||||
|
R;Regensburg Hbf;NRH
|
||||||
|
RA;Rastatt;RRA
|
||||||
|
RAT;Ratingen Ost;KRAO
|
||||||
|
RCOL;Reichenbach(Ol);DRCH
|
||||||
|
RCVO;Reichenbach(V) o Bf;DRC
|
||||||
|
RD;Rendsburg;AR
|
||||||
|
RDW;Radebeul-Kötzschenb;DRBK
|
||||||
|
RE;Recklinghausen Hbf;ERE
|
||||||
|
REM;Remagen;KRE
|
||||||
|
RENN;Renningen;TRX
|
||||||
|
RHED;Rheda-Wiedenbrück;ERDW
|
||||||
|
RHEI;Rheine;HR
|
||||||
|
RHH;Rheinhausen;KRH
|
||||||
|
RIE;Riesa;DR
|
||||||
|
RN;Rathenow;LRW
|
||||||
|
RO;Rosenheim;MRO
|
||||||
|
ROBL;Röblingen am See;LRN
|
||||||
|
ROHR;Rohrbach(Saar);SRO
|
||||||
|
ROIL;Rohrbach(Ilm);MRBI
|
||||||
|
RONN;Ronneburg(Thür);DRON
|
||||||
|
ROTT;Rottenbach;URTB
|
||||||
|
ROW;Rotenburg(Wümme);AROG
|
||||||
|
RS;Remscheid Hbf;KR
|
||||||
|
RSL;Roßlau(Elbe);LR
|
||||||
|
RT;Reutlingen Hbf;TRE
|
||||||
|
RU;Rudolstadt(Thür);UR
|
||||||
|
RUHL;Ruhland;BRU
|
||||||
|
RW;Rottweil;TR
|
||||||
|
RY;Rheydt Hbf;KRY
|
||||||
|
S;Stuttgart Hbf;TS
|
||||||
|
SAD;Schwandorf;NSCH
|
||||||
|
SALZ;Salzburg Hbf;XASB
|
||||||
|
SAW;Salzwedel;LSW
|
||||||
|
SB;Saarbrücken Hbf;SSH
|
||||||
|
SBC;Stuttgart-Bad Cannst;TSC
|
||||||
|
SBG;Strasburg(Uckerm);WSB
|
||||||
|
SBK;Schönebeck(Elbe);LSB
|
||||||
|
SCHG;Schöna(Gr);DSN
|
||||||
|
SCHH;Schaffhausen;XSS
|
||||||
|
SCHL;Schlüchtern;FSUE
|
||||||
|
SCHM;Schwelm;KSWE
|
||||||
|
SCHW;Schwerte(Ruhr);ESRT
|
||||||
|
SDH;Sondershausen;USH
|
||||||
|
SDL;Stendal Hbf;LS
|
||||||
|
SECK;Seckach;RSE
|
||||||
|
SEES;Seesen;HSSN
|
||||||
|
SFB;Senftenberg;BSN
|
||||||
|
SFT;Staßfurt;LSF
|
||||||
|
SG;Solingen Hbf;KSO
|
||||||
|
SGH;Sangerhausen;USG
|
||||||
|
SGM;Schwäbisch Gmünd;TSG
|
||||||
|
SHA;Schwäb.Hall-Hessent;TSHT
|
||||||
|
SHL;Suhl;USL
|
||||||
|
SHS;Schönhausen(Elbe);LSH
|
||||||
|
SI;Siegen Hbf;ESIE
|
||||||
|
SIF;Schifferstadt;RSD
|
||||||
|
SIG;Sigmaringen;TSIG
|
||||||
|
SIGB;Siegburg/Bonn;KSIB
|
||||||
|
SIHA;Siershahn;KSIH
|
||||||
|
SIMB;Simbach(Inn);MSBI
|
||||||
|
SIN;Singen(Hohentwiel);RSI
|
||||||
|
SINS;Sinsheim(Elsenz) Hbf;RSM
|
||||||
|
SLB;Sandersleben(Anh);LSL
|
||||||
|
SLF;Saalfeld(Saale);US
|
||||||
|
SLN;Schmölln(Thür);DSM
|
||||||
|
SLZ;Bad Salzungen;USZ
|
||||||
|
SM;Schmalkalden;USM
|
||||||
|
SN;Schwerin Hbf;WS
|
||||||
|
SO;Soest;ESOT
|
||||||
|
SOEM;Sömmerda;USD
|
||||||
|
SOL;Soltau(Han);HSO
|
||||||
|
SON;Sonneberg(Thür)Hbf;USO
|
||||||
|
SPAI;Spaichingen;TSP
|
||||||
|
SR;Straubing;NST
|
||||||
|
STD;Stade;AST
|
||||||
|
STEI;Steinach(b Rothenb);NSTN
|
||||||
|
STF;Straußfurt;USF
|
||||||
|
STHM;Glauburg-Stockheim;FSTM
|
||||||
|
STOL;Stolpen;DSTL
|
||||||
|
SW;Schweinfurt Hbf;NS
|
||||||
|
SWAA;Schwaan;WSN
|
||||||
|
SWB;Schwarzenberg(Erzg);DSC
|
||||||
|
SZRI;Salzgitter-Ringelh.;HSRI
|
||||||
|
TANG;Tantow(Gr);WXT
|
||||||
|
TBZ;Treuenbrietzen;BTZN
|
||||||
|
TEL;Teltow;BTL
|
||||||
|
TEU;Teuchern;UTEU
|
||||||
|
THEM;Themar;UTH
|
||||||
|
THH;Thalheim(Erzgeb);DTAL
|
||||||
|
TP;Templin;WT
|
||||||
|
TR;Trier Hbf;STR
|
||||||
|
TREU;Treuchtlingen;MTL
|
||||||
|
TREY;Treysa;FTS
|
||||||
|
TRIP;Triptis;UTR
|
||||||
|
TROI;Troisdorf;KT
|
||||||
|
TS;Traunstein;MTS
|
||||||
|
TUE;Tübingen Hbf;TT
|
||||||
|
TUEH;Türkheim(Bay)Bf;MTHB
|
||||||
|
TUEM;Türkismühle;STM
|
||||||
|
TUT;Tuttlingen;TTU
|
||||||
|
UCKR;Luckau-Uckro;BUK
|
||||||
|
UE;Uelzen;HU
|
||||||
|
UL;Ulm Hbf;TU
|
||||||
|
UN;Unna;EUN
|
||||||
|
VAI;Vaihingen(Enz);TV
|
||||||
|
VER;Verden(Aller);HV
|
||||||
|
VIE;Viersen;KV
|
||||||
|
VIEN;Vienenburg;HVBG
|
||||||
|
VK;Völklingen;SVL
|
||||||
|
VS;Villingen(Schwarzw);RVL
|
||||||
|
W;Wuppertal Hbf;KW
|
||||||
|
WAB;Wabern(Bz Kassel);FWAB
|
||||||
|
WAF;Warendorf;EWAF
|
||||||
|
WAL;Wallau(Lahn);FWA
|
||||||
|
WALK;Walkenried;HWKD
|
||||||
|
WAN;Wanne-Eickel Hbf;EWAN
|
||||||
|
WAR;Warburg(Westf);HWAR
|
||||||
|
WB;Luth. Wittenberg Hbf;LW
|
||||||
|
WBE;Wittenberge;WW
|
||||||
|
WBG;Wiesenburg(Mark);BWG
|
||||||
|
WBR;Wüstenbrand;DWD
|
||||||
|
WDA;Werdau;DWR
|
||||||
|
WDH;Waldheim;DWA
|
||||||
|
WE;Weimar;UWM
|
||||||
|
WEB;Westerburg;FWBG
|
||||||
|
WEET;Weetzen;HWEZ
|
||||||
|
WEID;Weida;UWE
|
||||||
|
WEIL;Weil der Stadt;TW
|
||||||
|
WEIN;Weinheim(Bergstr)Hbf;RWE
|
||||||
|
WEL;Weilburg;FWG
|
||||||
|
WEN;Weiden(Oberpf);NWDO
|
||||||
|
WERH;Werder(Havel);BWE
|
||||||
|
WERL;Werl;EWER
|
||||||
|
WERN;Werneuchen;BWER
|
||||||
|
WERT;Wertheim;TWT
|
||||||
|
WES;Wesel;EWES
|
||||||
|
WEST;Westerland(Sylt);AWLA
|
||||||
|
WETZ;Wetzlar;FWR
|
||||||
|
WF;Wolfenbüttel;HWOL
|
||||||
|
WHSN;Wernshausen;UWH
|
||||||
|
WI;Wiesbaden Hbf;FW
|
||||||
|
WIBI;Wiesbaden-Biebrich;FWB
|
||||||
|
WINN;Winnweiler;SWNW
|
||||||
|
WIT;Witten Hbf;EWIT
|
||||||
|
WITT;Wittingen;HWTT
|
||||||
|
WIWA;Wiesloch-Walldorf;RWS
|
||||||
|
WK;Wittstock(Dosse);WWK
|
||||||
|
WM;Weilheim(Oberbay);MWH
|
||||||
|
WN;Waiblingen;TWN
|
||||||
|
WO;Worms Hbf;FWOR
|
||||||
|
WOB;Wolfsburg Hbf;HWOB
|
||||||
|
WOE;Wörth(Rhein);RWRT
|
||||||
|
WRN;Waren(Müritz);WWR
|
||||||
|
WSF;Weißenfels;UW
|
||||||
|
WTH;Wilthen;DWT
|
||||||
|
WTL;Wittlich Hbf;SWIH
|
||||||
|
WUE;Würzburg Hbf;NWH
|
||||||
|
WUED;Wünschendorf;DRF
|
||||||
|
WUM;Wustermark;BWUS
|
||||||
|
WUN;Wunsiedel-Holenbrunn;NHOB
|
||||||
|
WUNS;Wunstorf;HWUN
|
||||||
|
WWI;Weilerswist;KWES
|
||||||
|
WZN;Wriezen;BWRZ
|
||||||
|
Z;Zwickau(Sachs)Hbf;DZW
|
||||||
|
ZE;Zerbst/Anhalt;LZE
|
||||||
|
ZEUL;Zeulenroda unt Bf;UZU
|
||||||
|
ZGGR;Zgorzelec(Gr);XPZG
|
||||||
|
ZI;Zittau;DZ
|
||||||
|
ZME;Zella-Mehlis;UZL
|
||||||
|
ZS;Zossen;BZO
|
||||||
|
ZZ;Zeitz;LZ
|
|
|
@ -4,6 +4,7 @@ import gleam/http.{Get}
|
||||||
import gleam/bit_builder.{BitBuilder}
|
import gleam/bit_builder.{BitBuilder}
|
||||||
import gleam/erlang/process
|
import gleam/erlang/process
|
||||||
import gleam/erlang/atom
|
import gleam/erlang/atom
|
||||||
|
import gleam/erlang/file
|
||||||
import gleam/io
|
import gleam/io
|
||||||
import gleam/int
|
import gleam/int
|
||||||
import gleam/string
|
import gleam/string
|
||||||
|
@ -129,6 +130,7 @@ fn lookup_station(
|
||||||
request: Request(t),
|
request: Request(t),
|
||||||
stations: Map(String, String),
|
stations: Map(String, String),
|
||||||
ds100s: Map(String, String),
|
ds100s: Map(String, String),
|
||||||
|
leitpunkte: Map(String, String),
|
||||||
baseurl: String,
|
baseurl: String,
|
||||||
fuzzy: fn (String) -> List(String)
|
fuzzy: fn (String) -> List(String)
|
||||||
) -> Response(BitBuilder) {
|
) -> Response(BitBuilder) {
|
||||||
|
@ -140,13 +142,29 @@ fn lookup_station(
|
||||||
200,
|
200,
|
||||||
"ds100 → Name: " <> baseurl <> "/NN\n" <> "Name → ds100: " <> baseurl <> "/Nürnberg Hbf",
|
"ds100 → Name: " <> baseurl <> "/NN\n" <> "Name → ds100: " <> baseurl <> "/Nürnberg Hbf",
|
||||||
)
|
)
|
||||||
|
Request(method: Get, path: "/ds100/" <> path, ..) ->
|
||||||
|
path
|
||||||
|
|> unpercent
|
||||||
|
|> string.uppercase
|
||||||
|
|> lookup_exact(ds100s)
|
||||||
|
Request(method: Get, path: "/name/" <> path, ..) ->
|
||||||
|
path
|
||||||
|
|> unpercent
|
||||||
|
|> lookup_by_name(stations, ds100s, fuzzy)
|
||||||
|
Request(method: Get, path: "/leitpunkt/" <> path, ..) ->
|
||||||
|
path
|
||||||
|
|> unpercent
|
||||||
|
|> string.uppercase
|
||||||
|
|> lookup_exact(leitpunkte)
|
||||||
Request(method: Get, path: "/" <> path, ..) -> {
|
Request(method: Get, path: "/" <> path, ..) -> {
|
||||||
let path = unpercent(path)
|
let path = unpercent(path)
|
||||||
|
|
||||||
let by_ds100 = lookup_exact(path, ds100s)
|
let by_ds100 = lookup_exact(path, ds100s)
|
||||||
|
let by_lp = lookup_exact(path, leitpunkte)
|
||||||
|
|
||||||
case by_ds100.0 {
|
case #(by_ds100.0, by_lp.0) {
|
||||||
200 -> by_ds100
|
#(200, _) -> by_ds100
|
||||||
|
#(_, 200) -> by_lp
|
||||||
_ -> lookup_by_name(path, stations, ds100s, fuzzy)
|
_ -> lookup_by_name(path, stations, ds100s, fuzzy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,26 +201,25 @@ fn fetch_data() -> Result(String, hackney.Error) {
|
||||||
Ok(string.replace(response.body, "<EFBFBD>", "ü"))
|
Ok(string.replace(response.body, "<EFBFBD>", "ü"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_csv() -> List(#(String, String)) {
|
fn read_csv(contents) -> List(List(String)) {
|
||||||
// let assert Ok(contents) = file.read(path)
|
|
||||||
let assert Ok(contents) = fetch_data()
|
|
||||||
contents
|
contents
|
||||||
// the file doesn't use quotes, so this is fine
|
// the file doesn't use quotes, so this is fine
|
||||||
|> string.split(on: "\n")
|
|> string.split(on: "\n")
|
||||||
// drop CSV header
|
// drop CSV header
|
||||||
|> list.drop(1)
|
|> list.drop(1)
|
||||||
|> list.map(fn(a) { string.split(a, on: ";") })
|
|> list.map(fn(a) { string.split(a, on: ";") })
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn main() {
|
||||||
|
let assert Ok(bahn_ril100) = fetch_data()
|
||||||
|
let baseurl = "https://bahnhof.name"
|
||||||
|
let stations = read_csv(bahn_ril100)
|
||||||
|> list.filter_map(fn(fields) {
|
|> list.filter_map(fn(fields) {
|
||||||
case fields {
|
case fields {
|
||||||
[_, ds100, name, ..] -> Ok(#(name, ds100))
|
[_, ds100, name, ..] -> Ok(#(name, ds100))
|
||||||
_ -> Error(fields)
|
_ -> Error(fields)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let baseurl = "https://bahnhof.name"
|
|
||||||
let stations = read_csv()
|
|
||||||
let stationmap =
|
let stationmap =
|
||||||
stations
|
stations
|
||||||
|> map.from_list
|
|> map.from_list
|
||||||
|
@ -220,6 +237,16 @@ pub fn main() {
|
||||||
-> map.from_list([#("id", ds100), #("name", name)]
|
-> map.from_list([#("id", ds100), #("name", name)]
|
||||||
)}}))
|
)}}))
|
||||||
|
|
||||||
|
let assert Ok(leitpunkte_raw) = file.read("data/leitpunkte.csv")
|
||||||
|
let leitpunkte =
|
||||||
|
read_csv(leitpunkte_raw)
|
||||||
|
|> list.filter_map(fn(fields) {
|
||||||
|
case fields {
|
||||||
|
[lp, _, ds100] -> Ok(#(lp, ds100))
|
||||||
|
_ -> Error(fields)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|> map.from_list
|
||||||
|
|
||||||
let fuzzy = fn(searchterm: String) -> List(String) {
|
let fuzzy = fn(searchterm: String) -> List(String) {
|
||||||
let query = query_new()
|
let query = query_new()
|
||||||
|
@ -259,7 +286,7 @@ pub fn main() {
|
||||||
|
|
||||||
let _ = mist.run_service(
|
let _ = mist.run_service(
|
||||||
2345,
|
2345,
|
||||||
fn(req) { lookup_station(req, stationmap, ds100map, baseurl, fuzzy) },
|
fn(req) { lookup_station(req, stationmap, ds100map, leitpunkte, baseurl, fuzzy) },
|
||||||
max_body_limit: 100,
|
max_body_limit: 100,
|
||||||
)
|
)
|
||||||
process.sleep_forever()
|
process.sleep_forever()
|
||||||
|
|
Loading…
Reference in a new issue