Save the XML/JSON response from the OTP server

60 views
Skip to first unread message

Mike Goh

unread,
May 16, 2022, 10:47:30 AM5/16/22
to OpenTripPlanner Developers
Hi, 

I am very new to coding and OTP. I follow the Basic Tutorial Documentation of OTP to set up the Server and I am able to interact with the Javascript client application through http://localhost:8080/ in my web browser. 

However, I wish to export the itineraries of given trip options in JSON (shown below) in order to perform scoring method for the itineraries. I do not know where to get the relevant information or documentation to solve my issue. 

Best regards, 
Mike Goh

Screenshot 2022-05-16 at 10.41.22 PM.png

{"requestParameters":{"date":"04-16-2021","mode":"WALK,TRANSIT","arriveBy":"false","walkReluctance":"4.0","walkSpeed":"1.12","showIntermediateStops":"true","fromPlace":"1.55008,103.75911","toPlace":"1.4958099,103.7431716","time":"03:05PM","numItineraries":"5","bikeSpeed":"3.2"},"plan":{"date":1618556700000,"from":{"name":"Origin","lon":103.75911,"lat":1.55008,"vertexType":"NORMAL"},"to":{"name":"Destination","lon":103.7431716,"lat":1.4958099,"vertexType":"NORMAL"},"itineraries":[{"duration":16375,"startTime":1618556700000,"endTime":1618573075000,"walkTime":16375,"transitTime":0,"waitingTime":0,"walkDistance":17898.101000000002,"walkLimitExceeded":false,"elevationLost":0.0,"elevationGained":0.0,"transfers":0,"fare":{"fare":{},"details":{}},"legs":[{"startTime":1618556700000,"endTime":1618573075000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":17898.101000000002,"pathway":false,"mode":"WALK","transitLeg":false,"route":"","agencyTimeZoneOffset":28800000,"interlineWithPreviousLeg":false,"from":{"name":"Origin","lon":103.75911,"lat":1.55008,"departure":1618556700000,"vertexType":"NORMAL"},"to":{"name":"Destination","lon":103.7431716,"lat":1.4958099,"arrival":1618573075000,"vertexType":"NORMAL"},"legGeometry":{"points":"gwmHimhxRN`A{@Dw@Bu@@u@@aABy@D{@?u@Bu@?eJT?TmBDAX@^?`F@vC@fG?tB@`A?f@?J?z@@pB?v@?J@H@|D?VARqAM_FDOHKHINCLF~K?D?HLzMHvK?f@?L?N@z@@jD?TANEXBrF?ZEZOj@[p@Wh@_@h@SNi@\\q@^cAf@oAb@gAXSLi@LgB^mB`@sBn@cAZkAd@o@\\OHwBhAc@ZkDhC]Zc@d@gBnBMR{@jAW^_@l@U`@[j@Sd@CAC@EDIHGLKP_@~@m@vBUlACTs@pBo@lBmAzB]h@c@h@k@\\k@TaJtBwB`@yEh@eEH_BBcAMqEu@eCUgD?q@@OPu@@cKAa@FgCAMFKPDpI?tC?VAlC?NFXFRlDpF`CrDJN~AbCLTFXHh@VvBn@rEDH@BD@BBB?L@p@U\\ITEXCh@EX?\\B\\F`@RXPVT\\h@TZh@p@bCtCr@n@b@`@XR^Pn@XrDfAjA`@hBh@d@Nh@PpGlB`HpBLDhJlClKzC|GnBdBh@lCv@`GdBjA^hCp@rA^xBj@pBj@dA\\n@PFBz@TPFp@PhAZ\\J~EzALBl@Pl@LTFlD~@dD`AtBj@XHzAb@rE`BdCnApBtAvAtAhBxBf@x@VVLHNJLDJBJAPCjNkKbAu@VQnA}@x@i@ROLGPMp@]jAs@|@m@nAcA\\OZQbBkAvCsBrB}AzDsCzEmDv@k@zB_BrByAbAq@p@g@XQd@Yn@k@`As@d@]jBsAxAeAHGfBiAp@g@`BoAp@e@`Aq@r@i@~@q@b@]`@Y~AmArA}@\\UnDiC~@o@hDeCn@a@j@c@lBoAPM`Ak@d@[v@g@NI`@UPKj@_@VOn@a@pBkADCFCDCHGZQPKFEJGb@YZQb@WLIVUrDyBJIlAu@b@Wh@[LIbCqA`@UxAaAVQzDqCr@c@h@]pB{AJGnA}@\\[RMHElCeBb@Yr@c@r@a@fAs@`Am@vBqAlAu@zAmANIp@e@dAq@ZUVSPM`@[JId@a@bAm@XKh@Mn@[`@a@n@q@h@aA`@_AVu@Ps@PqAFq@BiBKuAMaAIYnBk@xC_AfBm@~@[hAcAz@q@VShA_Ad@_@VUlB{Ad@]v@q@XUDEPMXSn@m@HGTSLKZ[v@q@`@[n@i@n@e@ZWPMp@g@JIt@k@f@`@`AlArB_BDA@@B@B@PRp@ZlCpAl@SzAo@Vc@jDoBlAq@HBJGj@[JCRBNLFFHHBtCTCXGJCZENGLCLCNCJALAN?DADD?B","length":407},"steps":[{"distance":131.87800000000001,"relativeDirection":"DEPART","streetName":"road","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.75909983451389,"lat":1.5501236334318043,"elevation":""},{"distance":392.581,"relativeDirection":"CONTINUE","streetName":"Jalan Pinang 18","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.7587075,"lat":1.5508915,"elevation":""},{"distance":12.214,"relativeDirection":"LEFT","streetName":"road","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":true,"lon":103.758519,"lat":1.5544165,"elevation":""},{"distance":61.595,"relativeDirection":"RIGHT","streetName":"Jalan Daya","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.7584092,"lat":1.5544121000000002,"elevation":""},{"distance":243.00400000000002,"relativeDirection":"LEFT","streetName":"Jalan Nibong","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.75837870000001,"lat":1.5549652,"elevation":""},{"distance":547.6339999999999,"relativeDirection":"CONTINUE","streetName":"Jalan Nibong 16","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7561927,"lat":1.5549537,"elevation":""},{"distance":171.235,"relativeDirection":"RIGHT","streetName":"Jalan Adda 1","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.75126630000001,"lat":1.5549103000000002,"elevation":""},{"distance":1479.2150000000001,"relativeDirection":"SLIGHTLY_LEFT","streetName":"link","absoluteDirection":"NORTHWEST","stayOn":false,"area":false,"bogusName":true,"lon":103.75130770000001,"lat":1.5564452000000002,"elevation":""},{"distance":907.4320000000001,"relativeDirection":"CONTINUE","streetName":"Jalan Dato Onn 3","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.7392839,"lat":1.5587878000000002,"elevation":""},{"distance":38.285,"relativeDirection":"SLIGHTLY_RIGHT","streetName":"link","absoluteDirection":"NORTHWEST","stayOn":false,"area":false,"bogusName":true,"lon":103.7345786,"lat":1.5651739,"elevation":""},{"distance":168.64,"relativeDirection":"CONTINUE","streetName":"Jalan Dato Onn 3","absoluteDirection":"NORTHWEST","stayOn":false,"area":false,"bogusName":false,"lon":103.73433010000001,"lat":1.5653933,"elevation":""},{"distance":1253.9279999999999,"relativeDirection":"CONTINUE","streetName":"road","absoluteDirection":"NORTHWEST","stayOn":false,"area":false,"bogusName":true,"lon":103.7329117,"lat":1.5659173000000002,"elevation":""},{"distance":13.035,"relativeDirection":"LEFT","streetName":"Persiaran Dato' Onn","absoluteDirection":"NORTHWEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7298937,"lat":1.5756590000000001,"elevation":""},{"distance":246.367,"relativeDirection":"RIGHT","streetName":"Persiaran Dato' Onn","absoluteDirection":"NORTH","stayOn":true,"area":false,"bogusName":false,"lon":103.72980290000001,"lat":1.5757332000000002,"elevation":""},{"distance":1147.9189999999999,"relativeDirection":"CONTINUE","streetName":"link","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":true,"lon":103.7298069,"lat":1.5779488000000002,"elevation":""},{"distance":25.885,"relativeDirection":"SLIGHTLY_LEFT","streetName":"link","absoluteDirection":"SOUTHWEST","stayOn":false,"area":false,"bogusName":true,"lon":103.72110740000001,"lat":1.5762477000000001,"elevation":""},{"distance":204.525,"relativeDirection":"SLIGHTLY_LEFT","streetName":"Jalan Seelong","absoluteDirection":"SOUTHEAST","stayOn":false,"area":false,"bogusName":false,"lon":103.7209933,"lat":1.5760632,"elevation":""},{"distance":2811.662,"relativeDirection":"CONTINUE","streetName":"Jalan Kampung Maju Jaya","absoluteDirection":"SOUTHWEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7208753,"lat":1.5743696,"elevation":""},{"distance":634.173,"relativeDirection":"CONTINUE","streetName":"Jalan Kempas Lama","absoluteDirection":"SOUTH","stayOn":false,"area":false,"bogusName":false,"lon":103.7106444,"lat":1.5515077000000002,"elevation":""},{"distance":71.836,"relativeDirection":"CONTINUE","streetName":"link","absoluteDirection":"SOUTHWEST","stayOn":false,"area":false,"bogusName":true,"lon":103.7075415,"lat":1.5468565,"elevation":""},{"distance":4591.347000000001,"relativeDirection":"SLIGHTLY_LEFT","streetName":"Kempas Highway","absoluteDirection":"SOUTHEAST","exit":"5","stayOn":false,"area":false,"bogusName":false,"lon":103.707293,"lat":1.5463042,"elevation":""},{"distance":356.935,"relativeDirection":"CONTINUE","streetName":"link","absoluteDirection":"SOUTHEAST","stayOn":false,"area":false,"bogusName":true,"lon":103.7320164,"lat":1.5132624000000001,"elevation":""},{"distance":478.86100000000005,"relativeDirection":"CONTINUE","streetName":"Jalan Petaling","absoluteDirection":"SOUTHEAST","stayOn":false,"area":false,"bogusName":false,"lon":103.7338972,"lat":1.5106795000000002,"elevation":""},{"distance":1025.5089999999998,"relativeDirection":"RIGHT","streetName":"Jalan Langkasuka","absoluteDirection":"SOUTH","stayOn":false,"area":false,"bogusName":false,"lon":103.73771810000001,"lat":1.5094617000000001,"elevation":""},{"distance":85.63300000000001,"relativeDirection":"RIGHT","streetName":"Jalan Cenderawasih","absoluteDirection":"SOUTHWEST","stayOn":false,"area":false,"bogusName":false,"lon":103.74309570000001,"lat":1.5020735,"elevation":""},{"distance":87.049,"relativeDirection":"LEFT","streetName":"Jalan Kedidi","absoluteDirection":"SOUTHEAST","stayOn":false,"area":false,"bogusName":false,"lon":103.74253630000001,"lat":1.5015473000000001,"elevation":""},{"distance":144.34,"relativeDirection":"RIGHT","streetName":"Jalan Murai","absoluteDirection":"SOUTHWEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7430231,"lat":1.5009391,"elevation":""},{"distance":336.707,"relativeDirection":"LEFT","streetName":"Jalan Murai Gajah","absoluteDirection":"SOUTHEAST","stayOn":false,"area":false,"bogusName":false,"lon":103.74234320000001,"lat":1.4998388,"elevation":""},{"distance":26.231,"relativeDirection":"SLIGHTLY_RIGHT","streetName":"link","absoluteDirection":"SOUTHWEST","stayOn":false,"area":false,"bogusName":true,"lon":103.74383850000001,"lat":1.4972836,"elevation":""},{"distance":82.869,"relativeDirection":"RIGHT","streetName":"Jalan Garuda","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7436727,"lat":1.4971168000000001,"elevation":""},{"distance":119.57700000000001,"relativeDirection":"LEFT","streetName":"service road","absoluteDirection":"SOUTH","stayOn":false,"area":false,"bogusName":true,"lon":103.74292750000001,"lat":1.4970951000000001,"elevation":""}],"rentedBike":false,"duration":16375.0}],"tooSloped":false},{"duration":2773,"startTime":1618557350000,"endTime":1618560123000,"walkTime":553,"transitTime":1980,"waitingTime":240,"walkDistance":573.679,"walkLimitExceeded":false,"elevationLost":0.0,"elevationGained":0.0,"transfers":1,"legs":[{"startTime":1618557350000,"endTime":1618557540000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":193.921,"pathway":false,"mode":"WALK","transitLeg":false,"route":"","agencyTimeZoneOffset":28800000,"interlineWithPreviousLeg":false,"from":{"name":"Origin","lon":103.75911,"lat":1.55008,"departure":1618557350000,"vertexType":"NORMAL"},"to":{"name":"Jalan Daya 05","stopId":"1:80003001","stopCode":"03001","platformCode":"03001","lon":103.75864,"lat":1.55014,"arrival":1618557540000,"departure":1618557540000,"zoneId":"80003001","stopIndex":4,"vertexType":"TRANSIT"},"legGeometry":{"points":"gwmHimhxRN`At@Iv@MFZmBTY@AC","length":8},"steps":[{"distance":100.828,"relativeDirection":"DEPART","streetName":"road","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.75909983451389,"lat":1.5501236334318043,"elevation":""},{"distance":15.993,"relativeDirection":"RIGHT","streetName":"Jalan Pinang 5","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7588843,"lat":1.5494908,"elevation":""},{"distance":77.1,"relativeDirection":"RIGHT","streetName":"Jalan Daya","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.75874440000001,"lat":1.5494572000000002,"elevation":""},{"distance":0.0,"relativeDirection":"RIGHT","streetName":"Jalan Daya 05","absoluteDirection":"EAST","stayOn":false,"area":false,"bogusName":false,"lon":103.75862791756558,"lat":1.550139453813671,"elevation":""}],"rentedBike":false,"duration":190.0},{"startTime":1618557540000,"endTime":1618558440000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":6102.311527639644,"pathway":false,"mode":"BUS","transitLeg":true,"route":"Taman Setia Indah - JB Sentral","agencyName":"CWL","agencyUrl":"http://www.causewaylink.com.my","agencyTimeZoneOffset":0,"routeId":"1:10BCWL","headsign":"Taman Setia Indah - JB Sentral","agencyId":"1:CWL","tripId":"1:0002_10BCWL_7132_0_P3_ALLDAY_1_2","serviceDate":"2021-04-16","from":{"name":"Jalan Daya 05","stopId":"1:80003001","stopCode":"03001","platformCode":"03001","lon":103.75864,"lat":1.55014,"arrival":1618557540000,"departure":1618557540000,"zoneId":"80003001","stopIndex":4,"vertexType":"TRANSIT"},"to":{"name":"OPP Petron Pandan","stopId":"1:80003015","stopCode":"03015","platformCode":"03015","lon":103.77133,"lat":1.52486,"arrival":1618558440000,"departure":1618558680000,"zoneId":"80003015","stopIndex":13,"vertexType":"TRANSIT"},"intermediateStops":[{"name":"7E Taman Daya","stopId":"1:80003002","stopCode":"03002","platformCode":"03002","lon":103.76244,"lat":1.54504,"arrival":1618557600000,"departure":1618557600000,"zoneId":"80003002","stopIndex":5,"vertexType":"TRANSIT"},{"name":"Jalan Bertam 9","stopId":"1:80003003","stopCode":"03003","platformCode":"03003","lon":103.76317,"lat":1.53845,"arrival":1618557660000,"departure":1618557660000,"zoneId":"80003003","stopIndex":6,"vertexType":"TRANSIT"},{"name":"Taman Delima","stopId":"1:80003004","stopCode":"03004","platformCode":"03004","lon":103.76285,"lat":1.53661,"arrival":1618557720000,"departure":1618557720000,"zoneId":"80003004","stopIndex":7,"vertexType":"TRANSIT"},{"name":"Universal Cable","stopId":"1:80003007","stopCode":"03007","platformCode":"03007","lon":103.75965,"lat":1.53558,"arrival":1618557900000,"departure":1618557900000,"zoneId":"80003007","stopIndex":8,"vertexType":"TRANSIT"},{"name":"Masjid Kangkar Tebrau","stopId":"1:80003005","stopCode":"03005","platformCode":"03005","lon":103.75558,"lat":1.53368,"arrival":1618557960000,"departure":1618557960000,"zoneId":"80003005","stopIndex":9,"vertexType":"TRANSIT"},{"name":"U turn Kangkar tebrau","stopId":"1:80003006","stopCode":"03006","platformCode":"03006","lon":103.752449,"lat":1.531436,"arrival":1618558020000,"departure":1618558020000,"zoneId":"80003006","stopIndex":10,"vertexType":"TRANSIT"},{"name":"Poliklinik Penawar Kangkar Tebrau","stopId":"1:80003082","stopCode":"03082","platformCode":"03082","lon":103.76824,"lat":1.52958,"arrival":1618558080000,"departure":1618558080000,"zoneId":"80003082","stopIndex":11,"vertexType":"TRANSIT"},{"name":"Shell Pandan","stopId":"1:80003016","stopCode":"03016","platformCode":"03016","lon":103.77553,"lat":1.52682,"arrival":1618558320000,"departure":1618558320000,"zoneId":"80003016","stopIndex":12,"vertexType":"TRANSIT"}],"legGeometry":{"points":"kwmHojhxRz^wV??dh@qC??nJ~@??lE~R??zJlX??`MrR??pJwaB??fPql@??fKfY","length":18},"steps":[],"routeShortName":"10B","routeLongName":"Taman Setia Indah - JB Sentral","duration":900.0},{"startTime":1618558680000,"endTime":1618559760000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":6654.430660006647,"pathway":false,"mode":"BUS","transitLeg":true,"route":"Terminal Kota Tinggi - Larkin Sentral","agencyName":"CWL","agencyUrl":"http://www.causewaylink.com.my","agencyTimeZoneOffset":0,"routeId":"1:66CWL","headsign":"Terminal Kota Tinggi - Larkin Sentral","agencyId":"1:CWL","tripId":"1:0002_66CWL_7120_1_SM 6_ALLDAY_2_3","serviceDate":"2021-04-16","from":{"name":"OPP Petron Pandan","stopId":"1:80003015","stopCode":"03015","platformCode":"03015","lon":103.77133,"lat":1.52486,"arrival":1618558440000,"departure":1618558680000,"zoneId":"80003015","stopIndex":24,"vertexType":"TRANSIT"},"to":{"name":"Larkin Ter","stopId":"1:68300798","stopCode":"46239","platformCode":"46239","lon":103.74221,"lat":1.49524,"arrival":1618559760000,"departure":1618559760000,"zoneId":"68300798","stopIndex":34,"vertexType":"TRANSIT"},"intermediateStops":[{"name":"OPP Pasar Borong Pandan","stopId":"1:80003014","stopCode":"03014","platformCode":"03014","lon":103.7658,"lat":1.52257,"arrival":1618558740000,"departure":1618558740000,"zoneId":"80003014","stopIndex":25,"vertexType":"TRANSIT"},{"name":"Kampung Ubi","stopId":"1:80007782","stopCode":"07782","platformCode":"07782","lon":103.75546,"lat":1.51829,"arrival":1618558860000,"departure":1618558860000,"zoneId":"80007782","stopIndex":26,"vertexType":"TRANSIT"},{"name":"Kg Melayu","stopId":"1:80007783","stopCode":"07783","platformCode":"07783","lon":103.75312,"lat":1.5185,"arrival":1618558980000,"departure":1618558980000,"zoneId":"80007783","stopIndex":27,"vertexType":"TRANSIT"},{"name":"Opp Taman Gembira","stopId":"1:80007787","stopCode":"07787","platformCode":"07787","lon":103.74456,"lat":1.51802,"arrival":1618559040000,"departure":1618559040000,"zoneId":"80007787","stopIndex":28,"vertexType":"TRANSIT"},{"name":"Ungku Mohsin","stopId":"1:80005498","stopCode":"05498","platformCode":"05498","lon":103.73727,"lat":1.51457,"arrival":1618559160000,"departure":1618559160000,"zoneId":"80005498","stopIndex":29,"vertexType":"TRANSIT"},{"name":"Pej Fama","stopId":"1:80003115","stopCode":"03115","platformCode":"03115","lon":103.73377,"lat":1.50618,"arrival":1618559280000,"departure":1618559280000,"zoneId":"80003115","stopIndex":30,"vertexType":"TRANSIT"},{"name":"OPP Kondo Datin Halimah","stopId":"1:80008192","stopCode":"08192","platformCode":"08192","lon":103.73447,"lat":1.50409,"arrival":1618559400000,"departure":1618559400000,"zoneId":"80008192","stopIndex":31,"vertexType":"TRANSIT"},{"name":"SMT Ert Azizah","stopId":"1:80003116","stopCode":"03116","platformCode":"03116","lon":103.73547,"lat":1.50183,"arrival":1618559520000,"departure":1618559520000,"zoneId":"80003116","stopIndex":32,"vertexType":"TRANSIT"},{"name":"Opp Apartment Larkin Indah","stopId":"1:80003118","stopCode":"03118","platformCode":"03118","lon":103.73717,"lat":1.49802,"arrival":1618559640000,"departure":1618559640000,"zoneId":"80003118","stopIndex":33,"vertexType":"TRANSIT"}],"legGeometry":{"points":"kyhHyyjxRhMpa@??vYr_A??i@rM??~Ant@??pTpl@??ls@zT??`LkC??bMgE??xVsI??jPo^","length":20},"steps":[],"routeShortName":"66","routeLongName":"Terminal Kota Tinggi - Larkin Sentral","duration":1080.0},{"startTime":1618559760000,"endTime":1618560123000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":379.758,"pathway":false,"mode":"WALK","transitLeg":false,"route":"","agencyTimeZoneOffset":28800000,"interlineWithPreviousLeg":false,"from":{"name":"Larkin Ter","stopId":"1:68300798","stopCode":"46239","platformCode":"46239","lon":103.74221,"lat":1.49524,"arrival":1618559760000,"departure":1618559760000,"zoneId":"68300798","stopIndex":34,"vertexType":"TRANSIT"},"to":{"name":"Destination","lon":103.7431716,"lat":1.4958099,"arrival":1618560123000,"vertexType":"NORMAL"},"legGeometry":{"points":"g`cHycexRC@Dd@JdAqD^ASCUOmAUmBM_BJALAN?DADD?B","length":16},"steps":[{"distance":0.0,"relativeDirection":"DEPART","streetName":"Larkin Ter","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.74221,"lat":1.49524,"elevation":""},{"distance":61.06,"relativeDirection":"LEFT","streetName":"parking aisle","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":true,"lon":103.74220501752644,"lat":1.4952689412885523,"elevation":""},{"distance":100.229,"relativeDirection":"RIGHT","streetName":"Jalan Garuda 2","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.7416639,"lat":1.4951744,"elevation":""},{"distance":184.483,"relativeDirection":"RIGHT","streetName":"service road","absoluteDirection":"EAST","stayOn":false,"area":false,"bogusName":true,"lon":103.7415029,"lat":1.4960613,"elevation":""},{"distance":33.986000000000004,"relativeDirection":"RIGHT","streetName":"service road","absoluteDirection":"SOUTH","stayOn":true,"area":false,"bogusName":true,"lon":103.74313570000001,"lat":1.4963557,"elevation":""}],"rentedBike":false,"duration":363.0}],"tooSloped":false},{"duration":3073,"startTime":1618559450000,"endTime":1618562523000,"walkTime":553,"transitTime":1980,"waitingTime":540,"walkDistance":573.679,"walkLimitExceeded":false,"elevationLost":0.0,"elevationGained":0.0,"transfers":1,"legs":[{"startTime":1618559450000,"endTime":1618559640000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":193.921,"pathway":false,"mode":"WALK","transitLeg":false,"route":"","agencyTimeZoneOffset":28800000,"interlineWithPreviousLeg":false,"from":{"name":"Origin","lon":103.75911,"lat":1.55008,"departure":1618559450000,"vertexType":"NORMAL"},"to":{"name":"Jalan Daya 05","stopId":"1:80003001","stopCode":"03001","platformCode":"03001","lon":103.75864,"lat":1.55014,"arrival":1618559640000,"departure":1618559640000,"zoneId":"80003001","stopIndex":4,"vertexType":"TRANSIT"},"legGeometry":{"points":"gwmHimhxRN`At@Iv@MFZmBTY@AC","length":8},"steps":[{"distance":100.828,"relativeDirection":"DEPART","streetName":"road","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.75909983451389,"lat":1.5501236334318043,"elevation":""},{"distance":15.993,"relativeDirection":"RIGHT","streetName":"Jalan Pinang 5","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":false,"lon":103.7588843,"lat":1.5494908,"elevation":""},{"distance":77.1,"relativeDirection":"RIGHT","streetName":"Jalan Daya","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.75874440000001,"lat":1.5494572000000002,"elevation":""},{"distance":0.0,"relativeDirection":"RIGHT","streetName":"Jalan Daya 05","absoluteDirection":"EAST","stayOn":false,"area":false,"bogusName":false,"lon":103.75862791756558,"lat":1.550139453813671,"elevation":""}],"rentedBike":false,"duration":190.0},{"startTime":1618559640000,"endTime":1618560540000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":6102.311527639644,"pathway":false,"mode":"BUS","transitLeg":true,"route":"Taman Setia Indah - JB Sentral","agencyName":"CWL","agencyUrl":"http://www.causewaylink.com.my","agencyTimeZoneOffset":0,"routeId":"1:10BCWL","headsign":"Taman Setia Indah - JB Sentral","agencyId":"1:CWL","tripId":"1:0002_10BCWL_7132_0_A2_ALLDAY_1_5","serviceDate":"2021-04-16","from":{"name":"Jalan Daya 05","stopId":"1:80003001","stopCode":"03001","platformCode":"03001","lon":103.75864,"lat":1.55014,"arrival":1618559640000,"departure":1618559640000,"zoneId":"80003001","stopIndex":4,"vertexType":"TRANSIT"},"to":{"name":"OPP Petron Pandan","stopId":"1:80003015","stopCode":"03015","platformCode":"03015","lon":103.77133,"lat":1.52486,"arrival":1618560540000,"departure":1618561080000,"zoneId":"80003015","stopIndex":13,"vertexType":"TRANSIT"},"intermediateStops":[{"name":"7E Taman Daya","stopId":"1:80003002","stopCode":"03002","platformCode":"03002","lon":103.76244,"lat":1.54504,"arrival":1618559700000,"departure":1618559700000,"zoneId":"80003002","stopIndex":5,"vertexType":"TRANSIT"},{"name":"Jalan Bertam 9","stopId":"1:80003003","stopCode":"03003","platformCode":"03003","lon":103.76317,"lat":1.53845,"arrival":1618559760000,"departure":1618559760000,"zoneId":"80003003","stopIndex":6,"vertexType":"TRANSIT"},{"name":"Taman Delima","stopId":"1:80003004","stopCode":"03004","platformCode":"03004","lon":103.76285,"lat":1.53661,"arrival":1618559820000,"departure":1618559820000,"zoneId":"80003004","stopIndex":7,"vertexType":"TRANSIT"},{"name":"Universal Cable","stopId":"1:80003007","stopCode":"03007","platformCode":"03007","lon":103.75965,"lat":1.53558,"arrival":1618560000000,"departure":1618560000000,"zoneId":"80003007","stopIndex":8,"vertexType":"TRANSIT"},{"name":"Masjid Kangkar Tebrau","stopId":"1:80003005","stopCode":"03005","platformCode":"03005","lon":103.75558,"lat":1.53368,"arrival":1618560060000,"departure":1618560060000,"zoneId":"80003005","stopIndex":9,"vertexType":"TRANSIT"},{"name":"U turn Kangkar tebrau","stopId":"1:80003006","stopCode":"03006","platformCode":"03006","lon":103.752449,"lat":1.531436,"arrival":1618560120000,"departure":1618560120000,"zoneId":"80003006","stopIndex":10,"vertexType":"TRANSIT"},{"name":"Poliklinik Penawar Kangkar Tebrau","stopId":"1:80003082","stopCode":"03082","platformCode":"03082","lon":103.76824,"lat":1.52958,"arrival":1618560180000,"departure":1618560180000,"zoneId":"80003082","stopIndex":11,"vertexType":"TRANSIT"},{"name":"Shell Pandan","stopId":"1:80003016","stopCode":"03016","platformCode":"03016","lon":103.77553,"lat":1.52682,"arrival":1618560420000,"departure":1618560420000,"zoneId":"80003016","stopIndex":12,"vertexType":"TRANSIT"}],"legGeometry":{"points":"kwmHojhxRz^wV??dh@qC??nJ~@??lE~R??zJlX??`MrR??pJwaB??fPql@??fKfY","length":18},"steps":[],"routeShortName":"10B","routeLongName":"Taman Setia Indah - JB Sentral","duration":900.0},{"startTime":1618561080000,"endTime":1618562160000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":6654.430660006647,"pathway":false,"mode":"BUS","transitLeg":true,"route":"Terminal Kota Tinggi - Larkin Sentral","agencyName":"CWL","agencyUrl":"http://www.causewaylink.com.my","agencyTimeZoneOffset":0,"routeId":"1:66CWL","headsign":"Terminal Kota Tinggi - Larkin Sentral","agencyId":"1:CWL","tripId":"1:0002_66CWL_7120_1_SM 8_ALLDAY_2_2","serviceDate":"2021-04-16","from":{"name":"OPP Petron Pandan","stopId":"1:80003015","stopCode":"03015","platformCode":"03015","lon":103.77133,"lat":1.52486,"arrival":1618560540000,"departure":1618561080000,"zoneId":"80003015","stopIndex":24,"vertexType":"TRANSIT"},"to":{"name":"Larkin Ter","stopId":"1:68300798","stopCode":"46239","platformCode":"46239","lon":103.74221,"lat":1.49524,"arrival":1618562160000,"departure":1618562160000,"zoneId":"68300798","stopIndex":34,"vertexType":"TRANSIT"},"intermediateStops":[{"name":"OPP Pasar Borong Pandan","stopId":"1:80003014","stopCode":"03014","platformCode":"03014","lon":103.7658,"lat":1.52257,"arrival":1618561140000,"departure":1618561140000,"zoneId":"80003014","stopIndex":25,"vertexType":"TRANSIT"},{"name":"Kampung Ubi","stopId":"1:80007782","stopCode":"07782","platformCode":"07782","lon":103.75546,"lat":1.51829,"arrival":1618561260000,"departure":1618561260000,"zoneId":"80007782","stopIndex":26,"vertexType":"TRANSIT"},{"name":"Kg Melayu","stopId":"1:80007783","stopCode":"07783","platformCode":"07783","lon":103.75312,"lat":1.5185,"arrival":1618561380000,"departure":1618561380000,"zoneId":"80007783","stopIndex":27,"vertexType":"TRANSIT"},{"name":"Opp Taman Gembira","stopId":"1:80007787","stopCode":"07787","platformCode":"07787","lon":103.74456,"lat":1.51802,"arrival":1618561440000,"departure":1618561440000,"zoneId":"80007787","stopIndex":28,"vertexType":"TRANSIT"},{"name":"Ungku Mohsin","stopId":"1:80005498","stopCode":"05498","platformCode":"05498","lon":103.73727,"lat":1.51457,"arrival":1618561560000,"departure":1618561560000,"zoneId":"80005498","stopIndex":29,"vertexType":"TRANSIT"},{"name":"Pej Fama","stopId":"1:80003115","stopCode":"03115","platformCode":"03115","lon":103.73377,"lat":1.50618,"arrival":1618561680000,"departure":1618561680000,"zoneId":"80003115","stopIndex":30,"vertexType":"TRANSIT"},{"name":"OPP Kondo Datin Halimah","stopId":"1:80008192","stopCode":"08192","platformCode":"08192","lon":103.73447,"lat":1.50409,"arrival":1618561800000,"departure":1618561800000,"zoneId":"80008192","stopIndex":31,"vertexType":"TRANSIT"},{"name":"SMT Ert Azizah","stopId":"1:80003116","stopCode":"03116","platformCode":"03116","lon":103.73547,"lat":1.50183,"arrival":1618561920000,"departure":1618561920000,"zoneId":"80003116","stopIndex":32,"vertexType":"TRANSIT"},{"name":"Opp Apartment Larkin Indah","stopId":"1:80003118","stopCode":"03118","platformCode":"03118","lon":103.73717,"lat":1.49802,"arrival":1618562040000,"departure":1618562040000,"zoneId":"80003118","stopIndex":33,"vertexType":"TRANSIT"}],"legGeometry":{"points":"kyhHyyjxRhMpa@??vYr_A??i@rM??~Ant@??pTpl@??ls@zT??`LkC??bMgE??xVsI??jPo^","length":20},"steps":[],"routeShortName":"66","routeLongName":"Terminal Kota Tinggi - Larkin Sentral","duration":1080.0},{"startTime":1618562160000,"endTime":1618562523000,"departureDelay":0,"arrivalDelay":0,"realTime":false,"distance":379.758,"pathway":false,"mode":"WALK","transitLeg":false,"route":"","agencyTimeZoneOffset":28800000,"interlineWithPreviousLeg":false,"from":{"name":"Larkin Ter","stopId":"1:68300798","stopCode":"46239","platformCode":"46239","lon":103.74221,"lat":1.49524,"arrival":1618562160000,"departure":1618562160000,"zoneId":"68300798","stopIndex":34,"vertexType":"TRANSIT"},"to":{"name":"Destination","lon":103.7431716,"lat":1.4958099,"arrival":1618562523000,"vertexType":"NORMAL"},"legGeometry":{"points":"g`cHycexRC@Dd@JdAqD^ASCUOmAUmBM_BJALAN?DADD?B","length":16},"steps":[{"distance":0.0,"relativeDirection":"DEPART","streetName":"Larkin Ter","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.74221,"lat":1.49524,"elevation":""},{"distance":61.06,"relativeDirection":"LEFT","streetName":"parking aisle","absoluteDirection":"WEST","stayOn":false,"area":false,"bogusName":true,"lon":103.74220501752644,"lat":1.4952689412885523,"elevation":""},{"distance":100.229,"relativeDirection":"RIGHT","streetName":"Jalan Garuda 2","absoluteDirection":"NORTH","stayOn":false,"area":false,"bogusName":false,"lon":103.7416639,"lat":1.4951744,"elevation":""},{"distance":184.483,"relativeDirection":"RIGHT","streetName":"service road","absoluteDirection":"EAST","stayOn":false,"area":false,"bogusName":true,"lon":103.7415029,"lat":1.4960613,"elevation":""},{"distance":33.986000000000004,"relativeDirection":"RIGHT","streetName":"service road","absoluteDirection":"SOUTH","stayOn":true,"area":false,"bogusName":true,"lon":103.74313570000001,"lat":1.4963557,"elevation":""}],"rentedBike":false,"duration":363.0}],"tooSloped":false}]},"metadata":{"searchWindowUsed":4200,"nextDateTime":1618560900000,"prevDateTime":1618552500000},"debugOutput":{"precalculationTime":0,"directStreetRouterTime":69,"transitRouterTime":400,"filteringTime":6,"renderingTime":1,"totalTime":476,"transitRouterTimes":{"tripPatternFilterTime":57,"accessEgressTime":22,"raptorSearchTime":309,"itineraryCreationTime":12}},"elevationMetadata":{"ellipsoidToGeoidDifference":23.274415350558648,"geoidElevation":false}}

mar...@graspit.co.uk

unread,
May 17, 2022, 3:26:01 AM5/17/22
to OpenTripPlanner Developers
If you're happy to do this in R, you can take a look at my tutorial:


and otpr R package:


which will process the JSON response for you.

Marcus
Reply all
Reply to author
Forward
0 new messages