One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a particular vehicle (or on foot).
| name | data type | constraints | description |
|---|---|---|---|
| startTime | number | The date and time this leg begins. | |
| endTime | number | The date and time this leg ends. | |
| departureDelay | number | required | For transit leg, the offset from the scheduled departure-time of the boarding stop in this leg. "scheduled time of departure at boarding stop" = startTime - departureDelay |
| arrivalDelay | number | required | For transit leg, the offset from the scheduled arrival-time of the alighting stop in this leg. "scheduled time of arrival at alighting stop" = endTime - arrivalDelay |
| realTime | boolean | Whether there is real-time data about this Leg | |
| isNonExactFrequency | boolean | Is this a frequency-based trip with non-strict departure times? | |
| headway | number | The best estimate of the time between two arriving vehicles. This is particularly important for non-strict frequency trips, but could become important for real-time trips, strict frequency trips, and scheduled trips with empirical headways. | |
| distance | number | The distance traveled while traversing the leg in meters. | |
| pathway | boolean | Is this leg a traversing pathways? | |
| mode | string | The mode (e.g., Walk) used when traversing this leg.
|
|
| route | string | For transit legs, the route of the bus or train being used. For non-transit legs, the name of the street being traversed. | |
| agencyName | string | ||
| agencyUrl | string | ||
| agencyBrandingUrl | string | ||
| agencyTimeZoneOffset | number | required | |
| routeColor | string | For transit leg, the route's (background) color (if one exists). For non-transit legs, null. | |
| routeType | number | For transit legs, the type of the route. Non transit -1 When 0-7: 0 Tram, 1 Subway, 2 Train, 3 Bus, 4 Ferry, 5 Cable Car, 6 Gondola, 7 Funicular When equal or highter than 100, it is coded using the Hierarchical Vehicle Type (HVT) codes from the European TPEG standard Also see http://groups.google.com/group/gtfs-changes/msg/ed917a69cf8c5bef | |
| routeId | FeedScopedId | For transit legs, the ID of the route. For non-transit legs, null. | |
| routeTextColor | string | For transit leg, the route's text color (if one exists). For non-transit legs, null. | |
| interlineWithPreviousLeg | boolean | For transit legs, if the rider should stay on the vehicle as it changes route names. | |
| tripShortName | string | For transit leg, the trip's short name (if one exists). For non-transit legs, null. | |
| tripBlockId | string | For transit leg, the trip's block ID (if one exists). For non-transit legs, null. | |
| headsign | string | For transit legs, the headsign of the bus or train being used. For non-transit legs, null. | |
| agencyId | string | For transit legs, the ID of the transit agency that operates the service used for this leg. For non-transit legs, null. | |
| tripId | FeedScopedId | For transit legs, the ID of the trip. For non-transit legs, null. | |
| serviceDate | string | For transit legs, the service date of the trip. For non-transit legs, null. | |
| routeBrandingUrl | string | For transit leg, the route's branding URL (if one exists). For non-transit legs, null. | |
| from | Place | The Place where the leg originates. | |
| to | Place | The Place where the leg begins. | |
| intermediateStops | array of Place | For transit legs, intermediate stops between the Place where the leg originates and the Place where the leg ends. For non-transit legs, null. This field is optional i.e. it is always null unless "showIntermediateStops" parameter is set to "true" in the planner request. | |
| legGeometry | EncodedPolylineBean | The leg's geometry. | |
| interStopGeometry | array of EncodedPolylineBean | ||
| steps | array of WalkStep | A series of turn by turn instructions used for walking, biking and driving. | |
| alerts | array of LocalizedAlert | ||
| routeShortName | string | ||
| routeLongName | string | ||
| boardRule | string | ||
| alightRule | string | ||
| rentedBike | boolean | ||
| rentedCar | boolean | ||
| rentedVehicle | boolean | ||
| hailedCar | boolean | ||
| tncData | TransportationNetworkCompanySummary | ||
| callAndRide | boolean | True if this is a call-and-ride leg. | |
| flexCallAndRideMaxStartTime | number | ||
| flexCallAndRideMinEndTime | number | ||
| flexDrtAdvanceBookMin | number | required | trip.drt_advance_book_min if this is a demand-response leg |
| flexDrtPickupMessage | string | Agency message if this is leg has a demand-response pickup and the Trip has `drt_pickup_message` defined. | |
| flexDrtDropOffMessage | string | Agency message if this is leg has a demand-response dropoff and the Trip has `drt_drop_off_message` defined. | |
| flexFlagStopPickupMessage | string | Agency message if this is leg has a flag stop pickup and the Trip has `continuous_pickup_message` defined. | |
| flexFlagStopDropOffMessage | string | Agency message if this is leg has a flag stop dropoff and the Trip has `continuous_drop_off_message` defined. | |
| transitLeg | boolean | Whether this leg is a transit leg or not. | |
| duration | number | required | The leg's duration in seconds |
Example
{
"startTime" : 12345,
"endTime" : 12345,
"departureDelay" : 12345,
"arrivalDelay" : 12345,
"realTime" : true,
"isNonExactFrequency" : true,
"headway" : 12345,
"distance" : 12345.0,
"pathway" : true,
"mode" : "...",
"route" : "...",
"agencyName" : "...",
"agencyUrl" : "...",
"agencyBrandingUrl" : "...",
"agencyTimeZoneOffset" : 12345,
"routeColor" : "...",
"routeType" : 12345,
"routeId" : {
"agencyId" : "...",
"id" : "..."
},
"routeTextColor" : "...",
"interlineWithPreviousLeg" : true,
"tripShortName" : "...",
"tripBlockId" : "...",
"headsign" : "...",
"agencyId" : "...",
"tripId" : {
"agencyId" : "...",
"id" : "..."
},
"serviceDate" : "...",
"routeBrandingUrl" : "...",
"from" : {
"name" : "...",
"stopId" : {
"agencyId" : "...",
"id" : "..."
},
"stopCode" : "...",
"platformCode" : "...",
"lon" : 12345.0,
"lat" : 12345.0,
"arrival" : 12345,
"departure" : 12345,
"orig" : "...",
"zoneId" : "...",
"stopIndex" : 12345,
"stopSequence" : 12345,
"vertexType" : "BIKEPARK",
"bikeShareId" : "...",
"networks" : [ "...", "..." ],
"address" : "...",
"boardAlightType" : "DEFAULT",
"flagStopArea" : {
"points" : "...",
"levels" : "...",
"length" : 12345
}
},
"to" : {
"name" : "...",
"stopId" : {
"agencyId" : "...",
"id" : "..."
},
"stopCode" : "...",
"platformCode" : "...",
"lon" : 12345.0,
"lat" : 12345.0,
"arrival" : 12345,
"departure" : 12345,
"orig" : "...",
"zoneId" : "...",
"stopIndex" : 12345,
"stopSequence" : 12345,
"vertexType" : "NORMAL",
"bikeShareId" : "...",
"networks" : [ "...", "..." ],
"address" : "...",
"boardAlightType" : "DEVIATED",
"flagStopArea" : {
"points" : "...",
"levels" : "...",
"length" : 12345
}
},
"intermediateStops" : [ {
"name" : "...",
"stopId" : {
"agencyId" : "...",
"id" : "..."
},
"stopCode" : "...",
"platformCode" : "...",
"lon" : 12345.0,
"lat" : 12345.0,
"arrival" : 12345,
"departure" : 12345,
"orig" : "...",
"zoneId" : "...",
"stopIndex" : 12345,
"stopSequence" : 12345,
"vertexType" : "NORMAL",
"bikeShareId" : "...",
"networks" : [ "...", "..." ],
"address" : "...",
"boardAlightType" : "DEFAULT",
"flagStopArea" : {
"points" : "...",
"levels" : "...",
"length" : 12345
}
}, {
"name" : "...",
"stopId" : {
"agencyId" : "...",
"id" : "..."
},
"stopCode" : "...",
"platformCode" : "...",
"lon" : 12345.0,
"lat" : 12345.0,
"arrival" : 12345,
"departure" : 12345,
"orig" : "...",
"zoneId" : "...",
"stopIndex" : 12345,
"stopSequence" : 12345,
"vertexType" : "BIKEPARK",
"bikeShareId" : "...",
"networks" : [ "...", "..." ],
"address" : "...",
"boardAlightType" : "DEVIATED",
"flagStopArea" : {
"points" : "...",
"levels" : "...",
"length" : 12345
}
} ],
"legGeometry" : {
"points" : "...",
"levels" : "...",
"length" : 12345
},
"interStopGeometry" : [ {
"points" : "...",
"levels" : "...",
"length" : 12345
}, {
"points" : "...",
"levels" : "...",
"length" : 12345
} ],
"steps" : [ {
"distance" : 12345.0,
"relativeDirection" : "RIGHT",
"streetName" : "...",
"absoluteDirection" : "SOUTHWEST",
"exit" : "...",
"stayOn" : true,
"area" : true,
"bogusName" : true,
"lon" : 12345.0,
"lat" : 12345.0,
"elevation" : [ {
"first" : { },
"second" : { }
}, {
"first" : { },
"second" : { }
} ],
"alerts" : [ {
"alertHeaderText" : "...",
"alertDescriptionText" : "...",
"alertUrl" : "...",
"effectiveStartDate" : 12345
}, {
"alertHeaderText" : "...",
"alertDescriptionText" : "...",
"alertUrl" : "...",
"effectiveStartDate" : 12345
} ]
}, {
"distance" : 12345.0,
"relativeDirection" : "ELEVATOR",
"streetName" : "...",
"absoluteDirection" : "NORTH",
"exit" : "...",
"stayOn" : true,
"area" : true,
"bogusName" : true,
"lon" : 12345.0,
"lat" : 12345.0,
"elevation" : [ {
"first" : { },
"second" : { }
}, {
"first" : { },
"second" : { }
} ],
"alerts" : [ {
"alertHeaderText" : "...",
"alertDescriptionText" : "...",
"alertUrl" : "...",
"effectiveStartDate" : 12345
}, {
"alertHeaderText" : "...",
"alertDescriptionText" : "...",
"alertUrl" : "...",
"effectiveStartDate" : 12345
} ]
} ],
"alerts" : [ {
"alertHeaderText" : "...",
"alertDescriptionText" : "...",
"alertUrl" : "...",
"effectiveStartDate" : 12345
}, {
"alertHeaderText" : "...",
"alertDescriptionText" : "...",
"alertUrl" : "...",
"effectiveStartDate" : 12345
} ],
"routeShortName" : "...",
"routeLongName" : "...",
"boardRule" : "...",
"alightRule" : "...",
"rentedBike" : true,
"rentedCar" : true,
"rentedVehicle" : true,
"hailedCar" : true,
"tncData" : {
"company" : "UBER",
"currency" : "...",
"travelDuration" : 12345,
"maxCost" : 12345.0,
"minCost" : 12345.0,
"productId" : "...",
"displayName" : "...",
"estimatedArrival" : 12345
},
"callAndRide" : true,
"flexCallAndRideMaxStartTime" : 12345,
"flexCallAndRideMinEndTime" : 12345,
"flexDrtAdvanceBookMin" : 12345.0,
"flexDrtPickupMessage" : "...",
"flexDrtDropOffMessage" : "...",
"flexFlagStopPickupMessage" : "...",
"flexFlagStopDropOffMessage" : "...",
"transitLeg" : true,
"duration" : 12345.0
}