Ero sivun ”Journeys API” versioiden välillä

3 781 merkkiä lisätty ,  6. lokakuuta 2014 kello 02.46
Rivi 486: Rivi 486:
http://data.itsfactory.fi/journeys/api/1/vehicle-activity
http://data.itsfactory.fi/journeys/api/1/vehicle-activity
</pre>
</pre>
The call would result in a following response:
<pre>
{
    "recordedAtTime" : "2014-10-05T23:22:00.008+03:00",
    "validUntilTime" : "2014-10-05T23:22:30.008+03:00",
    "monitoredVehicleJourney" : {
      "lineRef" : "3",
      "directionRef" : "1",
      "framedVehicleJourneyRef" : {
        "dateFrameRef" : "2014-10-05",
        "datedVehicleJourneyRef" : "http://data.itsfactory.fi/journeys/api/1/journeys/3_2240_1028_3615"
      },
      "vehicleLocation" : {
        "longitude" : "23.6904222",
        "latitude" : "61.5267588"
      },
      "operatorRef" : "TKL",
      "bearing" : "92.0",
      "delay" : "-P0Y0M0DT0H3M20.000S",
      "vehicleRef" : "TKL_028",
      "journeyPatternRef" : "3V",
      "originShortName" : "3615",
      "destinationShortName" : "1028",
      "originAimedDepartureTime" : "2240",
      "onwardCalls" : [ {
        "expectedArrivalTime" : "2014-10-05T23:22:00+03:00",
        "expectedDepartureTime" : "2014-10-05T23:22:00+03:00",
        "stopPointRef" : "http://data.itsfactory.fi/journeys/api/1/stop-points/1414",
        "order" : "46"
      }, {
        "expectedArrivalTime" : "2014-10-05T23:23:00+03:00",
        "expectedDepartureTime" : "2014-10-05T23:23:00+03:00",
        "stopPointRef" : "http://data.itsfactory.fi/journeys/api/1/stop-points/1416",
        "order" : "47"
      }, {
        "expectedArrivalTime" : "2014-10-05T23:24:00+03:00",
        "expectedDepartureTime" : "2014-10-05T23:24:00+03:00",
        "stopPointRef" : "http://data.itsfactory.fi/journeys/api/1/stop-points/1024",
        "order" : "48"
      }, {
        "expectedArrivalTime" : "2014-10-05T23:25:00+03:00",
        "expectedDepartureTime" : "2014-10-05T23:25:00+03:00",
        "stopPointRef" : "http://data.itsfactory.fi/journeys/api/1/stop-points/1026",
        "order" : "49"
      }, {
        "expectedArrivalTime" : "2014-10-05T23:25:00+03:00",
        "expectedDepartureTime" : "2014-10-05T23:25:00+03:00",
        "stopPointRef" : "http://data.itsfactory.fi/journeys/api/1/stop-points/1028",
        "order" : "50"
      } ]
    }
  }
  ...
</pre>
The response contains a list of elements described above. Each element corresponds to a active vehicle currently operating in the road network. Following fields are present:
* recordedAtTime specifes the point of time when the vehicle's activity is monitored
* validUntilTime specifies the maximum time this data is valid. Records are updated once in a second, so the client should not wait until the validUntilTime has passed to request more data.
* lineRef specifies the line where the bus is currently operating.
* directionRef sepecifies the direction the bus is travelling on the line. 1 = from origin stop to destination stop, 2= from destination stop back to origin stop.
* dataFrameRef specifies the date when the vehicle started from the origin stop
* datedVehicleJorneyRef contains a link back to Journeys API from which more information about this JOURNEY can be obtained.
* originAimedDepartureTime specifies which time the vehicle departed from the origin stop
* originShortName specifies the number of the stop where the vehicle started
* destinationShortName specifies the number of the stop where the bus is heading to
* latitude and longitude specifies the map position of the vehicle at the time of the observation
* bearing specifies the direction the vehicle is travelling
* delay specifies the relative time the vehicle is behind or ahead of its planned schedule
* vehicleRef uniquely identifies the monitored vehicle
* onwardCalls contains a list of stops where the vehicle is stopping next as well as estimated times on each stop. Each onwardCall also contains stopPointRef which points back to Journeys API and provides more information on the stop in question
0

muokkausta