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
7eab3af0
Commit
7eab3af0
authored
Jun 05, 2021
by
Volker Krause
Browse files
Adapt stopover GraphQL query for OTP2
Also, take the maximum result hint into account for this.
parent
8103acf9
Pipeline
#64322
passed with stage
in 25 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/backends/opentripplannergraphqlbackend.cpp
View file @
7eab3af0
...
...
@@ -111,6 +111,7 @@ bool OpenTripPlannerGraphQLBackend::queryStopover(const StopoverRequest &req, St
}
gqlReq
.
setVariable
(
QStringLiteral
(
"startTime"
),
dt
.
toSecsSinceEpoch
());
gqlReq
.
setVariable
(
QStringLiteral
(
"startDateTime"
),
dt
.
toString
(
Qt
::
ISODate
));
gqlReq
.
setVariable
(
QStringLiteral
(
"maxResults"
),
req
.
maximumResults
());
// TODO arrival/departure selection?
if
(
isLoggingEnabled
())
{
...
...
src/lib/backends/otp/otp.qrc
View file @
7eab3af0
...
...
@@ -18,6 +18,7 @@
<file>entur/stationByCoordinate.graphql</file>
<file>entur/stationByName.graphql</file>
<file>otp2/departure.graphql</file>
<file>otp2/journey.graphql</file>
<file>otp2/stationByCoordinate.graphql</file>
<file>otp2/stationByName.graphql</file>
...
...
src/lib/backends/otp/otp2/departure.graphql
0 → 100644
View file @
7eab3af0
# SPDX-FileCopyrightText: 2020-2021 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: CC0-1.0
query
departures
(
$lat
:
Float
!,
$lon
:
Float
!,
$startTime
:
Long
!,
$maxResults
:
Int
!
)
{
nearest
(
lat
:
$lat
,
lon
:
$lon
,
maxDistance
:
500
,
filterByPlaceTypes
:
DEPARTURE_ROW
)
{
edges
{
node
{
place
{
...
on
DepartureRow
{
stop
{
id
:
gtfsId
name
lat
lon
parentStation
{
id
:
gtfsId
name
lat
lon
}
}
stoptimes
(
startTime
:
$startTime
,
numberOfDepartures
:
$maxResults
,
omitCanceled
:
false
)
{
stop
{
platformCode
}
serviceDay
scheduledArrival
realtimeArrival
scheduledDeparture
realtimeDeparture
realtime
trip
{
tripHeadsign
route
{
type
desc
shortName
longName
color
textColor
#bikesAllowed
alerts
{
alertHeaderTextTranslations
{
language
text
}
alertDescriptionTextTranslations
{
language
text
}
alertEffect
alertCause
alertSeverityLevel
}
}
}
}
}
}
}
}
}
}
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