Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
fce75b47
Commit
fce75b47
authored
Apr 21, 2020
by
Volker Krause
Browse files
Prioritize stations by size (as-in: amount of platforms)
This fixes the HKG test, and produces a stable result for NRT.
parent
893d4287
Changes
2
Hide whitespace changes
Inline
Side-by-side
autotests/airportdbtest.cpp
View file @
fce75b47
...
...
@@ -228,6 +228,7 @@ private Q_SLOTS:
QTest
::
newRow
(
"CPH"
)
<<
s
(
"CPH"
)
<<
55.6295693
f
<<
12.6492994
f
<<
50
;
QTest
::
newRow
(
"DEL"
)
<<
s
(
"DEL"
)
<<
28.55681
f
<<
77.08718
f
<<
50
;
QTest
::
newRow
(
"DEN"
)
<<
s
(
"DEN"
)
<<
39.84790
f
<<
-
104.67340
f
<<
150
;
QTest
::
newRow
(
"DOH"
)
<<
s
(
"DOH"
)
<<
25.25854
f
<<
51.61507
f
<<
400
;
// ok-ish, w212459176 interfering, n7052290435 out of range
QTest
::
newRow
(
"DUB"
)
<<
s
(
"DUB"
)
<<
53.4273328
f
<<
-
6.2437352
f
<<
150
;
QTest
::
newRow
(
"DUS"
)
<<
s
(
"DUS"
)
<<
51.27889
f
<<
6.76566
f
<<
150
;
QTest
::
newRow
(
"EAP"
)
<<
s
(
"EAP"
)
<<
47.59960
f
<<
7.53144
f
<<
150
;
...
...
@@ -243,6 +244,7 @@ private Q_SLOTS:
QTest
::
newRow
(
"HAJ"
)
<<
s
(
"HAJ"
)
<<
52.45849
f
<<
9.69898
f
<<
50
;
QTest
::
newRow
(
"HAM"
)
<<
s
(
"HAM"
)
<<
53.63214
f
<<
10.00648
f
<<
100
;
QTest
::
newRow
(
"HEL"
)
<<
s
(
"HEL"
)
<<
60.31619
f
<<
24.96914
f
<<
50
;
QTest
::
newRow
(
"HFS"
)
<<
s
(
"HFS"
)
<<
60.02591
f
<<
13.58202
f
<<
50
;
QTest
::
newRow
(
"HKG"
)
<<
s
(
"HKG"
)
<<
22.31569
f
<<
113.93605
f
<<
100
;
QTest
::
newRow
(
"KEF"
)
<<
s
(
"KEF"
)
<<
63.99663
f
<<
-
22.62355
f
<<
200
;
QTest
::
newRow
(
"LAX"
)
<<
s
(
"LAX"
)
<<
33.94356
f
<<
-
118.40786
f
<<
150
;
...
...
@@ -252,11 +254,12 @@ private Q_SLOTS:
QTest
::
newRow
(
"LUX"
)
<<
s
(
"LUX"
)
<<
49.63506
f
<<
6.21650
f
<<
200
;
QTest
::
newRow
(
"LYS"
)
<<
s
(
"LYS"
)
<<
45.72065
f
<<
5.07807
f
<<
150
;
QTest
::
newRow
(
"MUC"
)
<<
s
(
"MUC"
)
<<
48.35378
f
<<
11.78633
f
<<
50
;
QTest
::
newRow
(
"NRT"
)
<<
s
(
"NRT"
)
<<
35.7
7059
f
<<
140.386
79
f
<<
3
00
;
QTest
::
newRow
(
"NRT"
)
<<
s
(
"NRT"
)
<<
35.7
6462
f
<<
140.386
15
f
<<
1
00
;
// technically a multi-terminal airport, but T1 is reasonable as all ways there pass T2
QTest
::
newRow
(
"NUE"
)
<<
s
(
"NUE"
)
<<
49.49411
f
<<
11.07867
f
<<
50
;
QTest
::
newRow
(
"ORD"
)
<<
s
(
"ORD"
)
<<
41.97779
f
<<
-
87.90269
f
<<
50
;
QTest
::
newRow
(
"OSL"
)
<<
s
(
"OSL"
)
<<
60.19361
f
<<
11.09758
f
<<
100
;
QTest
::
newRow
(
"OTP"
)
<<
s
(
"OTP"
)
<<
44.57040
f
<<
26.07763
f
<<
200
;
QTest
::
newRow
(
"OUL"
)
<<
s
(
"OUL"
)
<<
64.92865
f
<<
25.37406
f
<<
50
;
QTest
::
newRow
(
"PDX"
)
<<
s
(
"PDX"
)
<<
45.58833
f
<<
-
122.59240
f
<<
150
;
QTest
::
newRow
(
"PRG"
)
<<
s
(
"PRG"
)
<<
50.10640
f
<<
14.26784
f
<<
100
;
QTest
::
newRow
(
"PVG"
)
<<
s
(
"PVG"
)
<<
31.15240
f
<<
121.80214
f
<<
100
;
...
...
@@ -275,7 +278,7 @@ private Q_SLOTS:
QTest
::
newRow
(
"YOW"
)
<<
s
(
"YOW"
)
<<
45.32277
f
<<
-
75.66726
f
<<
100
;
QTest
::
newRow
(
"ZRH"
)
<<
s
(
"ZRH"
)
<<
47.45024
f
<<
8.56207
f
<<
50
;
// too complex to work with this approach: LHR, CDG, MAD, MXP, ICN, BCN, PEK
// too complex to work with this approach: LHR, CDG, MAD, MXP, ICN, BCN, PEK
, BOM
}
void
airportLocationTest
()
...
...
@@ -295,7 +298,6 @@ private Q_SLOTS:
QEXPECT_FAIL("BUD", "closed terminal 1 (w8557242) interfering", Continue);
QEXPECT_FAIL("GLA", "airport is not a polygon in OSM", Continue);
QEXPECT_FAIL("GRU", "w777206182 interfering", Continue);
QEXPECT_FAIL("HKG", "better station selection", Continue);
QEXPECT_FAIL("PRG", "private/military terminals 3 and 4 interfering", Continue);
QEXPECT_FAIL("PVG", "complicated", Continue);
QEXPECT_FAIL("RIG", "open polygon in OSM", Continue);
...
...
src/knowledgedb-generator/osmairportdb.cpp
View file @
fce75b47
...
...
@@ -275,6 +275,16 @@ void OSMAirportDb::filterStations(OSMAirportData &airport)
if
(
it
!=
airport
.
stations
.
begin
()
&&
it
!=
airport
.
stations
.
end
())
{
airport
.
stations
.
erase
(
it
,
airport
.
stations
.
end
());
}
// prioritize by number of platforms, if we have that information for all stations
if
(
airport
.
stations
.
size
()
>
1
&&
std
::
all_of
(
airport
.
stations
.
begin
(),
airport
.
stations
.
end
(),
[](
auto
s
)
{
return
!
s
.
tagValue
(
QLatin1String
(
"platforms"
)).
isEmpty
();
}))
{
std
::
sort
(
airport
.
stations
.
begin
(),
airport
.
stations
.
end
(),
[](
auto
lhs
,
auto
rhs
)
{
return
lhs
.
tagValue
(
QLatin1String
(
"platforms"
)).
toInt
()
>
rhs
.
tagValue
(
QLatin1String
(
"platforms"
)).
toInt
();
});
if
(
airport
.
stations
[
0
].
tagValue
(
QLatin1String
(
"platforms"
))
!=
airport
.
stations
[
1
].
tagValue
(
QLatin1String
(
"platforms"
)))
{
airport
.
stations
.
erase
(
std
::
next
(
airport
.
stations
.
begin
()),
airport
.
stations
.
end
());
}
}
}
OSM
::
Coordinate
OSMAirportDb
::
lookup
(
const
QString
&
iata
,
float
lat
,
float
lon
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment