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
d51436b6
Commit
d51436b6
authored
Oct 05, 2021
by
Volker Krause
Browse files
Only request intermediate stops and paths from OTP2 when needed
parent
d3b59bd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/backends/opentripplannergraphqlbackend.cpp
View file @
d51436b6
...
...
@@ -162,6 +162,8 @@ bool OpenTripPlannerGraphQLBackend::queryJourney(const JourneyRequest &req, Jour
gqlReq
.
setVariable
(
QStringLiteral
(
"arriveBy"
),
req
.
dateTimeMode
()
==
JourneyRequest
::
Arrival
);
gqlReq
.
setVariable
(
QStringLiteral
(
"maxResults"
),
req
.
maximumResults
());
gqlReq
.
setVariable
(
QStringLiteral
(
"lang"
),
preferredLanguage
());
gqlReq
.
setVariable
(
QStringLiteral
(
"withIntermediateStops"
),
req
.
includeIntermediateStops
());
gqlReq
.
setVariable
(
QStringLiteral
(
"withPaths"
),
req
.
includePaths
());
// TODO set context.searchWindow?
QJsonArray
modes
;
...
...
src/lib/backends/otp/otp2/journey.graphql
View file @
d51436b6
...
...
@@ -11,7 +11,9 @@ query journeys(
$arriveBy
:
Boolean
!,
$modes
:
[
TransportMode
]!,
$maxResults
:
Int
!,
$lang
:
String
!
$lang
:
String
!,
$withPaths
:
Boolean
!,
$withIntermediateStops
:
Boolean
!
)
{
plan
(
from
:
{
lat
:
$fromLat
,
lon
:
$fromLon
}
...
...
@@ -89,7 +91,7 @@ query journeys(
tripHeadsign
tripShortName
}
intermediateStops
:
intermediatePlaces
{
intermediateStops
:
intermediatePlaces
@include
(
if
:
$withIntermediateStops
)
{
stop
{
id
:
gtfsId
name
...
...
@@ -100,7 +102,7 @@ query journeys(
scheduledArrivalTime
:
arrivalTime
scheduledDepartureTime
:
departureTime
}
legGeometry
{
legGeometry
@include
(
if
:
$withPaths
)
{
length
points
}
...
...
Write
Preview
Markdown
is supported
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