Jump to content
sammi

PocketTrack (formerly SammDOT Tracker)

Recommended Posts

I guess it's about time I make a thread about the tracker, since everyone in the GTA board seems to know about it. :P In this thread would be discussion about the tracker specifically, i.e. not that, for example, 73xx was spotted on the tracker etc. I'll start by answering some questions from elsewhere in the forums.

http://tracker.sammdot.ca/4418 (http://ttca.sammdot.ca/ttc-track.html?4400) tracks exactly one vehicle, and zooms right to its location in the city.

http://tracker.sammdot.ca/4400,4402-4418 (http://ttca.sammdot.ca/ttc-track-multi.html?4400,4402-4417) can track groups of vehicles, as long as you specify ranges in the right form (using , and -). This one shows a zoomed out view of the entire city, and has one marker for each trackable vehicle (note that some vehicles you specify may not be trackable), which you can click to provide more info on each vehicle, like what route it's on and when it last reported.

(This last bit of information can be a bit buggy; sometimes it displays as "Last seen in a few seconds", which obviously doesn't make sense.)

On 03/01/2016 at 6:04 PM, PCC Guy said:

It's not in a completed stage at this point, but one thing that it has that other trackers don't is the ability to track vehicles that are out of service. This includes ones that are on runs that Nextbus lacks, as according to the system it would be de facto out of service. This tracker alerted me to 4227 trolling around the 510 today, which was not picked up by TransSee.

On 03/01/2016 at 7:45 PM, Xtrazsteve said:

I'm curious, do you know where is your friend getting the information feed for these out of service vehicles? Is it from nextbus or she has a source from the TTC?

The out of service vehicles are tracked on NextBus still, just without route numbers or any such information that would be associated with a service vehicle. This was, in fact, the main motivation for me to write the tracker. I was introduced to TransSee by PCC Guy, and while I liked the idea of it, I did not appreciate the lack of out of service vehicles.

On 03/01/2016 at 8:43 PM, nfitz said:

Hmm, is it caching old information off-line?

Yup. Retrieving the location of a certain vehicle would also return the last time it reported its location. This is part of the NextBus output; my tracker is just displaying the results.

On 06/01/2016 at 5:42 PM, 7879 said:

I've played around with it and it seems pretty neat. Unfortunately there are all sorts of weird results where you'll "find" buses in random locations like Barrie or the middle of lake Ontario

This is a result of imprecise data outputted by NextBus. I noticed, while studying raw data for this project, that some vehicles would report a location like (43.0, -79.0), which is the right location with the decimal part cut off, hence why it shows in the middle of the lake, or some other location it shouldn't be. That's an issue with the NextBus output, and the same should happen for every app that uses it.

On 09/01/2016 at 11:45 PM, ttc rider said:

Has anyone explained how this tracker works? What database does it query?

It was the only online app that was actually accurate earlier this week, before the nextbus feed was corrected and all predictions on 501/509/510/504 (and whatever other routes that got new schedules this board period) were wildly inaccurate.

It still queries the same NextBus feed as every other app; the difference is that it tracks particular vehicles (specifically, the ones you tell it to), and doesn't query predictions. This last part is the most important one.

NextBus's predictions depend on schedule-based calculations, so when TTC broke the schedules, predictions were completely off. The tracker, since it doesn't care about predictions, can still track locations of vehicles just fine.

On 09/01/2016 at 11:45 PM, ttc rider said:

I am tracking the new streetcars now and it shows 4401 at Leslie and 4415 at Roncesvalles. What kind of magic has the author of that app wrought here?

If they're not in service, they don't show up on any other tracker. :D Once 4418 has its location reporting unit installed, it can be trackable even without it going in service just yet.

  • Like 3

Share this post


Link to post
Share on other sites

I'm just curious what link do you use to get the XML that would display an out of service vehicle like 4401? It's never assigned on a route.

Thanks for creating the tracker, it's awesome!

Share this post


Link to post
Share on other sites

Thanks! :)

I'm just curious what link do you use to get the XML that would display an out of service vehicle like 4401? It's never assigned on a route.


I actually use the JSON feed; it takes up less bandwidth (which is important since the NextBus API has a quota), but the information should be exactly the same.

As for the actual command, it's called vehicleLocation. I'd like to get run number information out of that though, but that only exists for predictions. :/

Share this post


Link to post
Share on other sites

Thanks! :)

I actually use the JSON feed; it takes up less bandwidth (which is important since the NextBus API has a quota), but the information should be exactly the same.

As for the actual command, it's called vehicleLocation. I'd like to get run number information out of that though, but that only exists for predictions. :/

With the XML links, vehicleLocation never returns vehicles without run assignments.

you can see that 4401 is no where to be found: http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=ttc&t=0

Run numbers seem to be only founded with stop predictions but each stop only shows 5 predictions max. It would take multiple fetches from different stops for a busy route.

Share this post


Link to post
Share on other sites

As for the actual command, it's called vehicleLocation. I'd like to get run number information out of that though, but that only exists for predictions. :/

Ah ... that's what baffled me. vehiclelocation as opposed to vehiclelocations. Didn't know about that. And undocumented on the Nextbus feed documentation in http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=4427790e6f21d210VgnVCM1000003dd60f89RCRD

I wonder what other undocumented commands there are ...

Share this post


Link to post
Share on other sites

Ah ... that's what baffled me. vehiclelocation as opposed to vehiclelocations. Didn't know about that.

I was also surprised that this wasn't in the documentation... It seemed obvious, that if there was a vehicleLocations command for all vehicles, there should be a vehicleLocation command for one. (Similarly, that a JSON feed existed aside from the XML feed.)

Next stop for me, though, is tracking subway trains. I know where to get the data, and I know where to look for the particular information I need from that feed, I just haven't gotten around to doing it yet.

Share this post


Link to post
Share on other sites

Ah ... that's what baffled me. vehiclelocation as opposed to vehiclelocations. Didn't know about that. And undocumented on the Nextbus feed documentation in http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=4427790e6f21d210VgnVCM1000003dd60f89RCRD

I wonder what other undocumented commands there are ...

You final have an answer now. I know you wanted to know too.

Share this post


Link to post
Share on other sites

Next stop for me, though, is tracking subway trains. I know where to get the data, and I know where to look for the particular information I need from that feed, I just haven't gotten around to doing it yet.

Tease!

You final have an answer now. I know you wanted to know too.

Not sure your point, I think I mentioned it once or twice ages ago. I just assumed it was caching stuff forever, and it was the last location, using the vehiclelocations command, done for each route. But I'd never looked at the site that closely, to realise that couldn't be the case.

Share this post


Link to post
Share on other sites

The tracker is available at two URLs:

http://ttca.sammdot.ca/ttc-track.html?4400 tracks exactly one vehicle, in this case 4400, and zooms right to its location in the city.

http://ttca.sammdot.ca/ttc-track-multi.html?4400,4402-4417 can track groups of vehicles, as long as you specify ranges in the right form (using , and -). This one shows a zoomed out view of the entire city, and has one marker for each trackable vehicle (note that some vehicles you specify may not be trackable), which you can click to provide more info on each vehicle, like what route it's on and when it last reported.

(This last bit of information can be a bit buggy; sometimes it displays as "Last seen in a few seconds", which obviously doesn't make sense.)

Hi Sammi, thank you for this tracker you have created! I'm always getting a positive feedback from others.

Here, for example - I can track down vehicles from their respective divisions like for example:

Wilson: http://ttca.sammdot.ca/ttc-track-multi.html?1511-1512,1514,1519,1523,1534,1545,1550,1554,1559,1561,1574,1579,1664-1689,1700-1702,1706,1714,1732,1751,1789-1791,1795-1797,1799-1826,1828-1829,8146,8149,8159,8167-8219,8300-8334,8335-8396,9000-9026,9027-9053

Birchmount: http://ttca.sammdot.ca/ttc-track-multi.html?7700-7882,8100-8145,8147-8148,8150-8158,8160-8166

New Eglinton: http://ttca.sammdot.ca/ttc-track-multi.html?7400-7699

What do you guys think? It slows down Chrome a bit so it should be fixed to make it more faster.

Share this post


Link to post
Share on other sites

What do you guys think? It slows down Chrome a bit so it should be fixed to make it more faster.

Didn't anyone teach you manners? That's not how you should be asking.

It's not probably not even the trackers problem but your computer. Maybe a version of the tracker that updates every 30 seconds would help if you track 300 buses at one time.

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, 21 Brimley said:
What do you guys think? It slows down Chrome a bit so it should be fixed to make it more faster.

Slows down Chrome? Surely in the background his computer has to run about 200 queries to Nextbus to run your suggested commands. I can't see it's anything to do with chrome!

  • Like 1

Share this post


Link to post
Share on other sites
On 02/04/2016 at 0:57 PM, 21 Brimley said:

It's slow because you're tracking hundreds of vehicles...... The tracker requests updates every second, and doing that for 300 buses means downloading 1.7 MB of data per second, and then displaying all that data in real time? That would definitely slow down most computers.

I mainly use the range feature for things like tracking the SIG CLRVs (4000-4004), or the Flexity fleet (4400,4402-4417). I don't typically go much larger unless the computer I'm using is really good (the workstations at school could track the entire CLRV fleet no problem).

On 02/04/2016 at 2:39 PM, Xtrazsteve said:
It's not probably not even the trackers problem but your computer. Maybe a version of the tracker that updates every 30 seconds would help if you track 300 buses at one time.

I'm thinking of adding a parameter in for the frequency of requests, so maybe it doesn't have to update too often. We'll see when I have time.

Share this post


Link to post
Share on other sites
1 hour ago, MiWay1137 said:

The tracker seems to have been down for a few days now.

Up now. Up a couple of hours ago, Up Friday.  I noticed it was down yesterday - but I'd expect that running on someone's computer ...

Share this post


Link to post
Share on other sites
2 hours ago, nfitz said:

Up now. Up a couple of hours ago, Up Friday.  I noticed it was down yesterday - but I'd expect that running on someone's computer ...

We've been having issues with our internet connection at home, since we just changed it recently. The modem has been cutting out a lot, and our IP keeps changing... I'll move it to a server elsewhere to make it more stable.

Share this post


Link to post
Share on other sites

Update!

The tracker has been moved to another server, one that isn't running from home so it shouldn't go down every 3 days or so. Both single-vehicle and multi-vehicle tracking are available at the same place, so now you don't have to choose between ttc-track.html/track.html and ttc-track-multi.html/track2.html.

http://tracker.sammdot.ca/4418

http://tracker.sammdot.ca/4400,4402-4418

In addition, if you're a certain Scarborough bus route and want 30-second updates so as to not slow down your browser when you track entire fleets from a division, you can now add to the end of the URL the number of seconds you want for headways update intervals.

http://tracker.sammdot.ca/4400,4402-4418?10 updates every 10 seconds. Minimum is 5, and if you don't specify it the default is also 5. (I decided 1 second updates was unnecessary since it would be in roughly the same location anyway.)

  • Like 4

Share this post


Link to post
Share on other sites

TTC should publish their data in GTFS-realtime format, like YRT does. It's much easier to work with, and the run numbers would probably match. -_-

Share this post


Link to post
Share on other sites
20 minutes ago, sammi said:

Due to some unfortunate circumstances involving a particularly high volume of tracking requests, I have decided to implement a login system for the tracker. You can see the instructions at http://tracker.sammdot.ca/about to sign up for the service.

I feel like this is my fault :( I made a lot of requests over the past month or two...

Share this post


Link to post
Share on other sites
3 minutes ago, TransitfanJas0n said:

I feel like this is my fault :( I made a lot of requests over the past month or two...

It was probably much heavier than that; I don't think it's something one person could have done. Don't worry about it.

Share this post


Link to post
Share on other sites

Update!

I've implemented a bunch of new features for the tracker. :D Specifically:

  • Information on each vehicle's division (garage/carhouse) is now incorporated in the tracker. The markers (arrows and dots) are now colored differently depending on the division, and clicking on the marker will show that too. The different garages and carhouses (including Hillcrest) are also outlined on the map for reference. (Note that Russell and Leslie are the same color, since Leslie is technically part of Russell division.)
  • You can now also show all vehicles on a route, or all vehicles in a division.

See http://tracker.sammdot.ca/about for more information.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×