Commit e9c55413 authored by Volker Krause's avatar Volker Krause
Browse files

Filter out garbage address values

Seems to be a problem in some GBFS feeds.
parent 353f7e32
......@@ -21,6 +21,8 @@
#include <QJsonDocument>
#include <QJsonObject>
#include <functional>
using namespace KPublicTransport;
GBFSBackend::GBFSBackend() = default;
......@@ -85,6 +87,15 @@ static RentalVehicle::VehicleType gbfs2kptVehicleType(const GBFSVehicleType &veh
return RentalVehicle::Unknown;
// we get some address values just being " , "...
static QString cleanAddress(const QString &input)
if (std::any_of(input.begin(), input.end(), std::mem_fn(&QChar::isLetter))) {
return input;
return {};
static void appendResults(const GBFSService &service, const LocationRequest &req, QueryContext *context)
GBFSStore store(service.systemId);
......@@ -112,7 +123,7 @@ static void appendResults(const GBFSService &service, const LocationRequest &req
const auto stationId = stationIdToString(station.value(QLatin1String("station_id")));
loc.setIdentifier(service.systemId, stationId);
// TODO cover more properties
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