Commit 5281509d authored by Volker Krause's avatar Volker Krause
Browse files

Clean OTP stops URL

This fixes access via a SOCKS proxy, ie. when tunneling out of the
limited Wifi here.
parent c6d090f4
Pipeline #84160 passed with stage
in 1 minute and 11 seconds
......@@ -85,7 +85,7 @@ void OtpProbeJob::bboxFetchDone(QNetworkReply *reply)
// TODO: more elaborate outlier detection, null points is just one of the problems
m_boundingPolygon.erase(std::remove_if(m_boundingPolygon.begin(), m_boundingPolygon.end(), [](auto p) { return p.isNull(); }), m_boundingPolygon.end());
auto req = QNetworkRequest(QUrl(m_endpointUrl.toString() + QLatin1String("/index/stops")));
auto req = QNetworkRequest(QUrl(m_endpointUrl.toString() + QLatin1String("index/stops")));
applySslConfig(req);
auto stopReply = m_nam->get(req);
connect(stopReply, &QNetworkReply::finished, this, [stopReply, this]() { stopsFetchDone(stopReply); });
......@@ -146,6 +146,7 @@ void OtpProbeJob::stopsFetchDone(QNetworkReply *reply)
double latMin, latMax, lonMin, lonMax;
filterOutliers(lats, latMin, latMax);
filterOutliers(lons, lonMin, lonMax);
// TODO even better would be computing the concave hull of all points after outlier filtering
QRectF box(QPointF(lonMin, latMin), QPointF(lonMax, latMax));
m_boundingPolygon = m_boundingPolygon.intersected(box);
} else {
......
Markdown is supported
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