Commit 46de258c authored by Volker Krause's avatar Volker Krause
Browse files

Update line metadata database

This also increases the file size limit for images a bit, which together
with supporting licenses needing attributions now as well as new upstream
data gives us quite a few more line logos.
parent 04b755cc
......@@ -35,26 +35,26 @@ private Q_SLOTS:
QTest::newRow("Nurnberg U2") << 49.44 << 11.08 << s("U2") << Line::Metro << QColor(0xffff0000) << s("N%C3%BCrnberg%20U2.svg") << s("U-Bahn.svg");
QTest::newRow("Frankfurt U8") << 50.1 << 8.66 << s("U8") << Line::Metro << QColor(0xffc77db5) << s("Frankfurt%20U8.svg") << s("U-Bahn.svg");
QTest::newRow("Brussels 2") << 50.83 << 4.33 << s("2") << Line::Metro << QColor(0xfff57000) << s("STIB-MIVB%20Line%202.svg") << s("Brussels%20Metro%20Logo.svg");
QTest::newRow("Brussels 82") << 50.83 << 4.33 << s("82") << Line::Tramway << QColor(0xff9ebfe3) << s("STIB-MIVB%20Line%2082.svg") << s("Brussels%20tramway%20icon.svg");
QTest::newRow("Brussels 82") << 50.83 << 4.33 << s("82") << Line::Tramway << QColor(0xff91bee7) << s("STIB-MIVB%20Line%2082.svg") << s("Brussels%20tramway%20icon.svg");
QTest::newRow("Brussels S6") << 50.83 << 4.33 << s("S6") << Line::RapidTransit << QColor(0xff965f26) << QString() << s("NMBS%20S-Trein%20logo.svg");
QTest::newRow("Brussels S10") << 50.83 << 4.33 << s("S10") << Line::RapidTransit << QColor(0xffff1f20) << QString() << s("NMBS%20S-Trein%20logo.svg");
QTest::newRow("Paris RER C") << 48.84 << 2.37 << s("C") << Line::RapidTransit << QColor(0xfffcd946) << s("Paris%20RER%20C%20icon.svg") << s("RER.svg");
QTest::newRow("Paris RER D") << 48.84 << 2.37 << s("D") << Line::RapidTransit << QColor(0xff5e9620) << s("Paris%20RER%20D%20icon.svg") << s("RER.svg");
QTest::newRow("Brussels S10") << 50.83 << 4.33 << s("S10") << Line::RapidTransit << QColor(0xff000000) << QString() << s("NMBS%20S-Trein%20logo.svg");
QTest::newRow("Paris RER C") << 48.84 << 2.37 << s("C") << Line::RapidTransit << QColor(0xfffcd946) << s("Paris%20transit%20icons%20-%20RER%20C.svg") << s("RER.svg");
QTest::newRow("Paris RER D") << 48.84 << 2.37 << s("D") << Line::RapidTransit << QColor(0xff5e9620) << s("Paris%20transit%20icons%20-%20RER%20D.svg") << s("RER.svg");
QTest::newRow("Paris Metro 1") << 48.84 << 2.37 << s("1") << Line::Metro << QColor(0xfff2c931) << s("Paris%20Metro%201.svg") << s("Metro-M.svg");
QTest::newRow("Milano M5") << 45.48 << 9.18 << s("M5") << Line::Metro << QColor(0xff7956a3) << s("Milano%20linea%20M5.svg") << s("Logo%20Metropolitane%20Italia.svg");
QTest::newRow("Milano S1") << 45.48 << 9.18 << s("S1") << Line::RapidTransit << QColor(0xffde3d30) << s("Milano%20S1.svg") << s("Linee%20S%20di%20Milano.svg");
QTest::newRow("Hannover S1") << 52.37 << 9.74 << s("S1") << Line::RapidTransit << QColor(0xff7760b0) << QString() << s("S-Bahn-Logo.svg");
QTest::newRow("Hannover S1") << 52.37 << 9.74 << s("S1") << Line::RapidTransit << QColor(0xff7760b0) << s("Hannover%20S1.svg") << s("S-Bahn-Logo.svg");
QTest::newRow("Magdeburg S1") << 52.13 << 11.62 << s("S 1") << Line::RapidTransit << QColor(0xff408040) << QString() << s("S-Bahn-Logo.svg");
QTest::newRow("Magdeburg 1") << 52.13 << 11.62 << s("1") << Line::Tramway << QColor(0xffb6005c) << QString() << QString();
QTest::newRow("Magdeburg 1") << 52.13 << 11.62 << s("1") << Line::Tramway << QColor(0xffb6005c) << s("Magdeburg%20Tram%201%20(2021).png") << QString();
QTest::newRow("Vienna U1") << 48.18 << 16.37 << s("U1") << Line::Metro << QColor(0xffe20613) << s("Wien%20U1.svg") << s("U-Bahn%20Wien.svg");
QTest::newRow("Vienna S1") << 48.18 << 16.37 << s("S1") << Line::RapidTransit << QColor(0xff343593) << QString() << s("S-Bahn%20Austria.svg");
QTest::newRow("Vienna S1") << 48.18 << 16.37 << s("S1") << Line::RapidTransit << QColor(0xff159dd9) << s("S1%20Wien.svg") << s("S-Bahn%20Wien.svg");
QTest::newRow("Hamburg U1") << 53.55 << 10.0 << s("U1") << Line::Metro << QColor(0xff0066b3) << s("Hamburg%20U1.svg") << s("U-Bahn.svg");
QTest::newRow("Hamburg S1") << 53.55 << 10.0 << s("S1") << Line::RapidTransit << QColor(0xff33b540) << s("Hamburg%20S1.svg") << s("S-Bahn-Logo.svg");
QTest::newRow("Copenhagen A") << 55.67 << 12.56 << s("A") << Line::RapidTransit << QColor(0xff00bfff) << s("S-train%20service%20A.svg") << s("S-tog.svg");
QTest::newRow("Cologne S11") << 50.94 << 6.97 << s("S11") << Line::RapidTransit << QColor(0xffef7c00) << QString() << s("S-Bahn-Logo.svg");
QTest::newRow("Stuttgart S1") << 48.78 << 9.18 << s("S1") << Line::RapidTransit << QColor(0xff5c8e3c) << QString() << s("S-Bahn-Logo.svg");
QTest::newRow("Barcelona L1") << 41.37 << 2.13 << s("L1") << Line::Metro << QColor(0xffe33638) << QString() << s("Barcelona%20Metro%20Logo.svg");
QTest::newRow("Toulouse Metro A") << 43.6 << 1.44 << s("A") << Line::Metro << QColor(0xffdb001b) << QString() << QString();
QTest::newRow("Cologne S11") << 50.94 << 6.97 << s("S11") << Line::RapidTransit << QColor(0xffef7c00) << s("NRW%20S11.svg") << s("S-Bahn-Logo.svg");
QTest::newRow("Stuttgart S1") << 48.78 << 9.18 << s("S1") << Line::RapidTransit << QColor(0xff5c8e3c) << s("S1%20S-Bahn%20Stuttgart%20Logo%20(2021).svg") << s("S-Bahn-Logo.svg");
QTest::newRow("Barcelona L1") << 41.37 << 2.13 << s("L1") << Line::Metro << QColor(0xffe33638) << s("L1%20barcelona.svg") << s("Barcelona%20Metro%20Logo.svg");
QTest::newRow("Toulouse Metro A") << 43.6 << 1.44 << s("A") << Line::Metro << QColor(0xffdb001b) << s("Toulouse%20line%20A%20symbol.svg") << s("Toulouse%20%22M%22%20symbol.svg");
QTest::newRow("San Francisco BART Yellow") << 37.77 << -122.41 << s("Yellow") << Line::Metro << QColor(0xffffe800) << QString() << s("Bart-logo.svg");
}
......@@ -78,7 +78,6 @@ private Q_SLOTS:
if (logo.isEmpty()) {
QCOMPARE(l.logoUrl(), QUrl());
} else {
QEXPECT_FAIL("Munich S3", "waiting for OSM update", Continue);
QCOMPARE(l.logoUrl().toString(QUrl::FullyEncoded), QString(QLatin1String("https://commons.wikimedia.org/wiki/Special:Redirect/file/") + logo));
}
......
......@@ -26,7 +26,7 @@
namespace wd = Wikidata;
enum {
MaxLogoFileSize = 10000, // bytes
MaxLogoFileSize = 25000, // bytes
QuadTreeDepthLimit = 16, // we don't want to use more than 32 bit
};
......@@ -482,6 +482,7 @@ void Generator::verifyImageMetaData(std::vector<wd::Image> &&images)
QStringLiteral("public domain"),
QStringLiteral("cc by 3.0"),
QStringLiteral("cc by-sa 3.0"),
QStringLiteral("cc by-sa 3.0 de"),
QStringLiteral("cc-by-sa-3.0"),
QStringLiteral("cc by-sa 4.0"),
});
......@@ -586,9 +587,9 @@ void Generator::generateQuadTree()
}
// insert subtiles, if they actually contain the line bbox
qDebug() << "subdividing" << lines[*lit].name << lines[*lit].bbox << lines[*lit].relId << std::distance(lit, lend) << (*lit) << (*tileIt).first.depth << (*tileIt).first.z;
//qDebug() << "subdividing" << lines[*lit].name << lines[*lit].bbox << lines[*lit].relId << std::distance(lit, lend) << (*lit) << (*tileIt).first.depth << (*tileIt).first.z;
for (auto it = lit; it != lend; ++it) {
qDebug() << " " << lines[*it];
//qDebug() << " " << lines[*it];
for (auto subtile : (*tileIt).first.quadSplit()) {
if (subtile.intersects(lines[*it].bbox)) {
insertToBucket(subtile, *it);
......@@ -622,7 +623,7 @@ void Generator::generateQuadTree()
(double)lines[*lineIt].bbox.height() / (double)(*tileIt).first.boundingBox().height());
if (coverage < MinTileCoverage || coveredSubTiles == 1) {
qDebug() << "splitting due to small coverage:" << lines[*lineIt] << (*tileIt).first.depth << coverage << coveredSubTiles;
//qDebug() << "splitting due to small coverage:" << lines[*lineIt] << (*tileIt).first.depth << coverage << coveredSubTiles;
for (auto subtile : (*tileIt).first.quadSplit()) {
if (subtile.intersects(lines[*lineIt].bbox)) {
insertToBucket(subtile, *lineIt);
......@@ -669,7 +670,7 @@ bool Generator::resolveOneBottomUpConflict()
return isSameLine(lines[lhs], lines[*lineIt]);
});
if (conflictIt != (*parentTileIt).second.end()) {
qDebug() << "propagating down:" << lines[*conflictIt].name << lines[*conflictIt].relId << parentTile.z << parentTile.depth << *conflictIt;
//qDebug() << "propagating down:" << lines[*conflictIt].name << lines[*conflictIt].relId << parentTile.z << parentTile.depth << *conflictIt;
auto splitTile = parentTile;
while (splitTile.depth > (*tileIt).first.depth) {
for (auto subtile : splitTile.quadSplit()) {
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment