GTFS feed acceptance criteria

Important:  Optima handles GTFS input packets compliant with either GTFS 1.0 and 2.0. The output is compliant with GTFS 1.0, without any data losses with respect to GTFS 2.0.

GTFS real-time information can be correctly imported in Optima only if includes the entity elements:

Main GTFS feed characteristics

For more details, see GTFS-RT feed information.

The trip id must exist in the model, and must correctly match with the provided current_stop_sequence or stop_id.

If a record does not comply with the aforementioned rules, it is discarded.

GTFS real time feeds could also expose the line_id for each vehicle according to standard specifications. The line_id field is currently ignored, and there is no consistency check, so the record is accepted even if the specified line is not consistent with the trip.

If there is more than one record with the same trip_id in the feed, then the record with the most recent timestamp is picked, and the others are discarded.

If there is more than one record with the same vehicle_id, then the whole feed is discarded.

TripDescriptor

The GTFS feed may not contain the TripDescriptor.

Anyhow, Optima can import this data if at least the VehicleDescriptor exists.

Important:  For GTFS feeds without a tripId but with a set vehicle id, data are stored in the DB but ETA computation is not performed.

This information is mapped by Optima with the unique fields vehicleId and tripId.

Therefore, both the incoming feed and the DB records cannot have two entities with the same tripId or the same vehicleId : this affects the merging process in case of an incremental update (entities with same IDs cannot exist).

Example

An example of GTFS format:

header {
  gtfs_real time_version: "1.0"
  timestamp: 1464335631
}
entity {
  id: "1"
  vehicle {
    trip {
      trip_id: "915421"
      route_id: "371"
    }
    position {
      latitude: 43.869915
      longitude: -79.21608
    }
    current_stop_sequence: 33
    current_status: STOPPED_AT
    stop_id: "6165"
    vehicle {
      id: "M1502"
    }
    timestamp: 1464335631
  }
}