Trip Data Type

All OTP Transit entities should extend this class. The purpose of the class is to enforce a common implementation of the identity:

  1. id - All entities should have an id. The id should be unique within the context the entity live. For aggregates which live in a global space the id must be unique. This apply to all entities listed in the index service.
  2. The hashCode()/equals() method is consistent and based on the id (identity). We frequently use this to index and lookup entities.

Implemented Interfaces
Serializable
Properties
name data type constraints description
operator Operator   Operator running the trip. Returns operator of this trip, if it exist, or else the route operator.
tripOperator Operator   This method return the operator associated with the trip. If the Trip have no Operator set null is returned. Note! this method do not consider the Route that the trip is part of.
route Route  
serviceId FeedScopedId  
mode TransitMode  
netexSubmode string  
tripShortName string   Public code or identifier for the journey. Equal to NeTEx PublicCode. GTFS and NeTEx have additional constraints on this fields that are not enforced in OTP.
internalPlanningCode string   Internal code (non-public identifier) for the journey (e.g. train- or trip number from the planners' tool). This is kept to ensure compatibility with legacy planning systems. In NeTEx this maps to privateCode, there is no GTFS equivalent.
tripHeadsign string  
routeShortName string  
direction Direction required The direction for this Trip (and all other Trips in this TripPattern).
blockId string  
shapeId FeedScopedId  
wheelchairAccessible number required
bikesAllowed BikeAccess  
fareId string  
tripAlteration TripAlteration  
Properties inherited from TransitEntity
id FeedScopedId  

Example

{
  "operator" : {
    "name" : "...",
    "url" : "...",
    "phone" : "...",
    "id" : {
      "feedId" : "...",
      "id" : "..."
    }
  },
  "tripOperator" : {
    "name" : "...",
    "url" : "...",
    "phone" : "...",
    "id" : {
      "feedId" : "...",
      "id" : "..."
    }
  },
  "route" : {
    "branding" : {
      "shortName" : "...",
      "name" : "...",
      "url" : "...",
      "image" : "...",
      "description" : "...",
      "id" : { }
    },
    "agency" : {
      "name" : "...",
      "url" : "...",
      "timezone" : "...",
      "lang" : "...",
      "phone" : "...",
      "fareUrl" : "...",
      "brandingUrl" : "...",
      "id" : { }
    },
    "operator" : {
      "name" : "...",
      "url" : "...",
      "phone" : "...",
      "id" : { }
    },
    "shortName" : "...",
    "longName" : "...",
    "desc" : "...",
    "gtfsType" : 12345,
    "mode" : "GONDOLA",
    "url" : "...",
    "color" : "...",
    "textColor" : "...",
    "bikesAllowed" : "NOT_ALLOWED",
    "sortOrderSet" : true,
    "sortOrder" : 12345,
    "flexibleLineType" : "...",
    "name" : "...",
    "netexSubmode" : "...",
    "id" : {
      "feedId" : "...",
      "id" : "..."
    }
  },
  "serviceId" : {
    "feedId" : "...",
    "id" : "..."
  },
  "mode" : "SUBWAY",
  "netexSubmode" : "...",
  "tripShortName" : "...",
  "internalPlanningCode" : "...",
  "tripHeadsign" : "...",
  "routeShortName" : "...",
  "direction" : "OUTBOUND",
  "blockId" : "...",
  "shapeId" : {
    "feedId" : "...",
    "id" : "..."
  },
  "wheelchairAccessible" : 12345,
  "bikesAllowed" : "UNKNOWN",
  "fareId" : "...",
  "tripAlteration" : "EXTRA_JOURNEY",
  "id" : {
    "feedId" : "...",
    "id" : "..."
  }
}