logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Login


Options
View
Go to last post Go to first unread
darkery  
#1 Posted : Saturday, January 21, 2012 6:48:20 PM(UTC)
darkery

Rank: Member

Groups: Registered
Joined: 12/20/2011(UTC)
Posts: 19

some of the requests are missing certain key information that i think should also be supplied, and all of the requests don't tell you what you requested.

for each request there should be a parameters array listing all of the parameters that the server processed for your request (except maybe your apikey).
eg: i could request multiple shapes for some planned trip itinerary but when the server returns the shape points i have no idea which shape it is giving me let alone what route that corresponds to or how to color it.
since the data isn't loaded via some direct function call, but is loaded by some http request there can be a bit of lag time and it might come in different orders than requested. each time i get data it would be useful to know what precisely i asked for and am getting so i can use and display it accordingly.

currently i have to remove the existing data (eg times) i have displayed, go and change the (stop) label, request the new data (times), and once that goes through display the new data, hoping that whatever data i got last corresponds to the last label i set. i'd much rather leave the existing data and label up until the new data arrives and change them both at the same time, instead of worrying about the label not matching the data.

___

GetStopTimesByStop, GetPlannedTripsByLatLon, and GetPlannedTripsByStops need to tell me the date for the provided data in one up front easy to access location. there is also the issue of some requests use your 30hr clock and some only a 24hr clock, i doubt now would be the right time to address that.

GetDeparturesByStop, GetStopTimesByStop, and GetRoutesByStop should also supply the "stops" array that GetStop supplies namely: code stop_lat stop_lon and stop_name should all be provided for each baby stop_id. i shouldn't have to make a separate request to know the name and location of the stop im getting the times for.
GetStopTimesByTrip should also display the stop location and name for each stop, but instead of an additional stops array, that data would fit better in the existing stop_times array.

GetShape and GetShapeBetweenStops should list the direction and route_id(s??) that drive that shape, so it can be colored accordingly.
are there different route_id's that drive the same shape???

my understanding is each block consists of multiple trips. each trip has only one service_id and headsign. each service_id has only one shape_id which has only one direction and route_id. multiple service_id's can drive the same shape (eg night and weekend). multiple trip_id's can have the same service_id (eg 10 W at 4pm n 3pm).
correct me if im wrong??? (these terms are not clearly defined on the site)

what i don't understand about GetStopTimesByTrip is: why each stop time lists the trip info over and over again, the stop info(location and name) is what changes so that should be listed for each stop and the trip info should be at the same level as stop_times and listed only once to reduce the transmission size.

____

i use the json format and i extract the data i need using object oriented techniques i imagine other people use similar techniques for json and xml. in any event the techniques im familiar with should not affect any of the apps with regards to functionality if this additional info is also provided, seeing how they are most likely ignoring a bunch of the data and only extracting what they need (instead of removing the data they don't need).

so can you add this additional data or is there some sort of backwards compatibility thing that it would break???


Sean  
#2 Posted : Monday, January 23, 2012 2:07:44 PM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
Quote:
some of the requests are missing certain key information that i think should also be supplied, and all of the requests don't tell you what you requested.

for each request there should be a parameters array listing all of the parameters that the server processed for your request (except maybe your apikey).
eg: i could request multiple shapes for some planned trip itinerary but when the server returns the shape points i have no idea which shape it is giving me let alone what route that corresponds to or how to color it.
since the data isn't loaded via some direct function call, but is loaded by some http request there can be a bit of lag time and it might come in different orders than requested. each time i get data it would be useful to know what precisely i asked for and am getting so i can use and display it accordingly.

currently i have to remove the existing data (eg times) i have displayed, go and change the (stop) label, request the new data (times), and once that goes through display the new data, hoping that whatever data i got last corresponds to the last label i set. i'd much rather leave the existing data and label up until the new data arrives and change them both at the same time, instead of worrying about the label not matching the data.


We've talked about this before and we've been on the fence about it for a while, but we've decided to add this to v2.1. What do you think about the following format:

Code:
{
   "request":{
      "method":"GetShapeBetweenStops",
      "params":{
         "begin_stop_id":"blah",
         "end_stop_id":"blah",
         "shape_id":"blah blah"
      }
   }
}


Quote:
GetStopTimesByStop, GetPlannedTripsByLatLon, and GetPlannedTripsByStops need to tell me the date for the provided data in one up front easy to access location. there is also the issue of some requests use your 30hr clock and some only a 24hr clock, i doubt now would be the right time to address that.


StopTimes reference a service_id and are not directly associated with any one date in particular. I don't think there's anything to add on that method. The trip planner methods do have dates and times in each leg. Is that not sufficient?

Quote:
GetDeparturesByStop, GetStopTimesByStop, and GetRoutesByStop should also supply the "stops" array that GetStop supplies namely: code stop_lat stop_lon and stop_name should all be provided for each baby stop_id. i shouldn't have to make a separate request to know the name and location of the stop im getting the times for.


Can you make an argument why it's unreasonable to make two requests? I would guess most of the time you'll get the stop_id through one of the stop methods anyways. We've also made it very easy to cache relatively static information like stops using the changeset_id.

Quote:
GetStopTimesByTrip should also display the stop location and name for each stop, but instead of an additional stops array, that data would fit better in the existing stop_times array.


You're right. GetStopTimesByTrip should have the full stop and GetStopTimesByStop should have the full trip. We'll change this in v2.1.

Quote:
GetShape and GetShapeBetweenStops should list the direction and route_id(s??) that drive that shape, so it can be colored accordingly.
are there different route_id's that drive the same shape???


The route data is very small and should not be an issue to cache. Whatever method you are using to get the shape_id to make this request had to have provided the full trip object with the route_id or the route object itself.

Quote:
my understanding is each block consists of multiple trips. each trip has only one service_id and headsign. each service_id has only one shape_id which has only one direction and route_id. multiple service_id's can drive the same shape (eg night and weekend). multiple trip_id's can have the same service_id (eg 10 W at 4pm n 3pm).
correct me if im wrong??? (these terms are not clearly defined on the site)


The structure of our data is largely based on the GTFS. We've also provided a page with important definitions to try to make things a bit clearer. Yes each block consists of multiple trips, but keep in mind that a block represents what a physical bus does. If two trips have the same block_id, they will be serviced by the same vehicle. Yes each trip has only one service_id and headsign. I think you might be confused about service_ids. The service_id is used to define what days a given trip operates. Multiple trips with different shapes can reference the same service_id if they operate on the same days. Trips have a direction and belong to a route, not the service_id.

Quote:
what i don't understand about GetStopTimesByTrip is: why each stop time lists the trip info over and over again, the stop info(location and name) is what changes so that should be listed for each stop and the trip info should be at the same level as stop_times and listed only once to reduce the transmission size.


As I discussed above, we'll fix this.

Quote:
i use the json format and i extract the data i need using object oriented techniques i imagine other people use similar techniques for json and xml. in any event the techniques im familiar with should not affect any of the apps with regards to functionality if this additional info is also provided, seeing how they are most likely ignoring a bunch of the data and only extracting what they need (instead of removing the data they don't need). so can you add this additional data or is there some sort of backwards compatibility thing that it would break???


We'll release a v2.1 with a different URL to ensure no one has issues. While hope everyone is using some sort of OO method of deserializing the data, we can't make any assumptions.

Edited by moderator Monday, January 23, 2012 2:10:45 PM(UTC)  | Reason: formatted json

darkery  
#3 Posted : Wednesday, January 25, 2012 1:50:44 PM(UTC)
darkery

Rank: Member

Groups: Registered
Joined: 12/20/2011(UTC)
Posts: 19

adding that params object would answer/~address my date request. [it is the ~four hours after midnight which is what i'm worried about. for the scheduled times you ask for the info for the day before and it will tell you times like 25:27, but for the trip planar you ask for the official date and it says times like 01:27.]

for the stops array request for GetDeparturesByStop, GetStopTimesByStop, GetStopTimesByTrip, and GetRoutesByStop: when i make those requests i probably have the info for the mother stop, it is the name and lat n lon info for each of the baby stops that i don't have and hence want, so i can tell the user where to stand for each specific bus. [this is one of my major griefs about the cumtd n google interfaces, that they do not say/distinguish which corner/spot (baby stop) to stand at (unless you already know the baby stop's code and only asked for its times)].
i try to minimize the number of http requests. if i have to make two requests to get that info then i cannot display it at the same time at which i display the time information, and then there is the whole issue of if i ask for the stop info first and then the time info then i may get them in the opposite order. it is a small amount of crucial info that should be included w/ the data. you only need to include one stop array (at the same same level as the stop_times/departures array) instead of repeating it for each time. where as storing the info for all the stops takes up 300+kB, and i would prefer not using that much of the user's memory.
Sean  
#4 Posted : Friday, January 27, 2012 8:37:01 AM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
By the way, we just made an update to the website last week to tell users what corner the bus is stopping at. You should check it out.

I'm not sure I understand why requesting them in a certain order matters? If you make both requests asynchronously and simultaneously, they can come back in either order. Then you can just check that you have both sets of data before moving on.

What platform are you working on? I both iOS and Android allow you to use SQLLite for persistent storage. Have you considered using that?
darkery  
#5 Posted : Friday, February 3, 2012 1:55:48 AM(UTC)
darkery

Rank: Member

Groups: Registered
Joined: 12/20/2011(UTC)
Posts: 19

for v2.1
please return the stop_id value in the stop_times array for GetStopTimesByStop
you guys finally distinguish the baby stops but then you remove them from GetStopTimes???
i want to tell the user where to stand!! especially when they choose the mother stop!!
and this is now impossible for scheduled times in v2.1, but was possible in v2.0
seeing how the changelog didnt mention this i hope it was just an accident

as for GetStopTimesByTrip, i was not requesting that you completely remove the trip array/object.
i was only suggesting that if that info didnt change then you could only supply it once
[at a higher level] instead of over and over for every stop.
[but at least this info is still accessible via an additional request]

something has screwed up GetShapeBetweenStops
Code:
http://developer.cumtd.com/api/v2.1/json/GetShapeBetweenStops?shape_id=100SLTNT->&begin_stop_id=PLAZA:3&end_stop_id=1STSTDM:4

i keep getting "code":400,"msg":"begin_stop_id is required"
, but that param is clearly provided,
[the problem is not the "100SLTNT->" i get this error no matter what i request]
Sean  
#6 Posted : Monday, February 6, 2012 10:45:03 AM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
Sorry about GetStopTimesByStop! We've added the stop_id back into that method. We are going to keep the trip out of GetStopTimesByTrip for the time being. Also, we fixed GetShapeBetweenStops. That was definitely a goof on my part.
Users browsing this topic
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.