This page describes how Samtrafiken maps Noptis data (see https://www.noptis.com/) to GTFS-realtime data. For a complete specification of the GTFS-realtime format, please see http://gtfs.org/reference/realtime/v1/.
Header
Feed metadata header.
Message: FeedHeader
GTFS- |
---|
RT | Value |
---|---|
header.gtfs_realtime_version |
|
header.incrementality |
|
header.timestamp | UTC time in seconds of file creation. Example: |
Alert
...
Message: FeedEntity
GTFS- |
---|
RT | NOPTIS |
---|---|
id |
DeviationMessageVersion.Id
alert.active_period.start
DeviationMessageVersion.PublishFromDateTime
alert.active_period.end
DeviationMessageVersion.PublishUpToDateTime
alert.header_text.translation.text
DeviationMessage.Content (UsageTypeShortName=HEADER)
ELSE
DeviationMessageVersion.PublicNote
alert.description_text.translation.text
DeviationMessage.Content (UsageTypeShortName=DETAILS)
ELSE
DeviationMessageVersion.PublicNote
alert.cause
UNKNOWN_CAUSE
OR
DeviationReasonStandardCategoryCode → alert.cause
MEDICAL →
MEDICAL_EMERGENCY
POLICEDECISION →
POLICE_ACTIVITY
ROADWORK →
CONSTRUCTION
MAINTENANCE →
MAINTENANCE
WEATHER →
WEATHER
ACCIDENT →
ACCIDENT
STRIKE →
STRIKE
VEHICLEBREAKDOWN, TECHNICALFAILURE →
TECHNICAL_PROBLEM
ELSE →
OTHER_CAUSE
alert.informed_entity.route_id
Line.Gid
alert.informed_entity.stop_id
StopPoint.Gid
OR
StopArea.Gid
alert.informed_entity.agency_id
TransportAuthority.Id
alert.informed_entity.trip.trip_id
VehicleJourney.Id
alert.informed_entity.trip.schedule_relationship
If a vehicle journey exists, then SCHEDULED
, else field is not included
Trip updates
...
If entity contains field trip_update, then:
If entity contains field vehicle, then:
If entity contains field alert, then:
| |
trip_update | See section “Message: TripUpdate”. |
vehicle | See section “Message: VehiclePosition”. |
alert | See section “Message: Alert”. |
Message: TripUpdate
File: TripUpdates.pb
When trip updates are generated, stop time updates with departure or arrival times that are considered too old are excluded. A departure/arrival is considered too old if the vehicle left the stop 10 minutes ago.
GTFS- |
---|
RT | NOPTIS |
---|
id
DatedVehicleJourney.Id
trip.trip_id |
VehicleJourney.Id |
If unplanned and route_id and direction_id is missing, then DatedVehicleJourney.Id
trip.route_id | Line.Gid |
trip.direction_id | DirectionOfLine.DirectionCode → direction_id
|
trip.start_time | DatedVehicleJourney.TimetabledStartDateTime |
trip |
. |
start_date | DatedVehicleJourney.TimetabledStartDateTime |
trip |
. |
schedule_relationship | If a DatedVehicleJourney.VehicleJourneyState exists and is canceled, then set to |
ELSE
. |
then set to |
. |
MonitoredVehicleJourney.IsAssignedToVehicleGid
stop_time_update.stop_id | StopPoint.Gid |
stop_time_update.stop_sequence | Departure.JourneyPatternSequenceNumber |
stop_time_update.arrival.delay | Based on predicted arrival time and |
scheduled arrival time |
stop_time_update.arrival.time | Arrival.ObservedDateTime or Arrival.TargetDateTime |
stop_time_update.arrival.uncertainty |
|
stop_time_update.arrival.schedule_relationship |
|
stop_time_update.departure.delay | Based on predicted departure time and |
scheduled departure time |
stop_time_update.departure.time | Departure.ObservedDateTime or Departure.TargetDateTime |
stop_time_update.departure.uncertainty |
|
stop_time_update.departure.schedule_relationship |
|
vehicle.id | MonitoredVehicleJourney.IsAssignedToVehicleGid |
timestamp | Departure.Timestamp The latest timestamp overall in the list of departures and arrivals in the current trip update |
...
Message VehiclePosition
...
File:
...
VehiclePositions.
...
pb
.
Entity Position in the below table refers to a POSROI message.
GTFS- |
---|
RT | NOPTIS | Comment |
---|
id
Position.Nr
trip.trip_id | VehicleJourney.Id | If a |
scheduled journey exists, then trip_id is used for identification, else route_id and direction_id is used. |
trip.route_id | Line.Gid |
trip.direction_id | DirectionOfLine.DirectionCode → direction_id
|
trip.start_time | DatedVehicleJourney.TimetabledStartDateTime | Is only included if a trip is |
unscheduled. |
trip.start_date | DatedVehicleJourney.TimetabledStartDateTime | Is only included if a trip is |
unscheduled. |
trip.schedule_relationship | If vehicle journey exists, then |
position.latitude | Position.Northing |
position.longitude | Position.Easting |
position.bearing | Position.Heading |
position.speed | Position.Speed | |
vehicle.id | Position.Vehicle | |
timestamp | Position.Timestamp |
vehicle.vehicle.id
occupancy_status | APCRDA.PassengerLoadReport.OnboardCount for current occupancy | Mapped to the OccupancyStatus enum as described below: |
Message Alert
File: ServiceAlerts.pb
.
GTFS-RT | NOPTIS |
---|---|
active_period.start | DeviationMessageVersion.PublishFromDateTime |
active_period.end | DeviationMessageVersion.PublishUpToDateTime |
header_text.translation.text | DeviationMessage.Content (UsageTypeShortName=HEADER) |
description_text.translation.text | DeviationMessage.Content (UsageTypeShortName=DETAILS) |
cause |
|
informed_entity.route_id | Line.Gid |
informed_entity.stop_id | StopPoint.Gid |
informed_entity.agency_id | TransportAuthority.Id |
informed_entity.trip.trip_id | VehicleJourney.Id |
informed_entity.trip.schedule_relationship | If a vehicle journey exists, then |