dirTag change?

46 views
Skip to first unread message

Meghan McQueeney

unread,
Jun 3, 2010, 1:23:51 PM6/3/10
to MassDOTDevelopers
Hi there,
I'm noticing a change in the dirTag data in the real time feeds take
place about 12 hours ago. Is this a permanent change? If so, which
is which? It used to be "in" and "out" but now something else.

- <body copyright="All data copyright MBTA 2010.">
<vehicle id="0302" routeTag="111" dirTag="111_11150041v0_0"
lat="42.3717192" lon="-71.0655951" secsSinceReport="98"
predictable="true" heading="201" speedKmHr="0.0" />
<vehicle id="0652" routeTag="111" dirTag="111_11150041v0_0"
lat="42.3630702" lon="-71.0578593" secsSinceReport="16"
predictable="true" heading="169" speedKmHr="0.0" />
<vehicle id="0654" routeTag="null" dirTag="null" lat="42.3631619"
lon="-71.0580139" secsSinceReport="15" predictable="false"
heading="-4" speedKmHr="0.0" />
<vehicle id="0680" routeTag="111" dirTag="111_11150041v0_0"
lat="42.4071108" lon="-71.0294064" secsSinceReport="32"
predictable="true" heading="355" speedKmHr="0.0" />
<vehicle id="0630" routeTag="111" dirTag="111_11150041v0_0"
lat="42.4006536" lon="-71.0336006" secsSinceReport="32"
predictable="true" heading="270" speedKmHr="0.0" />
<vehicle id="0612" routeTag="111" dirTag="111_11150042v0_1"
lat="42.4042804" lon="-71.0358672" secsSinceReport="15"
predictable="true" heading="209" speedKmHr="0.0" />
<vehicle id="0716" routeTag="111" dirTag="null" lat="42.4261089"
lon="-71.0739666" secsSinceReport="32" predictable="false"
heading="-4" speedKmHr="0.0" />
<lastTime time="1275585559794" />
</body>

Michael Smith

unread,
Jun 4, 2010, 11:30:37 AM6/4/10
to massdotd...@googlegroups.com
Configuration data for an agency changes on a regular basis. Therefore
apps need to be able to handle changes to the configuration data,
including the dirTags. You should definitely expect the dirTags to
change again in the future.

Michael Smith
Director of Engineering
NextBus

George Schneeloch

unread,
Jun 5, 2010, 10:46:33 PM6/5/10
to massdotd...@googlegroups.com
It looks like this information can be figured out using the
routeConfig command in the xml feed. My guess is that (for example,
from route 71):
<direction tag="71_7110013v0_0" title="Outbound Watertown Square via
Mt. Auburn St." name="Outbound" useForUI="false">

you would look up the direction using 'tag', and display it using the
given 'name'
-George

> --
> You received this message because you are subscribed to the Google Groups
> "MassDOTDevelopers" group.
> To post to this group, send email to massdotd...@googlegroups.com.
> To unsubscribe from this group, send email to
> massdotdevelop...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/massdotdevelopers?hl=en.
>
>

Joe Shaw

unread,
Jun 4, 2010, 9:42:43 PM6/4/10
to MassDOTDevelopers
Hi,

On Jun 4, 11:30 am, Michael Smith <msm...@nextbus.com> wrote:
> Configuration data for an agency changes on a regular basis. Therefore
> apps need to be able to handle changes to the configuration data,
> including the dirTags. You should definitely expect the dirTags to
> change again in the future.

Fair enough, but this particular change has made using the API
concretely more difficult for developers, since we now have to decode
the dirTag to associate it with a human-readable label like "Inbound"
or "Outbound", and it appears to be different for each bus line. It
also means additional API calls -- we now have to make a routeConfig
call per line instead of making a simple assumption of the meaning --
which means increased traffic and load on the server side.

Thanks,
Joe

Jamie Ciocco

unread,
Jun 4, 2010, 5:44:06 PM6/4/10
to massdotd...@googlegroups.com
Hi Michael --

So does 1 at the end of the dirtag currently mean inbound while 0
means outbound? Do the 4 or 5 numbers before the "v0" mean anything
that might be useful for developers to know?

Thanks so much!

cheers,
jamie

Brendan Hickey

unread,
Jun 4, 2010, 11:34:34 AM6/4/10
to massdotd...@googlegroups.com
Michael,

Is there a way to enumerate all of the available directions for a
particular route?

Cheers,
Brendan

Joe Shaw

unread,
Jun 5, 2010, 11:58:31 AM6/5/10
to massdotd...@googlegroups.com
Hi,

On Jun 4, 11:30 am, Michael Smith <msm...@nextbus.com> wrote:

> Configuration data for an agency changes on a regular basis. Therefore
> apps need to be able to handle changes to the configuration data,
> including the dirTags. You should definitely expect the dirTags to
> change again in the future.

Assuming I am using the API correctly, the dirTags do not appear to
match between the routeConfig and vehicleLocation calls:

http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=mbta&r=1

<direction tag="in" title="Inbound Dudley Station via Mass. Ave."
name="Inbound" useForUI="true">
<direction tag="out" title="Outbound Harvard Station via Mass. Ave."
name="Outbound" useForUI="true">

http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=mbta&r=1&t=0

<vehicle id="2283" routeTag="1" dirTag="1_01_0032v0_0"
lat="42.3483064" lon="-71.0882" secsSinceReport="34"
predictable="true" heading="341" speedKmHr="0.0"/>
<vehicle id="2180" routeTag="1" dirTag="1_01_0029v0_1" lat="42.3748"
lon="-71.1144994" secsSinceReport="34" predictable="true"
heading="191" speedKmHr="0.0"/>

Am I doing something wrong?

It's fair enough that the configuration data for directions can
change, but there is something to be said about making the dirTag a
value that app developers can make reasonable assumptions about. "in"
and "out" were straightforward to map to "Inbound" and "Outbound"
human-readable strings and were consistent across all bus lines and
the T's terminology. These new values require app developers to make
routeConfig calls which (a) increases number of requests and load on
the NextBus servers and (b) makes our apps more complicated, if more
technically "correct".

Thanks,
Joe

Meghan McQueeney

unread,
Jun 4, 2010, 11:47:40 AM6/4/10
to massdotd...@googlegroups.com
Hi Michael,
Thanks for the response, but that doesn't exactly answer the question.  What do you mean by configuration data?  I get that the data itself changes, but shouldn't the format be static?  What's the point of a dirTag element if the data type changes and the content inside of it is unknown?  Ideally, i'd like to have users tell me which direction they want to go and then give them the locations of the buses. I know I can find the location in lat/lon, the bus number in bus id, shouldn't I be also able to reliably determine the direction from the dirTag as it implies?  What do you suggest?

On Fri, Jun 4, 2010 at 11:30 AM, Michael Smith <msm...@nextbus.com> wrote:

Mark Renouf

unread,
Jun 6, 2010, 11:55:22 AM6/6/10
to MassDOTDevelopers
Hmm. This seems like either a mistake or an temporary inconsistency.
If you look at 66's routeConfig, there is both the simple "in" & "out"
as well as the more cryptic versions "66_6610003v0_1" referenced. And
even then some don't match :-(

On Jun 5, 11:58 am, Joe Shaw <j...@joeshaw.org> wrote:
> Hi,
>
> On Jun 4, 11:30 am, Michael Smith <msm...@nextbus.com> wrote:
>
> > Configuration data for an agency changes on a regular basis. Therefore
> > apps need to be able to handle changes to the configuration data,
> > including the dirTags. You should definitely expect the dirTags to
> > change again in the future.
>
> Assuming I am using the API correctly, the dirTags do not appear to
> match between the routeConfig and vehicleLocation calls:
>
> http://webservices.nextbus.com/service/publicXMLFeed?command=routeCon...
>
> <direction tag="in" title="Inbound Dudley Station via Mass. Ave."
> name="Inbound" useForUI="true">
> <direction tag="out" title="Outbound Harvard Station via Mass. Ave."
> name="Outbound" useForUI="true">
>
> http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleL...

Mark Renouf

unread,
Jun 6, 2010, 6:25:11 AM6/6/10
to MassDOTDevelopers
Not to defend the change or the API but I believe it's not so bad if
you pull the routeConfig and cache it. When he said it can change
again in the future, I'm interpreting that as not changing at any more
frequently than a day (hopefully).

I would strongly urge NextBus to provide a wiki where both they and
devs can help clearly document some of these specifics (it would save
many emails).

On Jun 5, 11:58 am, Joe Shaw <j...@joeshaw.org> wrote:
> Hi,
>
> On Jun 4, 11:30 am, Michael Smith <msm...@nextbus.com> wrote:
>
> > Configuration data for an agency changes on a regular basis. Therefore
> > apps need to be able to handle changes to the configuration data,
> > including the dirTags. You should definitely expect the dirTags to
> > change again in the future.
>
> Assuming I am using the API correctly, the dirTags do not appear to
> match between the routeConfig and vehicleLocation calls:
>
> http://webservices.nextbus.com/service/publicXMLFeed?command=routeCon...
>
> <direction tag="in" title="Inbound Dudley Station via Mass. Ave."
> name="Inbound" useForUI="true">
> <direction tag="out" title="Outbound Harvard Station via Mass. Ave."
> name="Outbound" useForUI="true">
>
> http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleL...

Michael Smith

unread,
Jun 7, 2010, 8:45:52 PM6/7/10
to massdotd...@googlegroups.com
The issue of the vehicleLocations command providing dirTags that were
different from when using the routeConfig command should now be fixed.

Mike

George Schneeloch

unread,
Jun 8, 2010, 10:01:38 AM6/8/10
to massdotd...@googlegroups.com

The vehicle locations feed seems to be broken. Where the dirTag attribute appears in the xml, it seems to insert some other xml saying that there's an error
-George

On Jun 7, 2010 8:45 PM, "Michael Smith" <msm...@nextbus.com> wrote:

The issue of the vehicleLocations command providing dirTags that were different from when using the routeConfig command should now be fixed.

Mike





On 6/5/2010 8:58 AM, Joe Shaw wrote:
>
> Hi,
>

> On Jun 4, 11:30 am, Michael Smith<msm...@nextbu...

Ryan Berdeen

unread,
Jun 7, 2010, 9:46:17 PM6/7/10
to MassDOTDevelopers
Looks like the most recent update introduced some issues. I'm seeing
"null" as a dirTag, and occasional errors in the middle of the XML.

$ curl "http://webservices.nextbus.com/service/publicXMLFeed?
command=vehicleLocations&a=mbta&r=39&t=0"
<?xml version="1.0" encoding="utf-8" ?>
<body copyright="All data copyright MBTA 2010.">
<vehicle id="2053" routeTag="39" dirTag="out" lat="42.3113793"
lon="-71.1144249" secsSinceReport="28" predictable="true"
heading="191" speedKmHr="0.0"/>
<vehicle id="1206" routeTag="39" dirTag="null" lat="42.3322779"
lon="-71.065178" secsSinceReport="61" predictable="false" heading="-4"
speedKmHr="0.0"/>
<vehicle id="2045" routeTag="39" dirTag="out" lat="42.333315"
lon="-71.1092236" secsSinceReport="61" predictable="true"
heading="266" speedKmHr="0.0"/>
<vehicle id="1201" routeTag="39" dirTag="null" lat="42.3319262"
lon="-71.0650012" secsSinceReport="61" predictable="false"
heading="-4" speedKmHr="0.0"/>
<vehicle id="2116" routeTag="39" dirTag="in" lat="42.3386464"
lon="-71.0935424" secsSinceReport="61" predictable="true" heading="64"
speedKmHr="0.0"/>
<vehicle id="2093" routeTag="39" dirTag="in" lat="42.3193125"
lon="-71.1117641" secsSinceReport="28" predictable="true"
heading="360" speedKmHr="0.0"/>
<vehicle id="2106" routeTag="39" dirTag="out" lat="42.3452389"
lon="-71.0821639" secsSinceReport="28" predictable="true"
heading="222" speedKmHr="0.0"/>
<lastTime time="1275961516991"/>
</body>


On Jun 7, 8:45 pm, Michael Smith <msm...@nextbus.com> wrote:
> The issue of the vehicleLocations command providing dirTags that were
> different from when using the routeConfig command should now be fixed.
>
> Mike
>
> On 6/5/2010 8:58 AM, Joe Shaw wrote:
>
>
>
> > Hi,
>
> > On Jun 4, 11:30 am, Michael Smith<msm...@nextbus.com>  wrote:
>
> >> Configuration data for an agency changes on a regular basis. Therefore
> >> apps need to be able to handle changes to the configuration data,
> >> including the dirTags. You should definitely expect the dirTags to
> >> change again in the future.
>
> > Assuming I am using the API correctly, the dirTags do not appear to
> > match between the routeConfig and vehicleLocation calls:
>
> >http://webservices.nextbus.com/service/publicXMLFeed?command=routeCon...
>
> > <direction tag="in" title="Inbound Dudley Station via Mass. Ave."
> > name="Inbound" useForUI="true">
> > <direction tag="out" title="Outbound Harvard Station via Mass. Ave."
> > name="Outbound" useForUI="true">
>
> >http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleL...

Josh from MassDOT

unread,
Jun 8, 2010, 6:07:28 PM6/8/10
to MassDOTDevelopers
All,

We wanted to jump in and respond to the comments about the changes to
dirTag that has received a bunch of comments here in the group. We
wanted to make sure everyone is aware of some important changes to the
way the dirTag will be displayed moving forward.

Before I go any further, I wanted to note that no predictions will be
available from the evening of Friday June 18th through Sunday June
20th. The system is being taken down so the MBTA can perform an
upgrade to the system that centrally tracks bus locations. We
apologize in advance.

Now here’s the important part. Right now, in the realtime feed the
direction tag is either “in” or “out” and the title attribute is just
“Inbound” or “Outbound”. On June 26th (the first day of the MBTA’s
Summer schedule) that will change to provide more detailed
information, and software should be ready to handle that change. The
direction tag will be a unique identifier, “name” will be “Inbound” or
“Outbound,” and “title” will roughly correspond to what’s on the
destination sign, without the route number. So a route 39 trip might
have the direction tag “39_3930037v0_0” which would have the
attributes name=”Outbound” and title=”Forest Hills Sta via Huntington
Ave.”

Finally, a small announcement about the next GTFS file, which will be
available in the coming days. There is one change, which is that the
stop_code column will now be populated. This field is intended as a
number that can be used to identify stops to the public, and
corresponds to the stop tag in the NextBus feed. (The values are
actually the same as those in the stop_id column when not blank.)

Please let us know if you have any questions.

Thanks,
Josh

______________________________
Joshua K. Robin
Massachusetts Department of Transportation
Joshua...@eot.state.ma.us

MassDOT Developers Page: http://www.mass.gov/eot/developers
Twitter: http://twitter.com/MassDOTdev
Google Group: http://groups.google.com/group/massdotdevelopers
> > > Joe- Hide quoted text -
>
> - Show quoted text -

George Schneeloch

unread,
Jun 8, 2010, 7:31:30 PM6/8/10
to massdotd...@googlegroups.com
To be more specific, occasionally if you read from the vehicle
location feed, the data is corrupted. If you click on the link below
you can see the problem:

http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=mbta&t=0

<?xml version="1.0" encoding="utf-8" ?>
<body copyright="All data copyright MBTA 2010.">

<vehicle id="0808" routeTag="null" dirTag="<Error shouldRetry="false">
Exception occurred in XMLFeed,
status=[command=vehicleLocations,agency=mbta] message: null
</Error>
</body>

The XML is corrupted, so reading from it won't work. Is this being looked into?
-George

Michael Smith

unread,
Jun 9, 2010, 11:43:02 AM6/9/10
to massdotd...@googlegroups.com
Not specifying the route tag is an undocumented and unexpected use of
the vehicleLocations command. Therefore it is not fully supported and it
might not be available in the future. But as of last night NextBus made
it work for MBTA.

Mike

>> Now here�s the important part. Right now, in the realtime feed the
>> direction tag is either �in� or �out� and the title attribute is just
>> �Inbound� or �Outbound�. On June 26th (the first day of the MBTA�s


>> Summer schedule) that will change to provide more detailed
>> information, and software should be ready to handle that change. The

>> direction tag will be a unique identifier, �name� will be �Inbound� or
>> �Outbound,� and �title� will roughly correspond to what�s on the


>> destination sign, without the route number. So a route 39 trip might

>> have the direction tag �39_3930037v0_0� which would have the
>> attributes name=�Outbound� and title=�Forest Hills Sta via Huntington
>> Ave.�

Mark Renouf

unread,
Jun 14, 2010, 11:46:04 PM6/14/10
to MassDOTDevelopers
There seems to be some duplicate directions defined...

For example: both 71_7110013v0_0 and 71_7120021v0_0 on Route #71 both
have identical titles and lists of stopTags:

"Outbound Watertown Square via Mt. Auburn St."

"2076",
"2020",
"2021",
"2022",
"2023",
"2025",
"2026",
"2027",
"2028",
"2029",
"2030",
"2031",
"2032",
"2033",
"2034",
"2035",
"2036",
"2037",
"2038",
"2039",
"2040",
"2041",
"2047",
"2042",
"2043",
"2044",
"2046",
"8178"

On Jun 8, 6:07 pm, Josh from MassDOT <joshua.ro...@eot.state.ma.us>
wrote:
> Joshua.Ro...@eot.state.ma.us

Ryan Berdeen

unread,
Jun 28, 2010, 9:12:28 AM6/28/10
to MassDOTDevelopers
Any update on the changes that were supposed to take place yesterday?

I'm still seeing "out" as a dirTag, and now it seems even worse: it
looks like all of the directions that were tagged "in" are now tagged
"out" and there are multiple different "out" directions per route.
Route 15, for example, has three:

to Ruggles Station via Uphams Corner (used to be tagged "in")
to Fields Corner via Uphams Corner
to Dudley Station via Fields Corner &amp; Uphams Corner



On Jun 8, 6:07 pm, Josh from MassDOT <joshua.ro...@eot.state.ma.us>
wrote:
> Joshua.Ro...@eot.state.ma.us
Reply all
Reply to author
Forward
0 new messages