Mapping the Charm City Circulator

60 views
Skip to first unread message

Mike Brenner

unread,
Feb 11, 2011, 2:18:43 PM2/11/11
to CIVIC HACK DAY
Inspired by http://MTA.me.

I was doing a bit of snooping around today and saw that the Charm City
Circulator has a real-time bus tracker » http://
www.charmcitycirculator.com/content/bus-tracker

This is powered (and IFRAME'd) by NextBus.com » http://www.nextbus.com/
googleMap/customGoogleMap.jsp?a=charm-city

Okay. Wanted to see if there was an API. There isn't one that's
public but found some articles referencing other cities that were
looking for an API. Plugged in "charm-city" into some provided links
and was able to grab some real-time info for Baltimore!

Check out this XML Feed. View source in your browser and hit refresh
to see the busses move!
http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=charm-city&r=orange&t=1144953500233

Here's the referring documentation from SF's MTA »
http://www.sfmta.com/cms/asite/nextmunidata.htm

Anyone interested in working with this tomorrow?

--
Mike B.

Jonathan Julian

unread,
Feb 11, 2011, 2:23:28 PM2/11/11
to civic-h...@googlegroups.com
I'd love to work on this, is the data any more reliable than it was
last fall? I've loaded up nextbus.com and stood on Light St (where I
could see many stops) and the bus data was way wrong.

> --
> Event Info at: http://CivicHackDay.org
>
> You received this message because you are subscribed to the "Civic Hack Day" Google group.
> To post to this group, send email to civic-h...@googlegroups.com
> To unsubscribe from this group, send email to
> civic-hack-da...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/civic-hack-day?hl=en?hl=en
>

Mark Headd

unread,
Feb 11, 2011, 2:31:35 PM2/11/11
to civic-h...@googlegroups.com
Yes!

That's awesome. Nice find!

I think that in some other cities that use NextBus there has been some ambiguity about "ownership" of the data feeds for real time transit.  The question has arisen as to wether the transit authority/ municipality has ownership, or NextBus.  Don't know if these issues have been sorted or not, but it might be worth reaching out to some other places that use real time feeds from NextBus - http://www.eot.state.ma.us/developers/realtime/ .

The folks at OpenPlans might also be able to provide background and info. on this as well.

Mark

Ian Hunter

unread,
Feb 11, 2011, 2:34:24 PM2/11/11
to civic-h...@googlegroups.com
This sounds like a cool project.

We can make an API, there's lots of scraping tools out there.  Cache the results of a backend scrape and provide that as results for the query.  Of course a real API would be preferred.

For me, a mobile app showing where you are and where public transportation is would be great.  Like how Uber shows the position of your cab, you could see circulators moving around you and their ETA.

-ian

Mike Brenner

unread,
Feb 11, 2011, 4:02:09 PM2/11/11
to CIVIC HACK DAY
NextBus Public XML Feed Documentation » http://www.nextbus.com/
xmlFeedDocs/NextBusXMLFeed.pdf (hat tip to Myke N.)

--
Mike

On Feb 11, 2:34 pm, Ian Hunter <ianhun...@gmail.com> wrote:
> This sounds like a cool project.
>
> We can make an API, there's lots of scraping tools out there. Cache the results of a backend scrape and provide that as results for the query. Of course a real API would be preferred.
>
> For me, a mobile app showing where you are and where public transportation is would be great. Like how Uber shows the position of your cab, you could see circulators moving around you and their ETA.
>
> -ian
>
>
>
>
>
>
>
> On Friday, February 11, 2011 at 2:31 PM, Mark Headd wrote:
> > Yes!
>
> > That's awesome. Nice find!
>
> > I think that in some other cities that use NextBus there has been some ambiguity about "ownership" of the data feeds for real time transit. The question has arisen as to wether the transit authority/ municipality has ownership, or NextBus. Don't know if these issues have been sorted or not, but it might be worth reaching out to some other places that use real time feeds from NextBus -http://www.eot.state.ma.us/developers/realtime/.
>
> > The folks at OpenPlans might also be able to provide background and info. on this as well.
>
> > Mark
>
> > On Feb 11, 2011, at 2:18 PM, Mike Brenner wrote:
> > > Inspired byhttp://MTA.me.
>
> > > I was doing a bit of snooping around today and saw that the Charm City
> > > Circulator has a real-time bus tracker » http://
> > >www.charmcitycirculator.com/content/bus-tracker
>
> > > This is powered (and IFRAME'd) by NextBus.com »http://www.nextbus.com/
> > > googleMap/customGoogleMap.jsp?a=charm-city
>
> > > Okay. Wanted to see if there was an API. There isn't one that's
> > > public but found some articles referencing other cities that were
> > > looking for an API. Plugged in "charm-city" into some provided links
> > > and was able to grab some real-time info for Baltimore!
>
> > > Check out this XML Feed. View source in your browser and hit refresh
> > > to see the busses move!
> > >http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleL...

Ray Wenderlich

unread,
Feb 11, 2011, 6:34:47 PM2/11/11
to CIVIC HACK DAY
Hey guys,

I put together a couple quick proof-of-concept iPhone apps to start
experimenting with some of this data:

* First one plots the bus routes on an iPhone app, updates positions
periodically, using the NextBus API found by Mike B:
http://www.raywenderlich.com/downloads/BusApp.png

* Second one plots schools (or whatever) near your current location
using Mark H's GeoCouch setup (which is indeed nice & easy to work
with): http://www.raywenderlich.com/downloads/GeoApp.png

These are just proof-of-concepts at this point, looking forward to see
where we can take all of this tomorrow,

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mark Headd

unread,
Feb 11, 2011, 7:05:37 PM2/11/11
to civic-h...@googlegroups.com
Nice! Looking forward to chatting more about those tomorrow.

Mark

Ray Wenderlich

unread,
Feb 12, 2011, 12:17:11 PM2/12/11
to CIVIC HACK DAY
Hey all,

Just wanted to give you an update on this. Michael Barr, James
Schaffer, and I did a little more investigation into NextBus (the
company that provides the bus data), and found good news and bad news:

Good news: It looks like the company provides a lot more than just the
Charm City Circulator routes, full list here, so an app could
theoretically display data from any of them: http://www.nextbus.com/predictor/agencySelector.jsp

Bad news: NextBus already has its own iPhone app (for DC only oddly),
and also appears to have entered into legal disputes with other
developers who have tried to use NextBus data in iPhone apps, and the
apps have been pulled from the App Store. Links:

* http://itunes.apple.com/app/nextbus-dc/id322559739?mt=8#
* http://sfappeal.com/news/2009/06/who-owns-sfmta-arrival-data-comments.php

So it seems like using the NextBus data is a no-go, at least until
some of these issues get worked out.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

On Feb 11, 7:05 pm, Mark Headd <mhe...@gmail.com> wrote:
> Nice! Looking forward to chatting more about those tomorrow.
>
> Mark
>

Nate Mook

unread,
Feb 12, 2011, 1:48:53 PM2/12/11
to civic-h...@googlegroups.com
Hi Ray,

Looks like your data is outdated. Routesy is back on the App Store and
was last updated Dec 2:

http://itunes.apple.com/us/app/routesy-pro-bay-area-san-francisco/id284950244?mt=8&ign-mpt=uo%3D4

Moreover, if you read the SF article, it appears they called the bluff
of the company and they didn't actually take any legal action. Muni in
SF also said it was happy with developers using the NextBus data.
NBIS, which threatened the Routesy developer, is actually a completely
separate company from NextBus.

I don't think there's any reason to worry about using the data.

- Nate

Ray Wenderlich

unread,
Feb 12, 2011, 2:27:02 PM2/12/11
to civic-h...@googlegroups.com
Awesome, that is good to know! Thanks Nate for clearing that up! :]

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

James Schaffer

unread,
Feb 13, 2011, 6:42:08 PM2/13/11
to civic-h...@googlegroups.com
Wanted to share this with everyone...

On Saturday a lot of people were talking about working with the Circulator bus location feed. As amazing as it would be to have that functionality the Circulator only serves a very small section of the Baltimore community and in my opinion there are some essential services we are missing from the MTA.  Not sure if people are aware but the Circulator is not part of the MTA but a city funded effort to consolidate certain routes and as a result its reach is limited.  Recently I decided to attempt to use the MTA for my travel from Charles Village to Tide Point for work and struggled to find the best route.  I went to the MTA site and hoped to have the ability to experiment with various routes.  What I learned was extremely frustrating, the MTA does not have an HTML based subway map (just a PDF wrapped inside a Flash based UI) or a mobile friendly option.  Here is what Baltimoreans do have...

1. Google maps - however you need to give very specific directions, provide a point A and a point B.  You cannot view entire routes and create complicated trips that reflect the realities of various transfer issues (ie certain routes running on schedule better than others).
2. PDF exports of the route maps
3. PDF of entire route map which is a complete and utter joke once the routes get downtown and are layered on top of each other.

These are really not suitable options. Luckily after some tweeting with the MTA they showed me the link for the download to their data feed that powers the Google public transit searches (at the bottom of this email).  I was curious if anyone had the ability to work with this data and spit out a mobile friendly map that allows users to turn on and off various routes.  My background is with UI so my abilities are somewhat limited but I really believe that the people of Baltimore need this and doubt the MTA is up to task.  Just throwing it out there, please feel free to give a shout if you have any desire to work with me on this.

City of Montreal has something similar here for their subway:
file://localhost/Users/jamesschaffer7/Downloads/montrealmetromap.html

Data feed:

Thanks
James

Mark Headd

unread,
Feb 14, 2011, 10:45:08 AM2/14/11
to civic-h...@googlegroups.com
I wrote a series of blog posts abut using GTFS data to build mobile apps:


The first post and the second post in the series detail one strategy for getting this data into a relational DB (in this case, MySQL) and writing some procedures to query the data.

I also wrote another post that describes an application to map this data (source code included):


Hope this helps others get started with building apps that use GTFS data.  Please feel free to ping me if I can provide any additional code samples or if there are questions about the approach I described in these posts.

Cheers!

Mark

Ray Wenderlich

unread,
Feb 14, 2011, 7:33:01 PM2/14/11
to civic-h...@googlegroups.com
Cool find James! I took a brief look into the MTA data. I modified
Mark's script (thanks Mark!) to import the MTA data into a MySQL db
(which is in a slightly different format than the Delaware data). I
put the modified script here in case it's of use to anyone else:

https://gist.github.com/826849

I then wrote a quick and dirty PHP script to return the shapes that
correspond to a given bus route (for just the first trip match, it's
not doing anything smart with day of week etc.) and wrote an iPhone
app to query the script and plot the map data. Here's the map for MTA
route #1:

http://www.raywenderlich.com/downloads/MTAMap.png

Which is pretty similar to this:

http://mta.maryland.gov/services/bus/routes/bus/01map910.pdf

So looks like the data is usable!

Do you think an app like this would be useful to many people? It
could probably plot bus stops too, times of next arrivals, etc. We
should probably make sure that this hasn't been done already by
someone too, since in theory this could be a general GTFS viewer (i.e.
not just Maryland), and I'd be kinda surprised if no-one's thought of
it yet...

If this is worth proceeding on, probably best to start with "the
simplest possible useful thing" and go from there. I could handle the
iPhone programming side, but would need someone to help figure out
what the app's UI should be like (ideally someone who uses the MTA
regularly), and someone to develop a nice web service/API to make
querying the DB easy and import fresh data regularly.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mark Headd

unread,
Feb 14, 2011, 7:45:34 PM2/14/11
to civic-h...@googlegroups.com
Ray:

Awesome!  It might be worth finding out how frequently the MTA releases that data - hopefully its at least multiple times per year, so the app could stay relatively fresh.

It if helps, there is a similar app that was built for SEPTA in Philly (using their GTFS data)  - http://isepta.org/

This is obviously not a native app, but the UI is pretty good.  Thought it might provide some inspiration for someone figuring out how to rework the UI for a mobile MTA app.  I talked to the guys who did this a while ago, when the DE data first came out but I think Mike Brenner might know them fairly well, in case there is an interest in talking with them.  (Note - I think the iSEPTA app just cover regional rail schedules, not bus schedules.)

Cool stuff, Ray!

Mark

James Schaffer

unread,
Feb 15, 2011, 9:28:54 AM2/15/11
to civic-h...@googlegroups.com
I am not sure if there is any data outlining "who" rides the buses in Baltimore but I think it is fair to say there are two groups in need of an application.  The first is the rider of the bus as an option.  They may also bike or drive, and ultimately the MTA is not their primary mode of transportation.

The second group are those who are public transportation dependent.  There are many scenarios for this reason but some of the most common are: lack of car due to cost, student, elderly.  These people probably have limited access and or knowledge of using an app store.  (this is a major assumption on my end)

The motivation for this project was to create baseline for all citizens. I think every person in this town who has a computer, internet connection and a modern browser should be able to go on the MTA site and visualize every route.  There should be switches allowing people to filter on and off various routes.  You should be able to click on a station and open the daily schedule.  Something basic so even if you are a veteran bus rider, if you need figure out how to get somewhere on a map it is easier than juggling the wacky PDfs on the MTA website.

The second part of this app was the lower the barrier of entry for new riders.  People that move to Baltimore, myself included, often do not take the bus because reading the schedule is incredibly complicated.  Even the Google route mapper is flawed at times.  This is where the iPhone app is perfect.

I am more than willing to craft out some user interfaces for both examples I have cited.  

Ray, what you did with that PNG example was awesome and exactly what is needed for all the routes. Now all we need is a UI that allows the user to turn on and off various routes as a start.  Then we can introduce a UI that allows some sort of trip planning and schedule tables.  That make sense?

Mark, I been tweeting back and forth with the MTA regarding the data feed and can get an answer to that question.

Mark and Ray thanks so much for the interest, really appreciate it.  

James

Ray Wenderlich

unread,
Feb 17, 2011, 10:57:29 AM2/17/11
to civic-h...@googlegroups.com
So from what you're saying it sounds like what is really needed is a
web app that can view the data, as well as an iPhone app for even more
convenient access. We would still need somebody to help out on the
web app/web service end, anyone interested?

James, if you could throw together a quick paper-napkin sketch of what
a simple UI for version 1.0 of an iPhone app should look like that
would be a good start.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

James Schaffer

unread,
Feb 20, 2011, 6:29:40 PM2/20/11
to civic-h...@googlegroups.com
Here are some pretty crude mocks I did.  I didn't want to think too big, kept it pretty simple.

The map is pretty straight forward.  On launch I think all the layers are off.  We put all ON and all OFF at the top for quick view changes. We also allow user to  turn on and off specific routes.  CLicking on the calendar icon will slide down an info bar below the map ad display schedules.  Pretty basic function.  I can do most of if not all the UI work,  my struggle is getting the renderings to work on the map. 

The iPhone is just a mobile version of what they have on the current MTA site.  Instead of using PDFs for the routes we use the Google maps renderings.   If we want to build in something like the SEPTA trip planner I am game, just didn't want over complicate something.  Plus, buses are not like subways, people like to have control over their transfer patterns because there are so many.  From my house to Fells Point I can think of four routes right off the bat, so giving them a basic app that has schedules and routes is the best start.

Ray & Mark, do we need more help in order to do this?  I am willing to dedicate time to get it done.  What resource holes do we currently have? 

James  

Mark Headd

unread,
Feb 21, 2011, 10:34:20 PM2/21/11
to civic-h...@googlegroups.com
If I can add one more item for consideration...

Should this be pursued, it might be worth considering how feasible it is to add a component to enable older phones to look up information on bus arrivals / departures.  DTMF and SMS are obvious interfaces to consider, since pretty much all mobile phones support them.

This is an approach I tried to advance with findthebus.com (there is an IM-based lookup component to that project ), though that is a admittedly rough solution at this point, meant for demo and POC purposes right now).

What would be ideal is if there was an easy, ubiquitous way to identify MTA stops - a stop ID or some other identifier that a person could use in an SMS message to an app with a route number.  (Not sure if this is something that is available - without it, determining location via DTMF / SMS interfaces get tricky.)

I realize this is somewhat outside the scope of what we've been talking about with being able to map this information, but I think providing alternate interfaces to route and schedule information could be important, particularly to riders that might face challenges in accessing this information through smart phones or even traditional web browsers.

Thoughts?

Mark

Ray Wenderlich

unread,
Feb 22, 2011, 9:51:14 PM2/22/11
to civic-h...@googlegroups.com
Thanks for putting together the mockups, James, that is quite helpful.

I don't have much server-side/web background, so although I can
probably hack together enough to get the iPhone app working,
definitely wouldn't be able to do the web components you're talking
about. So if you still want to proceed with that, we'd need a
web/server side guy to help out.

Timewise, I'm pretty swamped for the next month or so, and will only
have a few random hours here and there to hack at it. I'm willing to
put in some time to work on this now and again for fun, it just might
take a while.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ray Wenderlich

unread,
Feb 22, 2011, 9:52:55 PM2/22/11
to civic-h...@googlegroups.com
Thanks for putting together the mockups, James, that is quite helpful.

I don't have much server-side/web background, so although I can
probably hack together enough to get the iPhone app working,
definitely wouldn't be able to do the web components you're talking
about. So if you still want to proceed with that, we'd need a
web/server side guy to help out.

Timewise, I'm pretty swamped for the next month or so, and will only
have a few random hours here and there to hack at it. I'm willing to
put in some time to work on this now and again for fun, it just might
take a while.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -


Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: @rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

James Schaffer

unread,
Feb 23, 2011, 11:31:35 PM2/23/11
to civic-h...@googlegroups.com
Mark:

This is an awesome idea and I think properly targeted.  Lets not kid ourselves, the economic demographic of good chunk of people riding the bus dont have $100 a month to be burning on a 3G data plan.  

Anyways, I am still navigating the world of the MTA so I might be wrong but the impression I get is that the only clear ID at each stop is the route it services.  The MTA might have an ID, but the rider is clueless and can only use cross streets.  If you go to the website the schedules are only shown for the major stops. 

Would it just be easiest to send the schedule you see on the website?  If it exceeds 140 the person can respond with MORE.  For example the 11 bus, which I cite a lot, it only publishes about 8 stops on the site, someone could TXT to whatever number: MTA 11 9:45.  It could send you back the list of the stops.  Then you could just enter a number value equal to the stop and it will give you the next couple times that bus comes around. 

Here is how I see it working....

I send: MTA 11 10:00am

RESPONSE (this example is about 90 char)
1 Towsontown
2 GBMC
3 Bellona
4 Charles
5 Maryland
6 1st Mariner
7 Fleet
8 Canton Cross

I respond...
1

Then get....
10:11
10:41
11:11

It is smart enough to pick the right day schedule, since there is weekday, Saturday and Sunday/Holiday

Just my 2 cents.  

James

Mike Brenner

unread,
Feb 24, 2011, 6:53:33 AM2/24/11
to civic-h...@googlegroups.com
James and Mark,

Very cool stuff here. Also, instead of this being text-based, couldn't this just as easy be a 1-800 service? Then you aren't limited by characters and might be able to do voice recognition capabilities.

I like 1-800-BUS-FINDER.


......................

Mike Brenner
Sent from my iPhone

Mark Headd

unread,
Feb 24, 2011, 9:29:12 AM2/24/11
to civic-h...@googlegroups.com
James:

I think your suggestion makes sense.  I like that approach - it simple, easy to understand and (with a brief explanation) easy to use. I don't think it would be all that hard to craft some queries of the MySQL DB Ray put together to pull data out and format them as you have described.  (Line breaks in the response might be tough, though, as not all carriers support SMS formatting that way.)

Mike:

I agree, no reason to confine this to a specific modality. It should be fairly straightforward to set up a more generic interface or API that makes it easy to use with any type of user interface (how about Twitter?).  This way, one could use whatever service or framework they wanted to for building an interface to the data.

I may use Ray's SQL script to stand something up in EC2 that I can test with.  Also, been meaning to have a play with FRAPI (http://getfrapi.com/) for setting up restful APIs - this might be a good reason to dig into that.

I can report back when I have something set up that people can look at, test.  Cool?

Mark

James Schaffer

unread,
Feb 24, 2011, 9:56:55 AM2/24/11
to civic-h...@googlegroups.com
Sounds great!

Mark Headd

unread,
Feb 24, 2011, 10:03:09 AM2/24/11
to civic-h...@googlegroups.com
Thought this might be of interest to those looking at  using the MTA data:


I'm headed up for this if anyone is interested in joining me.

Mark
Reply all
Reply to author
Forward
0 new messages