Open epicstar opened 9 years ago
Google Places API is a nice start to find a repo of points of interests that are searchable. This may however cost money if it is used a lot.
Seems we could use the Port Authority trip planner... let's see if they will open it
The implications of this is that we will need to find a workable search space to connect two points to each other via bus routes.
I believe the fastest and most feasible way to search this is through bus stop metadata. Each bus stop is assigned a list of bus route numbers.
I think this is how this will work and feel free to veto/throw out other ideas:
Limitations:
Required data:
Constraints here:
On the note of GTFS directly on our app.... Seems we will have to process GTFS on a server, make it small enough for use, then send it to the mobile app and have it store that small data. I think storing a binary RTree of the data we need to make the trip planning possible will be a trivial amount of MBs but we have to find a cloud server that will be able to securely and with minimal money, send this data to the client.
EDIT: Maybe not... see below
This could possibly be done on a micro AWS instance?
Yes, this is a possibility. The only problem with AWS is that it's only free for a year. This is why I'm trying to find ways to get this GTFS data to be able to be read on an android phone. Google and Azure seem to have free options, but Amazon may be a good idea to get the iOS version of the app running.
I just pushed a branch gtfs-prototype that takes in a zipped gtfs file (~6MB) and creates a stop to routes mapping. The process on my computer took 3.5 seconds and the output file is only 1.7 MB to store as an unminified json with the aid of the OneBusAway API which read the zip files in a stream. This seems to be completely reasonable to store this data in a java object on an android phone.
However, I'll be interested to see if the OneBusAway library will actually work on an android device (the limitation is that the API requires sl4j for no reason....). After that, I need to see the feasibility of using the rtree library linked above with this data on my computer then on an android phone.
If we find that the rtree is too much to handle for both ends, we can just do an O(N) search on finding the best buses between 2 points as opposed to a 2 log n search.
These guys here have an API to get the latest info for a certain GTFS data in zip format which I already have a key of: http://transitfeeds.com/api/
In generalized terms... given a set of two points, find a set of bus routes that gets you from point one to point two. For a general set use-case, the first point... or the "from point" is your current location and the second point, or the "destination point", is the point of interest you are trying to get to by using the bus. We will, however, try to code this by traveling to any two points within pittsburgh.