Commit 7617e2cd authored by Volker Krause's avatar Volker Krause
Browse files

Properly support split tracks

For a single track split the previous approach was still somewhat working,
for the triple or quad split found in some places it wasn't working at all
anymore though. So we now properly (and when needed assemble) all track
fragments.

Sooner or later we would probably have needed that anyway (and same for
edges), as we otherwise can't do a proper vehicle layout overlay.
parent 93fcf764
......@@ -75,7 +75,7 @@
stop point: n2813070481
edge: n2813070481
area: r929443
track: w85258722
track: [w85258722 w643739286 ]
level: 20
mode: Rail
lines: EC 55|EC 95|IC 56|IC 77|ICE 3|ICE 12|ICE 13|NJ 457|RB14|RE1|RE2|RE7
......@@ -93,7 +93,7 @@
stop point: n2813070483
edge: n2813070483
area: r918697
track: w85258724
track: [w85258724 w643739266 ]
level: 20
mode: Rail
lines: EC 54|EC 95|IC 56|IC 77|ICE 3|ICE 12|ICE 13|NJ 456|RB14|RB21|RB22|RE1|RE2|RE7
......@@ -128,7 +128,7 @@
stop point: n446289301
edge: n446289301
area: w86379623
track: w70270903
track: [w70270903 w421618231 ]
level: -20
mode: Subway
4
......
......@@ -3,7 +3,7 @@
stop point: n1629835979
edge: n1629835979
area: r6743846
track: w150030924
track: [w150030924 w150046978 ]
level: 10
mode: Rail
lines: IC 31|RB24|RB26|RE5|RE12|RE22
......@@ -15,7 +15,7 @@
stop point: n1629835981
edge: n1629835981
area: r6838169
track: w150032665
track: [w150032665 w423966147 ]
level: 10
mode: Rail
lines: FLX 20|FLX 30|IC 50|ICE 10|RB48|RE7
......@@ -35,7 +35,7 @@
stop point: n1629835990
edge: n1629835990
area: r6838169
track: w150030933
track: [w150030933 w150046982 ]
level: 10
mode: Rail
lines: EC 114|IC 32|IC 35|IC 37|IC 55|RB38|RE8|RE9
......@@ -55,7 +55,7 @@
stop point: n1629835999
edge: n1629835999
area: r6838161
track: w150033263
track: [w150033263 w150046979 ]
level: 10
mode: Rail
lines: IC 55|ICE 43|ICE 45|ICE 49|ICE 79|RB27|RE1|RE6|RE8
......@@ -73,7 +73,7 @@
stop point: n1629836010
edge: n1629836010
area: r6838161
track: w150046958
track: [w150046958 w456217157 ]
level: 10
mode: Rail
lines: EC 6|EC 8|IC 50|IC 50 MDV|ICE 1|ICE 42|ICE 49|ICE 78|ICE 79|RE8|Thalys
......@@ -91,7 +91,7 @@
stop point: n1629836021
edge: n1629836021
area: r6838127
track: w150046959
track: [w150046959 w423966144 ]
level: 10
mode: Rail
lines: IC 30|ICE 42|ICE 43|ICE 45|ICE 78
......@@ -111,7 +111,7 @@
stop point: n1629836023
edge: n1629836023
area: r6838127
track: w150046952
track: [w150046952 w406269817 ]
level: 10
mode: Rail
lines: EC 7|EC 9|EC 115|FLX 20|IC 30|IC 31|IC 35|IC 37|IC 55|NJ 421|NJ 40421|RB24|RB38|RB48|RE5
......@@ -131,7 +131,7 @@
stop point: n1629836034
edge: n1629836034
area: r6838147
track: w150046956
track: [w150046956 w150046981 ]
level: 10
mode: Rail
lines: FLX 30|IC 30|IC 32|RE8|RE9|RE12|RE22
......@@ -149,7 +149,7 @@
stop point: n1629836040
edge: n1629836040
area: r6838147
track: w150046954
track: [w150046954 w150046990 ]
level: 10
mode: Rail
lines: IC 55|ICE 1|ICE 10|RB26|RB27|RE1|RE6|RE7|Thalys
......@@ -171,7 +171,7 @@
stop point: n1629836001
edge: n1629836001
area: r6838156
track: w150046991
track: [w150046991 w464230879 ]
level: 10
mode: Rail
lines: RB25|S6|S11|S12|S13|S19
......@@ -180,7 +180,7 @@
stop point: n1629836012
edge: n1629836012
area: r6838156
track: w150046960
track: [w150046960 w150047008 ]
level: 10
mode: Rail
lines: RB25|S6|S11|S12|S13|S19
......@@ -189,7 +189,7 @@
stop point: <null>
edge: <null>
area: w141211002
track: <null>
track: []
level: -20
mode: Tram
1
......
......@@ -3,7 +3,7 @@
stop point: n1686600813
edge: w662834905
area: w42873615
track: w214250400
track: [w214250400 w638668145 ]
level: 0
mode: Rail
lines: EC 6|EC 8|EC 27|EC 172
......@@ -17,7 +17,7 @@
stop point: n1686600812
edge: w662834904
area: w42873615
track: w4841532
track: [w4841532 w638668139 ]
level: 0
mode: Rail
lines: FLX 20|IC 31|ICE 1|ICE 22|ICE 25|ICE 26
......@@ -31,7 +31,7 @@
stop point: n1686600811
edge: w662834903
area: w662729031
track: w75408304
track: [w75408304 w655325342 ]
level: 0
mode: Rail
lines: ICE 4|ICE 20|RB71|RE6
......@@ -51,7 +51,7 @@
stop point: n1686600810
edge: w662834902
area: w662729031
track: w77339553
track: [w77339553 w628028614 ]
level: 0
mode: Rail
lines: RB71
......@@ -71,7 +71,7 @@
stop point: n1686600809
edge: w662834906
area: w42873617
track: w6271257
track: [w6271257 w638451288 ]
level: 0
mode: Rail
lines: EC 7|RB71|RE6
......@@ -91,7 +91,7 @@
stop point: n1686600808
edge: w662834907
area: w42873617
track: w75412691
track: [w75412691 w639357907 ]
level: 0
mode: Rail
lines: EC 9|FLX 20|ICE 25|NJ 491|NJ 40491
......@@ -111,7 +111,7 @@
stop point: n1686600807
edge: w662834901
area: w662729032
track: w6270944
track: [w6270944 w639366296 ]
level: 0
mode: Rail
lines: EC 27|ICE 1|ICE 20|ICE 22|ICE 26
......@@ -129,7 +129,7 @@
stop point: n1686600814
edge: w662834900
area: w662729032
track: w6138684
track: [w6138684 w628028612 ]
level: 0
mode: Rail
lines: EC 173|IC 31|ICE 4|ICE 26
......@@ -145,7 +145,7 @@ Hamburg-Altona
stop point: n300809500
edge: n300809500
area: w42838504
track: w292634009
track: [w292634009 w466940238 ]
level: -20
mode: Rail
lines: S11|S31
......@@ -154,7 +154,7 @@ Hamburg-Altona
stop point: n300809530
edge: n300809530
area: w42838505
track: w292634013
track: [w292634013 w466940236 ]
level: -20
mode: Rail
lines: S1|S2|S3
......@@ -163,7 +163,7 @@ Hamburg-Altona
stop point: n535951138
edge: n535951138
area: w42838504
track: w42836978
track: [w42836978 w466940240 ]
level: -20
mode: Rail
lines: S1|S2|S3
......@@ -172,7 +172,7 @@ Hamburg-Altona
stop point: n535951140
edge: n535951140
area: w42838505
track: w42837004
track: [w42837004 w466940237 ]
level: -20
mode: Rail
lines: S11|S31
......@@ -3,7 +3,7 @@
stop point: n1496742397
edge: w585434416
area: r8267478
track: w418946244
track: [w418946244 w418946449 ]
level: -20
mode: Rail
lines: S 1|S 2|S 3|S 4|S 5|S 5X|S 6
......@@ -12,7 +12,7 @@
stop point: n1496742399
edge: w233515717
area: r8267478
track: w220862148
track: [w220862148 w418946243 ]
level: -20
mode: Rail
lines: S 1|S 2|S 3|S 4|S 5|S 5X|S 6
......@@ -21,7 +21,7 @@
stop point: n2299420229
edge: w180182558
area: r5299027
track: w136503816
track: [w136503816 w495912466 ]
level: 10
mode: Rail
lines: EB 22|EBx 12
......@@ -30,7 +30,7 @@
stop point: n2299420230
edge: w585434418
area: r5299027
track: w355578371
track: [w355578371 w755765640 ]
level: 10
mode: Rail
8
......@@ -38,7 +38,7 @@
stop point: n2299420231
edge: w585434423
area: r5299028
track: w355578377
track: [w355578377 w755765639 ]
level: 10
mode: Rail
lines: RE 42
......@@ -47,7 +47,7 @@
stop point: <null>
edge: <null>
area: r9615740
track: <null>
track: []
level: 10
mode: Rail
9
......@@ -55,7 +55,7 @@
stop point: n2299420233
edge: w585434420
area: r5299028
track: w180361919
track: [w180361919 w755765638 ]
level: 10
mode: Rail
lines: RE 10
......@@ -73,7 +73,7 @@
stop point: n2299420216
edge: w671847191
area: r5299020
track: w185568994
track: [w185568994 w755765641 ]
level: 10
mode: Rail
lines: ICE 11|ICE 28
......@@ -82,7 +82,7 @@
stop point: n2299420217
edge: w367895064
area: r5299021
track: w364656307
track: [w364656307 w495912491 ]
level: 10
mode: Rail
lines: IC 17
......@@ -94,7 +94,7 @@
stop point: n2299420218
edge: w691835117
area: r5299021
track: w364561620
track: [w364561620 w496272898 ]
level: 10
mode: Rail
lines: IC 55|IC 56|ICE 50|RE 13
......@@ -106,7 +106,7 @@
stop point: n2299420219
edge: w585434429
area: r5299022
track: w172523082
track: [w172523082 w403728891 ]
level: 10
mode: Rail
lines: IC 55
......@@ -115,7 +115,7 @@
stop point: n2299420220
edge: w180179182
area: r5299022
track: w185568947
track: [w185568947 w496278957 ]
level: 10
mode: Rail
lines: ICE 50
......@@ -124,7 +124,7 @@
stop point: n2299420221
edge: w585434432
area: r5299023
track: w180361918
track: [w180361918 w496278963 ]
level: 10
mode: Rail
17
......@@ -132,7 +132,7 @@
stop point: n2299420222
edge: w691835113
area: r5299023
track: w375840482
track: [w375840482 w755765644 ]
level: 10
mode: Rail
18
......@@ -140,7 +140,7 @@
stop point: n2299420223
edge: w691835112
area: r5299024
track: w172523106
track: [w172523106 w755765645 ]
level: 10
mode: Rail
18a
......@@ -156,7 +156,7 @@
stop point: n2299420224
edge: w691835111
area: r5299024
track: w180361916
track: [w180361916 w755765646 ]
level: 10
mode: Rail
20
......@@ -164,7 +164,7 @@
stop point: n2299420225
edge: w691835110
area: r5299025
track: w272930584
track: [w272930584 w755765647 ]
level: 10
mode: Rail
lines: RB 110
......@@ -173,7 +173,7 @@
stop point: n2299420226
edge: w585434441
area: r5299025
track: w180361927
track: [w180361927 w755765648 ]
level: 10
mode: Rail
lines: RB 113|RE 50
......@@ -182,7 +182,7 @@
stop point: n2299420227
edge: w585434444
area: r5299026
track: w172523081
track: [w172523081 w755765649 ]
level: 10
mode: Rail
23
......@@ -190,7 +190,7 @@
stop point: n2299420228
edge: w691835107
area: r5299026
track: w172524316
track: [w172524316 w540013191 ]
level: 10
mode: Rail
lines: RE 6
......@@ -225,7 +225,7 @@ A
stop point: n1395169569
edge: n1395169569
area: r6290220
track: w327262364
track: [w327262364 w333228552 ]
level: 0
mode: Tram
lines: 1|10|11|11E|16|32
......@@ -234,7 +234,7 @@ B
stop point: n945163727
edge: n945163727
area: r6290221
track: w35165350
track: [w35165350 w327262365 ]
level: 0
mode: Tram
lines: 1|10|11|11E|16
......@@ -243,7 +243,7 @@ C
stop point: n1395169568
edge: n1395169568
area: r6290222
track: w150289839
track: [w150289839 w327262363 ]
level: 0
mode: Tram
lines: 3|3E|4|7|15
......@@ -252,7 +252,7 @@ D
stop point: n123900738
edge: n123900738
area: r6290223
track: w27286704
track: [w27286704 w317371119 ]
level: 0
mode: Tram
lines: 3|3E|4|7|14|15|32
......@@ -261,6 +261,6 @@ F
stop point: <null>
edge: <null>
area: r7319142
track: <null>
track: []
level: 0
mode: Tram
......@@ -3,7 +3,7 @@
stop point: <null>
edge: <null>
area: w406470899
track: <null>
track: []
level: -30
mode: Rail
2
......@@ -20,7 +20,7 @@
stop point: <null>
edge: <null>
area: w406470899
track: <null>
track: []
level: -30
mode: Rail
4
......@@ -28,7 +28,7 @@
stop point: <null>
edge: <null>
area: w406470900
track: <null>
track: []
level: -30
mode: Rail
5
......@@ -36,7 +36,7 @@
stop point: <null>
edge: <null>
area: w436239151
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -55,7 +55,7 @@
stop point: <null>
edge: <null>
area: w361731430
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -74,7 +74,7 @@
stop point: <null>
edge: <null>
area: w361731430
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -93,7 +93,7 @@
stop point: <null>
edge: <null>
area: w361731435
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -112,7 +112,7 @@
stop point: <null>
edge: <null>
area: w361731435
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -131,7 +131,7 @@
stop point: <null>
edge: <null>
area: r5444292
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -150,7 +150,7 @@
stop point: <null>
edge: <null>
area: r5444292
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -169,7 +169,7 @@
stop point: <null>
edge: <null>
area: w361731429
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -190,7 +190,7 @@
stop point: <null>
edge: <null>
area: w361731429
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -211,7 +211,7 @@
stop point: <null>
edge: <null>
area: w361731434
track: <null>
track: []
level: 10
mode: Rail
sections:
......@@ -246,7 +246,7 @@ B
stop point: <null>
edge: <null>
area: w436236023
track: <null>
track: []
level: 10
mode: Rail
C
......@@ -254,7 +254,7 @@ C
stop point: <null>
edge: <null>
area: w129299895
track: <null>
track: []
level: 10
mode: Rail
C
......@@ -284,7 +284,7 @@ D
stop point: <null>
edge: <null>
area: w129299895
track: <null>
track: []
level: 10
mode: Rail
D
......@@ -314,7 +314,7 @@ E
stop point: <null>
edge: <null>
area: w129299897
track: <null>
track: []
level: 10
mode: Rail
E
......@@ -344,7 +344,7 @@ G
stop point: <null>
edge: <null>
area: w129299897
track: <null>
track: []
level: 10
mode: Rail
G
......
......@@ -43,6 +43,20 @@ private:
break;
}
}
void writeElement(QIODevice *device, const std::vector<OSM::Element> elems)
{
if (elems.size() == 1) {
writeElement(device, elems[0]);
return;
}
device->write("[");
for (auto e : elems) {
writeElement(device, e);
device->write(" ");
}
device->write("]");
}
private Q_SLOTS:
void initTestCase()
......
......@@ -7,6 +7,7 @@
#include "platform.h"
#include <osm/geomath.h>
#include <osm/pathutil.h>
#include <QRegularExpression>
......@@ -86,14 +87,19 @@ void Platform::setArea(OSM::Element area)
m_area = area;
}
OSM::Element Platform::track() const
const std::vector<OSM::Element>& Platform::track() const
{
return m_track;
}
void Platform::setTrack(OSM::Element track)
void Platform::setTrack(std::vector<OSM::Element> &&track)
{
m_track = track;
m_track = std::move(track);
}
std::vector<OSM::Element>&& Platform::takeTrack()
{
return std::move(m_track);
}
const std::vector<PlatformSection>& Platform::sections() const
......@@ -150,6 +156,19 @@ static double maxSectionDistance(const std::vector<const OSM::Node*> &path, cons
return dist;
}
double Platform::maxSectionDistance(const Platform &p, const std::vector<PlatformSection> &sections, const OSM::DataSet &dataSet)
{