Rank: Advanced Member
Groups: Registered
Joined: 7/10/2011(UTC) Posts: 34
Thanks: 1 times
|
Hi Sean, Thanks for the response! Sean wrote:There's no method in the API to figure this out. I can tell you right now the only places where this occurs is at the Transit Plaza and Illinois Terminal. Normally a stop code is associated with any stop point at an intersection. However, there are just too many buses at these locations to be useful over SMS so we split the stop points up and gave them individual codes. OK, that makes sense. Quote:Of course this makes things a little goofy with the API, so we opted for showing the specific stop code instead of the more general one. Do you think it would be better to provide an array of stop codes for each stop even though most stops will only have one code? Maybe you could add a key like "intersection_code" to the stops for which this is the case? So the output of stops.getList would include Code:{
"stop_name": "Transit Plaza",
"stop_lat": 40.108178000000002,
"code": "MTD6115",
"intersection_code": "MTD7411",
"stop_lon": -88.228827999999993,
"stop_id": "PLAZA:4"
},
{
"stop_name": "Illinois Terminal",
"stop_lat": 40.115935,
"code": "MTD7534",
"intersection_code": "MTD3121",
"stop_lon": -88.240947000000006,
"stop_id": "IT:1"
},
{
"stop_name": "Anderson & Harding",
"stop_lat": 40.093719999999998,
"code": "MTD3324",
"stop_lon": -88.198797999999996,
"stop_id": "ADRSNHRDG:4"
},
You’d then be able to look for the presence of intersection_code to determine whether there’s another code associated with that stop. Of course, since there are only these two exceptions, it’ll be easy enough for me to add code to deal specifically with these two stops. (I think the “real” Right Way to do this would be to have a call intersections.getList that returns Code:{
"stat": "ok",
"intersections": [
{
"intersection_name": "U.S. 150 & Dale",
"code": "MTD5437",
"stops": [
{
"code": "MTD5437",
"stop_id": "150DALE:1",
"stop_name": "U.S. 150 & Dale",
"stop_lat": 40.114511999999998,
"stop_lon": -88.180672999999999
},
{
"code": "MTD5437",
"stop_id": "150DALE:3",
"stop_name": "U.S. 150 & Dale",
"stop_lat": 40.114502999999999,
"stop_lon": -88.180847999999997
}
]
},
{
"intersection_name": "Illinois Terminal",
"code": "MTD3121",
"stops": [
{
"code": "MTD7534",
"stop_id": "IT:1",
"stop_name": "Illinois Terminal (Platform A)",
"stop_lat": 40.115935,
"stop_lon": -88.240947000000006
},
{
"code": "MTD6462",
"stop_id": "IT:2",
"stop_name": "Illinois Terminal (Platform B)",
"stop_lat": 40.115971999999999,
"stop_lon": -88.240920000000003
},
{
"code": "MTD4217",
"stop_id": "IT:5",
"stop_name": "Illinois Terminal (Platform C)",
"stop_lat": 40.115363000000002,
"stop_lon": -88.241442000000006
}
]
},
// ...
]
}
but I don’t know whether the added complexity would be worth it in practice.) Cheers, Benjamin
|