API Questions and bugs

45 views
Skip to first unread message

David Holmes

unread,
Feb 8, 2012, 4:22:58 PM2/8/12
to mtadeveloperresources
I have some questions about the API and the information in it.
{"Extensions":{"Distances":{"PresentableDistance":"3 stops
away","DistanceFromCall":736.9120593024927,"StopsFromCall":
3,"CallDistanceAlongRoute":6440.512756872253}},"StopPointRef":"MTA
NYCT_200318","VisitNumber":1,"StopPointName":"CASTLETON AV - SHARPE
AV"}

what does distancefromcall mean that's how far it is from the stop in
feet, inches..etc??
what does CallDistanceAlongRoute mean?


Bugs
How are your queries to the database made?
is it done like select * from buses where date is less than 30 seconds
old?
I ask because I remember we talked about if there is no verizon
service it can't call back to the servers.. and the API won't pick up
the bus. If lets say for example it passes by a deadspot does the api
automatically select the last one of the bus or only if the bus
reported to the servers in the last 30 seconds because it seems like
when the bus can't contact the server the route doesn't get put into
the API even though it is active.

Are the Routes sorted in any way?
If I check all active routes along lets say the S44 Going towards
Yukon it will give me the results
WALKER ST - TRANTOR PL
RICHMOND AV - FOREST ST
HENDERSON AV - BARD AV

Now if I refresh the page it would look like

RICHMOND AV - FOREST ST
HENDERSON AV - BARD AV
WALKER ST - TRANTOR PL

and if I refresh again it would be
WALKER ST - TRANTOR PL
HENDERSON AV - BARD AV

RICHMOND AV - FOREST ST



It's not ordered and it makes it hard to do what I want to do. Is
there some sort of special way you sort the results ?

Frumin, Michael

unread,
Feb 9, 2012, 8:56:58 AM2/9/12
to mtadeveloperresources
David, thanks for the inquiry.

DistanceFromCall means the distance that the bus is from the stop, linearly referenced along the route, in meters.

CallDistanceAlongRoute means the distance the stop is from the beginning of the route, linearly referenced, in meters.


As to what happens when we don't get GPS data for a brief period from a particular bus -- we continue to report its location at the last location it sent in. The timestamp of the last observation is part of the SIRI API (RecordedAtTime I think). In the customer-facing UI's, we:
1. report the data as "old" if we haven't gotten an update in more than some configurable threshlod (2 minutes I believe)
2. stop showing the bus if we haven't gotten an update in more than some configurable threshlod (5 minutes I believe)


As for your question about Routes, how they are sorted, etc. I don't really understand what you are asking. Some more specifics would be good. For example, the URL of the particular page you are looking at or API call you are using.

Thanks,
Mike

David Holmes

unread,
Feb 10, 2012, 11:03:38 AM2/10/12
to mtadeveloperresources
thanks for the fast response! . and never mind about the sorting
question .. I resolved my issue.
Reply all
Reply to author
Forward
0 new messages