MTD Developer Forum
»
API
»
General Discussion
»
Is there an API that lets me to fetch the shape of a route provided?
Rank: Newbie
Groups: Registered
Joined: 9/23/2013(UTC) Posts: 4 Location: Champaign
Thanks: 2 times
|
Hello, I was making an app which let users to browse through specific routes and it shows the shape on Google Maps. I want it to show the shape of the route for both directions (for regular buses), and currently I have been using GetRoutes to get every routes, and then I put the route_id into GetTripsByRoute to get the trips, and then I put the trip_id into GetShape. The problem is GetTripsByRoute is showing every single routes including routes on special days/times, and I can't separate the directions. Is there any way I can fetch the shape of both direction on normal days? Thanks! Edited by user Monday, September 23, 2013 9:29:03 PM(UTC)
| Reason: N/A
|
|
|
|
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)
|
Hi Derek,
That's a really tough question to answer; It's a complexity of our system that I have been trying to deal with myself for some time. The problem is defining what actually makes up a route. The maps we show in the schedule book are created by our planners to show a snapshot of the "average" route, but on any given day (even regular weekdays) a bus will deviate significantly from that route for some trips. The data has to account for all of these deviations and exceptions and currently there's no way for us to distinguish on the back-end between regular trips and shapes and deviations.
The result of this is that if you display every shape for every trip on a route you are going to get a jumbled mess. Unfortunately, I don't have a great suggestion for you to get around this. One idea that I have kicked around in the past is to do some sort of analysis on how many times each shape is used on a route. Presumably the ones that are used often are going to be "regular" shapes and the ones that are only used once or twice are going to be some sort of deviation. I haven't actually tried this so I have no idea how it would actually work, but it seems like it may be a way to get a decently accurate snapshot of a route.
Sorry I couldn't be more help,
Ryan
|
1 user thanked Ryan for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/23/2013(UTC) Posts: 4 Location: Champaign
Thanks: 2 times
|
Thanks for the suggestion. Here's my plan: I am going to record the two most frequently appeared routes and assume them as the north/south or east west bound route. I will test it out and see if it works. Thanks!
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/23/2013(UTC) Posts: 4 Location: Champaign
Thanks: 2 times
|
It works perfectly. Here's a screenshot: (Sorry but I don't know how to make it smaller.)
|
|
|
|
MTD Developer Forum
»
API
»
General Discussion
»
Is there an API that lets me to fetch the shape of a route provided?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.