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
Libraries
KPublicTransport
Commits
5e408755
Commit
5e408755
authored
Oct 10, 2021
by
Volker Krause
Browse files
Remove Hafas polygon encoding parameters for queries not needing those
parent
49dfe300
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/backends/hafasmgatebackend.cpp
View file @
5e408755
...
...
@@ -190,9 +190,6 @@ bool HafasMgateBackend::queryStopover(const StopoverRequest &request, StopoverRe
QJsonObject
stationBoard
;
{
QJsonObject
cfg
;
cfg
.
insert
(
QStringLiteral
(
"polyEnc"
),
QLatin1String
(
"GPA"
));
QJsonObject
req
;
req
.
insert
(
QStringLiteral
(
"date"
),
dt
.
toString
(
QStringLiteral
(
"yyyyMMdd"
)));
if
(
ctx
.
duration
>
0
)
{
...
...
@@ -209,7 +206,6 @@ bool HafasMgateBackend::queryStopover(const StopoverRequest &request, StopoverRe
req
.
insert
(
QStringLiteral
(
"time"
),
dt
.
toString
(
QStringLiteral
(
"hhmmss"
)));
req
.
insert
(
QStringLiteral
(
"type"
),
request
.
mode
()
==
StopoverRequest
::
QueryDeparture
?
QLatin1String
(
"DEP"
)
:
QLatin1String
(
"ARR"
));
stationBoard
.
insert
(
QStringLiteral
(
"cfg"
),
cfg
);
stationBoard
.
insert
(
QStringLiteral
(
"meth"
),
QLatin1String
(
"StationBoard"
));
stationBoard
.
insert
(
QStringLiteral
(
"req"
),
req
);
}
...
...
@@ -256,9 +252,6 @@ bool HafasMgateBackend::queryLocation(const LocationRequest &req, LocationReply
QJsonObject
methodObj
;
if
(
req
.
hasCoordinate
())
{
QJsonObject
cfg
;
cfg
.
insert
(
QStringLiteral
(
"polyEnc"
),
QLatin1String
(
"GPA"
));
QJsonObject
coord
;
coord
.
insert
(
QStringLiteral
(
"x"
),
(
int
)(
req
.
longitude
()
*
1000000
));
coord
.
insert
(
QStringLiteral
(
"y"
),
(
int
)(
req
.
latitude
()
*
1000000
));
...
...
@@ -273,14 +266,10 @@ bool HafasMgateBackend::queryLocation(const LocationRequest &req, LocationReply
reqObj
.
insert
(
QStringLiteral
(
"getPOIs"
),
false
);
reqObj
.
insert
(
QStringLiteral
(
"maxLoc"
),
std
::
max
(
1
,
req
.
maximumResults
()));
methodObj
.
insert
(
QStringLiteral
(
"cfg"
),
cfg
);
methodObj
.
insert
(
QStringLiteral
(
"meth"
),
QLatin1String
(
"LocGeoPos"
));
methodObj
.
insert
(
QStringLiteral
(
"req"
),
reqObj
);
}
else
if
(
!
req
.
name
().
isEmpty
())
{
QJsonObject
cfg
;
cfg
.
insert
(
QStringLiteral
(
"polyEnc"
),
QLatin1String
(
"GPA"
));
QJsonObject
loc
;
loc
.
insert
(
QStringLiteral
(
"name"
),
req
.
name
());
// + '?' for auto completion search?
loc
.
insert
(
QStringLiteral
(
"type"
),
QLatin1String
(
"S"
));
// station: S, address: A, POI: P
...
...
@@ -293,7 +282,6 @@ bool HafasMgateBackend::queryLocation(const LocationRequest &req, LocationReply
QJsonObject
reqObj
;
reqObj
.
insert
(
QStringLiteral
(
"input"
),
input
);
methodObj
.
insert
(
QStringLiteral
(
"cfg"
),
cfg
);
methodObj
.
insert
(
QStringLiteral
(
"meth"
),
QLatin1String
(
"LocMatch"
));
methodObj
.
insert
(
QStringLiteral
(
"req"
),
reqObj
);
...
...
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