Rank: Administration
Groups: Administrators, Registered Joined: 6/1/2011(UTC) Posts: 88 Location: Urbana Thanks: 1 times Was thanked: 6 time(s) in 6 post(s)
|
I looked through your diff and I think the issue you are having is related to the previously mentioned bug where some stops were not being returned. From what I can tell all the data looks good. In regards to your example about the PHILOSLVR stop, both PHILOSLVR:4 and PHILOSLVR:8 are valid stop points. I think it may be helpful for me to explain the difference between stops and stop points. One of the big changes we made with version 2.0 of the API was to better distinguish between the two. A stop point is a specific point where a bus stops (e.g. the NW corner of Philo and Silver). A stop is a collection of all the stop points at a location (e.g. Philo and Silver). In version 1.0 we only return stop points and don't group them in any way (This was done to reflect the GTFS format). We have since decided that this format, although matching GTFS, does not sufficiently represent our data. So, for version 2.0, we added stop objects that hold stop points. For example: Code:
{
"changeset_id":"08AE3609ACA4426C52F54E28363179EE",
"time":"2011-12-05T11:28:40-06:00",
"status":{
"code":200,
"msg":"ok"
},
"stops":[
{
"stop_id":"PHILOSLVR",
"stop_name":"Philo and Silver",
"code":"MTD3655",
"points":[
{
"code":"MTD3655",
"stop_id":"PHILOSLVR:2",
"stop_lat":40.091365,
"stop_lon":-88.190553,
"stop_name":"Philo & Silver"
},
{
"code":"MTD3655",
"stop_id":"PHILOSLVR:3",
"stop_lat":40.091457,
"stop_lon":-88.190787,
"stop_name":"Philo & Silver"
},
{
"code":"MTD3655",
"stop_id":"PHILOSLVR:4",
"stop_lat":40.091564,
"stop_lon":-88.190681,
"stop_name":"Philo & Silver"
},
{
"code":"MTD3655",
"stop_id":"PHILOSLVR:8",
"stop_lat":40.091519,
"stop_lon":-88.191061,
"stop_name":"Philo & Silver"
}
]
}
]
}
You can get real time departures for both stops and stop points. If you request a stop it will return all departures for that location (departures for all stop points), if you request a stop point it will only return departures for that specific point. This can be useful for high frequency locations such as the Terminal, but in the vast majority of cases I would strongly recommend using stops. The PHILOSLVR stop is a perfect example of why. Take a look at these two method calls: http://developer.cumtd.c...&stop_id=PHILOSLVR:4http://developer.cumtd.c...&stop_id=PHILOSLVR:8You can see that PHILOSLVR:8 is used during the week and PHILOSLVR:4 is used on Saturdays. Using a specific stop point to request departures would result in not getting departures for either Saturday or weekdays. If you request departures for the stop however you will get all departures for Philo and Silver. Note that if you have a a stop_id for a stop point you can simply drop everything after the colon and get the stop so PHILOSLVR:4 becomes PHILOSLVR. Sorry for the excessive length of this answer, but I hope it was helpful...
|