

Live map of SF MUNI - vikrum
http://www.sflivebus.com

======
Florin_Andrei
Awesome!

Now, nitpicking: When the badges move, the speed is not realistic. Of course,
that's only natural, because it's just an update to its new position, it's not
actual motion. But it's still jarring to see buses zooming across 3 blocks in
5 seconds. :)

Would it be possible to visualize the position update in a different way, to
better suggest it's just a position update, not actual motion? I'm thinking,
leave the badge in its old place temporarily, make a new badge that moves
quickly to the new place, and leave a faint low-contrast or transparent
"trail" connecting the two. Once the new badge is in the updated position,
remove the old badge and the trail.

Basically, the whole transition should be much quicker, and clearly indicate
it's an update, not actual motion.

~~~
t413
Replicate the functionality of transloc (try ncsu.transloc.com) and it'll be
golden. Filtering routes and visible route paths!

~~~
dsl
This is called dead reckoning[1]. Given the previous two locations you can
tell the speed. Since you know the route the bus will take, you just plot it
where it would be if it never stopped moving since the last update. It's
pretty close 90% of the time.

1\. <http://en.wikipedia.org/wiki/Dead_reckoning>

~~~
w-ll
I'm not sure if the're using dead reckoning. I just saw one turn. To me this
looks more like gps.

Also, Go Wolf Pack!

~~~
dsl
As I said, if it is something like a bus where the route is known, dead
reckoning is still effective.

Even with GPS you usually only get location updates every few seconds, DR
fills in the "smoothness" between updates.

------
kijeda
This map would be more useful if instead of each bus being represented by a
nondescript MUNI logo, that it was an icon that contained the route number. As
it stands it appears the only way to get useful information is to hover over
each logo to work out what it represents.

~~~
vikrum
Just merged in a pull request from @templaedhel on GitHub—take a look now.
Thanks for the feedback!

~~~
newman314
It would be nice to be able to select just one bus/train so that I can see
when/where the next bus is.

------
jstrate
I guess this gives nice visualization to the deplorable state of Muni. Right
now I see nine L trains clustered basically on top of each other in the
Sunset.

Maybe one between market and West Portal and one on market near Embarcadero. I
take the J and as usual I see independent cars running outbound right next to
each other with unusually large and sporadic gaps between them.

Hard to believe $820 million for such a shitty service.

~~~
drstewart
This is actually an inherent side-effect of any transit system:
<http://en.wikipedia.org/wiki/Bus_bunching>

------
mikeyouse
<http://i.imgur.com/ENRtQBs.png>

7 N-Judahs within 10 blocks of each other? Checks out.

~~~
khuey
It looks like each car of a two-car train shows up separately?

But yeah, totally believable ;-)

~~~
dsl
Yup. Two car trains for some reason are a hack into pretty much every part of
MUNI's systems. Thats why in the underground stations you used to hear "N N in
3 minutes." The audible announcements have since been updated, but the old
arrival displays that show the screenshot of the control center computer (the
squares on the teal lines) still show two car trains the same as two different
trains very close together.

------
jessriedel
This is possible because of the NextBus API, where apparently NextBus is a
private contractor used by many cities solely to provide this info.

If you click on "Select your transit system" on the NextBus website and scroll
down for NYC, you'll see that the MTA's Brooklyn, Staten Island, and Brox
services are covered (as well as the private "Downtown Connection" bus service
in lower Manhattn) but that the normal MTA Manhattan service isn't covered.
Does anyone know why? Maybe it's just in the process of being rolled out?

<http://www.nextbus.com/predictor/agencySelector.jsp>

~~~
thrownaway2424
MTA has "bus time" which is not like nextbus in three important ways:

1: it is not a scam run by money grubbing jackasses to keep public data for
private profit. 2: it is built entirely from open source software, and all the
data is accessible with an open api.

3: the predictions are not a pack of lies.

<http://bustime.mta.info/wiki/Developers/Index>

~~~
jessriedel
Does a reasonable phone app utilize this yet?

------
haugstrup
It's easy to make a live map of Muni busses because they are hardly ever
moving.

~~~
gojomo
You don't even need an animated GIF! A single JPG is enough!

------
drinkzima
Love this, to chime in with suggestions, something with color indicating
inbound/outbound would be awesome for seeing through some of the noise. Love
the line selection idea as well.

~~~
vikrum
Just pushed an update to show inbound and outbound. Thanks for the suggestion!
:)

------
steffan
Do you have any examples of how you're populating Firebase from the SFMuni
APIs?

~~~
masonhensley
I think this is these are his data sources:

agency list:
[http://webservices.nextbus.com/service/publicXMLFeed?command...](http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList)

route list:
[http://webservices.nextbus.com/service/publicXMLFeed?command...](http://webservices.nextbus.com/service/publicXMLFeed?command=routeList&a=sf-
muni)

vehic location :
[http://webservices.nextbus.com/service/publicXMLFeed?command...](http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=sf-
muni&t=1362432121000)

=====

Check out line 37: [https://github.com/firebase/firebus/blob/gh-
pages/nextbus/fi...](https://github.com/firebase/firebus/blob/gh-
pages/nextbus/firebus-populator.js)

~~~
steffan
Thanks! I missed that on the first pass

------
mindblink
When I traveled in Oslo, the excellent bus system had stops with realtime
arrival information. Wonder if this can't be bootstrap into a similar system.
(And an aside: Why oh why can't we have the same thing in SF?) Some examples
below: <http://www.flickr.com/photos/54493673@N00/388240155/>
<http://www.flickr.com/photos/21779731@N07/4876550088/>

~~~
rdouble
Muni does have that...

------
dannyobrien
Also great is QuickMuni, an open source Android app with a really nice UI
(including live maps) --
[https://play.google.com/store/apps/details?id=com.worldofbil...](https://play.google.com/store/apps/details?id=com.worldofbilly.quickmuni&hl=en)

(No connection to the developer, though he spoke at Noisebridge's Five Minutes
of Fame recently)

------
peter_l_downs
This is fantastic! Althought the "MUNI" marker is nice, I think a smaller icon
(maybe with a direction?) would make it easier to use.

~~~
anant
Someone already made a pull request to add this. I <3 Open Source!
<https://github.com/firebase/firebus/pull/1>

------
pla3rhat3r
This would be awesome to pair this up with Twilio SMS so you know when your
bus is just a few blocks aways from your location.

------
raldi
Cool!

Is there any way to filter it down to a single transit line?

~~~
vikrum
No not yet—the actual route/path information is currently decoupled from the
views and animations. Probably shouldn't be too difficult pull the information
for published routes as well as do some processing on historic movement. Pull
requests gladly accepted :)

------
sachinag
Why isn't the iOS app compatible with the iPhone 4? Is it really that
processor-intensive?

~~~
dsl
I just downloaded the iOS app, and you aren't really missing much. It looks
like a proof-of-concept for using Firebase SDK, not a real intended for users
app.

Crashed twice within the first few minutes, just a bunch of pins floating
around SF with no indication of route, etc.

------
rockdiesel
Is it possible to add Golden Gate Transit buses to the map?

------
Macsenour
How about a color change if it's on time or late?

~~~
vegashacker
MUNI buses, except perhaps first thing in the morning, are essentially never
on time. You can't go by any published schedule (which I assume is why Google
Maps predictions are essentially random numbers)--you have to go by the
NextBus real-time data.

~~~
eridius
I don't think the concept of "on time" even exists for MUNI. The route may
have a defined start and stop time, but that's it. Throughout the day you can
get estimates of the average time between two busses on the same route, and I
have to assume that data is used to manufacture published schedules, but the
schedules don't actually represent anything real.

~~~
robbyking
You are correct. MUNI schedules are defined by bus frequency, not a timetable.
Trains/Buses come every 10 min from 7-9am (for example), every 15 min. from
9-11am, etc.

~~~
vegashacker
So what data is Google Maps using for its predictions then? It's definitely
not the same as nextmuni (at least last time I checked), and in fact seems
much worse. I had always assumed there was a schedule and that Google was
using it.

~~~
alukima
In some of the older bus stops there are approximate schedules. Before the
stop near my apartment was removed it seemed to match the data on Google maps.

Google maps is much worse than nextmuni. It's one of the first things I was
warned about when I moved here.

