For Developers Index » SIRI StopMonitoring

SIRI StopMonitoring

Last modified by Tony Laidig on 2012/01/13 11:22

SIRI StopMonitoring Call

The SIRI StopMonitoring ("SIRI SM") call allows the developer to request information about the vehicles serving a particular stop.  As much as possible, the values used both in the SM request and the SM response correspond to the values in the GTFS data for the B63.

SIRI StopMonitoring Requests

It is accessible at the following URLs:

http://bustime.mta.info/api/siri/stop-monitoring.xml
http://bustime.mta.info/api/siri/stop-monitoring.json

with the following GET parameters:

  • key - your MTA Bus Time developer API key (required).  Go here to get one.
  • OperatorRef - the GTFS agency ID to be monitored (required).  At the moment it will always be MTA NYCT
  • MonitoringRef - the GTFS stop ID of the stop to be monitored (required).  For example, 308214 for the stop at 5th Avenue and Union St towards Bay Ridge.
  • LineRef - a filter by GTFS route ID.
  • DirectionRef - a filter by GTFS direction ID (optional).  Either 0 or 1.
  • StopMonitoringDetailLevel - Determines whether or not the response will include the stops ("calls" in SIRI-speak) each vehicle is going to make after it serves the selected stop (optional).  To get calls data, use value calls, otherwise use value normal (default is normal).
  • MaximumNumberOfCallsOnwards - Limits the number of OnwardCall elements returned in the query.

SIRI StopMonitoring Responses

The XML below illustrates the SIRI StopMonitoring response.  It cannot be stressed enough that GTFS trip ID's in SIRI SM responses are used only to indicate a particular stopping pattern, not that a given bus is actually serving a particular scheduled trip.  In this pilot stage, the MTA Bus Time system does not have a formal integration with the schedule.

The comments in the XML below document the meaning of each of the XML elements that are unique to the SIRI StopMonitoring call.  Much of the interesting data is contained inside the MonitoredVehicleJourney element, which has its own documentation.

Note that the MonitoredVehicleJourney of a SIRI VM call will always have a MonitoredCall element, and that the first OnwardCall element (if any) will always be one stop further away than the MonitoredCall element.


<!-- SIRI container elements -->
<Siri version="1.3" xmlns="http://www.siri.org.uk/siri">
  <ServiceDelivery>


    <!-- The timestamp on the MTA Bus Time server at the time the request was fulfilled -->
    <ResponseTimestamp>2011-01-28T14:49:58-05:00</ResponseTimestamp>


    <!-- SIRI container for VehicleMonitoring response data -->
    <StopMonitoringDelivery version="1.3">


      <!-- Same as above.  Required by the SIRI spec. -->
      <ResponseTimestamp>2011-01-28T14:49:58-05:00</ResponseTimestamp>
      <!-- The time until which the response data is valid until. -->
      <ValidUntil>2011-01-28T14:50:58-05:00</ValidUntil>


      <!-- SIRI container for data about a particular vehicle service the selected stop -->
      <MonitoredStopVisit>


        <!-- The timestamp of the last real-time update from the particular vehicle -->
        <RecordedAtTime>2011-01-28T14:49:27-05:00</RecordedAtTime>


        <!-- A MonitoredVehicleJourney -->
        <MonitoredVehicleJourney>
          <LineRef>B63</LineRef>
          <DirectionRef>1</DirectionRef>
          <FramedVehicleJourneyRef>
            <DataFrameRef>2011-01-28</DataFrameRef>
            <DatedVehicleJourneyRef>MTA NYCT_20110102EA_087800_B63_0002_B63_19</DatedVehicleJourneyRef>
          </FramedVehicleJourneyRef>
          <PublishedLineName>B63 BAY RIDGE SHORE RD via 5 AV</PublishedLineName>
          <OriginRef>306399</OriginRef>
          <DestinationRef>801042</DestinationRef>
          <Monitored>true</Monitored>
          <VehicleLocation>
            <Longitude>-73.97857806429035</Longitude>
            <Latitude>40.68448949711613</Latitude>
          </VehicleLocation>
          <ProgressRate>normalProgress</ProgressRate>
          <CourseOfJourneyRef>20110102EA_087800_B63_0002_B63_19</CourseOfJourneyRef>
          <VehicleRef>MTA NYCT_7582</VehicleRef>


          <!-- Relevant information for the selected stop -->
          <MonitoredCall>
            <StopPointRef>308214</StopPointRef>
            <VisitNumber>1</VisitNumber>
            <VehicleAtStop>false</VehicleAtStop>
            <Extensions>
              <Distances>
                <CallDistanceAlongRoute>3038.9206843743973</CallDistanceAlongRoute>
                <DistanceFromCall>1101.7138112517277</DistanceFromCall>
                <StopsFromCall>5</StopsFromCall>
              </Distances>
            </Extensions>
          </MonitoredCall>


          <!-- Information about subsequent stops.  Only if 
VehicleMonitoringDetailLevel=calls -->
          <OnwardCalls>
            <OnwardCall>
              <StopPointRef>308215</StopPointRef>
              <VisitNumber>1</VisitNumber>
              <StopPointName>5 AV - GARFIELD PL</StopPointName>
              <Extensions>
                <Distances>
                  <CallDistanceAlongRoute>3267.1404886070854</CallDistanceAlongRoute>
                  <DistanceFromCall>1329.93361548441</DistanceFromCall>
                  <StopsFromCall>6</StopsFromCall>
                </Distances>
              </Extensions>
            </OnwardCall>
            <OnwardCall>
              <StopPointRef>308216</StopPointRef>
              <VisitNumber>1</VisitNumber>
              <StopPointName>5 AV - 3 ST</StopPointName>
              <Extensions>
                <Distances>
                  <CallDistanceAlongRoute>3505.9160008891786</CallDistanceAlongRoute>
                  <DistanceFromCall>1568.7091277665031</DistanceFromCall>
                  <StopsFromCall>7</StopsFromCall>
                </Distances>
              </Extensions>
            </OnwardCall>


            ... More Onward Call elements


          </OnwardCalls>
        </MonitoredVehicleJourney>
      </MonitoredStopVisit>


      ... More MonitoredStopVisit elements


    </StopMonitoringDelivery>
  </ServiceDelivery>
</Siri>

Tags:
Created by Mike Frumin on 2011/01/26 11:17

My Recent Modifications


This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 3.2 - Documentation