Skip to content

Instantly share code, notes, and snippets.

@ustroetz
Created February 1, 2016 14:50
Show Gist options
  • Select an option

  • Save ustroetz/917699e90a4009375fdb to your computer and use it in GitHub Desktop.

Select an option

Save ustroetz/917699e90a4009375fdb to your computer and use it in GitHub Desktop.
OTP response with Trip Update results
{
"requestParameters": {
"date": "02-01-2016",
"mode": "BUSISH,WALK",
"arriveBy": "true",
"wheelchair": "false",
"fromPlace": "stop SE Jackson & 21st (8225)::45.444827,-122.640491",
"toPlace": "stop SE Washington & 25th (6152)::45.442931,-122.636815",
"time": "6:09am",
"maxWalkDistance": "804.672",
"locale": "en",
"startTransitStopId": "TRIMET_8225"
},
"plan": {
"date": 1454335740000,
"from": {
"name": "SE Jackson & 21st",
"lon": -122.640491,
"lat": 45.444827,
"orig": "stop SE Jackson & 21st (8225)",
"vertexType": "NORMAL"
},
"to": {
"name": "SE Washington & 25th",
"lon": -122.636815,
"lat": 45.442931,
"orig": "stop SE Washington & 25th (6152)",
"vertexType": "NORMAL"
},
"itineraries": [
{
"duration": 725,
"startTime": 1454334988000,
"endTime": 1454335713000,
"walkTime": 324,
"transitTime": 155,
"waitingTime": 246,
"walkDistance": 421.73921174435196,
"walkLimitExceeded": false,
"elevationLost": 0,
"elevationGained": 0,
"transfers": 1,
"fare": {
"fare": {
"regular": {
"currency": {
"currency": "USD",
"defaultFractionDigits": 2,
"currencyCode": "USD",
"symbol": "$"
},
"cents": 250
}
}
},
"legs": [
{
"startTime": 1454334988000,
"endTime": 1454335036000,
"departureDelay": 0,
"arrivalDelay": 0,
"realTime": false,
"distance": 61.17788172914,
"pathway": false,
"mode": "WALK",
"route": "",
"agencyTimeZoneOffset": -28800000,
"interlineWithPreviousLeg": false,
"from": {
"name": "SE Jackson & 21st",
"lon": -122.640491,
"lat": 45.444827,
"departure": 1454334988000,
"orig": "stop SE Jackson & 21st (8225)",
"vertexType": "NORMAL"
},
"to": {
"name": "SE Jackson & Main St",
"stopId": "TRIMET:8223",
"stopCode": "8223",
"lon": -122.641269,
"lat": 45.444896,
"arrival": 1454335036000,
"departure": 1454335036000,
"zoneId": "B",
"stopIndex": 1,
"stopSequence": 2,
"vertexType": "TRANSIT"
},
"legGeometry": {
"points": "c}jtGbfpkVMxC",
"length": 2
},
"rentedBike": false,
"transitLeg": false,
"duration": 48,
"steps": [
{
"distance": 61.17788172914,
"relativeDirection": "DEPART",
"streetName": "SE Jackson & 21st => SE Jackson & Main St",
"absoluteDirection": "WEST",
"stayOn": false,
"area": false,
"bogusName": false,
"lon": -122.640491,
"lat": 45.444827,
"elevation": []
}
]
},
{
"startTime": 1454335036000,
"endTime": 1454335152000,
"departureDelay": 183,
"arrivalDelay": 183,
"realTime": true,
"distance": 718.6369820917989,
"pathway": false,
"mode": "BUS",
"route": "75",
"agencyName": "TriMet",
"agencyUrl": "http://trimet.org/",
"agencyTimeZoneOffset": -28800000,
"routeType": 3,
"routeId": "75",
"interlineWithPreviousLeg": false,
"tripBlockId": "7508",
"headsign": "St. Johns",
"agencyId": "TRIMET",
"tripId": "6217603",
"serviceDate": "20160201",
"from": {
"name": "SE Jackson & Main St",
"stopId": "TRIMET:8223",
"stopCode": "8223",
"lon": -122.641269,
"lat": 45.444896,
"arrival": 1454335036000,
"departure": 1454335036000,
"zoneId": "B",
"stopIndex": 1,
"stopSequence": 2,
"vertexType": "TRANSIT"
},
"to": {
"name": "SE Harrison & Hwy 224",
"stopId": "TRIMET:2568",
"stopCode": "2568",
"lon": -122.632656,
"lat": 45.446459,
"arrival": 1454335152000,
"departure": 1454335152000,
"zoneId": "B",
"stopIndex": 4,
"stopSequence": 5,
"vertexType": "TRANSIT"
},
"legGeometry": {
"points": "_}jtGzjpkVBj@SBmBZQBC[SkDAS?UKwAAMAEAGCGCECECEECCCGECCEAMEWGCACAC?CCECACEECEAGCGAEAE?EAE?E?GAg@AsB?m@As@A}A?I?OCoDEwG?KAe@?_AAaBAcBC}C",
"length": 55
},
"routeShortName": "75",
"routeLongName": "Cesar Chavez/Lombard",
"rentedBike": false,
"transitLeg": true,
"duration": 116,
"steps": []
},
{
"startTime": 1454335152000,
"endTime": 1454335397000,
"departureDelay": 0,
"arrivalDelay": 0,
"realTime": false,
"distance": 322.94664412197056,
"pathway": false,
"mode": "WALK",
"route": "",
"agencyTimeZoneOffset": -28800000,
"interlineWithPreviousLeg": false,
"from": {
"name": "SE Harrison & Hwy 224",
"stopId": "TRIMET:2568",
"stopCode": "2568",
"lon": -122.632656,
"lat": 45.446459,
"arrival": 1454335152000,
"departure": 1454335152000,
"zoneId": "B",
"stopIndex": 4,
"stopSequence": 5,
"vertexType": "TRANSIT"
},
"to": {
"name": "SE Washington & 29th",
"stopId": "TRIMET:6157",
"stopCode": "6157",
"lon": -122.632781,
"lat": 45.443556,
"arrival": 1454335397000,
"departure": 1454335643000,
"zoneId": "B",
"stopIndex": 41,
"stopSequence": 42,
"vertexType": "TRANSIT"
},
"legGeometry": {
"points": "igktGbunkVbQX",
"length": 2
},
"rentedBike": false,
"transitLeg": false,
"duration": 245,
"steps": [
{
"distance": 322.94664412197056,
"relativeDirection": "DEPART",
"streetName": "SE Harrison & Hwy 224 => SE Washington & 29th",
"absoluteDirection": "SOUTH",
"stayOn": false,
"area": false,
"bogusName": false,
"lon": -122.632656,
"lat": 45.446459,
"elevation": []
}
]
},
{
"startTime": 1454335643000,
"endTime": 1454335682000,
"departureDelay": 0,
"arrivalDelay": 0,
"realTime": false,
"distance": 286.7410583005023,
"pathway": false,
"mode": "BUS",
"route": "29",
"agencyName": "TriMet",
"agencyUrl": "http://trimet.org/",
"agencyTimeZoneOffset": -28800000,
"routeType": 3,
"routeId": "29",
"interlineWithPreviousLeg": false,
"tripBlockId": "2935",
"headsign": "Milwaukie",
"agencyId": "TRIMET",
"tripId": "6213570",
"serviceDate": "20160201",
"from": {
"name": "SE Washington & 29th",
"stopId": "TRIMET:6157",
"stopCode": "6157",
"lon": -122.632781,
"lat": 45.443556,
"arrival": 1454335397000,
"departure": 1454335643000,
"zoneId": "B",
"stopIndex": 41,
"stopSequence": 42,
"vertexType": "TRANSIT"
},
"to": {
"name": "SE Washington & 25th",
"stopId": "TRIMET:6153",
"stopCode": "6153",
"lon": -122.636399,
"lat": 45.443102,
"arrival": 1454335682000,
"departure": 1454335682000,
"zoneId": "B",
"stopIndex": 42,
"stopSequence": 43,
"vertexType": "TRANSIT"
},
"legGeometry": {
"points": "{tjtGzunkV@VV|Dd@bHXvE",
"length": 5
},
"routeShortName": "29",
"routeLongName": "Lake/Webster Rd",
"rentedBike": false,
"transitLeg": true,
"duration": 39,
"steps": []
},
{
"startTime": 1454335682000,
"endTime": 1454335713000,
"departureDelay": 0,
"arrivalDelay": 0,
"realTime": false,
"distance": 37.61468589324143,
"pathway": false,
"mode": "WALK",
"route": "",
"agencyTimeZoneOffset": -28800000,
"interlineWithPreviousLeg": false,
"from": {
"name": "SE Washington & 25th",
"stopId": "TRIMET:6153",
"stopCode": "6153",
"lon": -122.636399,
"lat": 45.443102,
"arrival": 1454335682000,
"departure": 1454335682000,
"zoneId": "B",
"stopIndex": 42,
"stopSequence": 43,
"vertexType": "TRANSIT"
},
"to": {
"name": "SE Washington & 25th",
"lon": -122.636815,
"lat": 45.442931,
"arrival": 1454335713000,
"orig": "stop SE Washington & 25th (6152)",
"vertexType": "NORMAL"
},
"legGeometry": {
"points": "krjtGnlokV`@rA",
"length": 2
},
"rentedBike": false,
"transitLeg": false,
"duration": 31,
"steps": [
{
"distance": 37.61468589324143,
"relativeDirection": "DEPART",
"streetName": "SE Washington & 25th => SE Washington & 25th",
"absoluteDirection": "SOUTHWEST",
"stayOn": false,
"area": false,
"bogusName": false,
"lon": -122.636399,
"lat": 45.443102,
"elevation": []
}
]
}
],
"tooSloped": false
}
]
},
"debugOutput": {
"precalculationTime": 3,
"pathCalculationTime": 4,
"pathTimes": [
4
],
"renderingTime": 3,
"totalTime": 10,
"timedOut": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment