grote / Transportr

Free Public Transport Assistant without Ads or Tracking
https://transportr.app
GNU General Public License v3.0
1.05k stars 189 forks source link

Offline Support: Make search possible without internet connection #126

Closed ghost closed 1 week ago

ghost commented 8 years ago

It would be great to have transportr work without internet connection. Say you are using always a certain net e.g. the city you live in. The timetables do not change that often. It would be great to have access to the data without internet connection. If there is a connection transportr could sync the changes in the timetable to the device.

I think this would be of huge value for users without data plans as well as for security reasons, because you do not expose to the environment where you are and where you want to go.

TheLastProject commented 8 years ago

This seems like a lot of code for very little benefit. If you know the times you tend to leave, you could hit the "export to calendar" button and set the Android calendar system to repeat the event daily. Use an app like Offline Calendar to keep it fully local.

With regards to privacy, proxy support so that you could use Transportr together with Orbot seems a much better approach.

On 19 November 2015 11:29:57 CET, bjoernb notifications@github.com wrote:

It would be great to have transportr work without internet connection. Say you are using always a certain net e.g. the city you live in. The timetables do not change that often. It would be great to have access to the data without internet connection. If there is a connection transportr could sync the changes in the timetable to the device.

I think this would be of huge value for users without data plans as well as for security reasons, because you do not expose to the environment where you are and where you want to go.


Reply to this email directly or view it on GitHub: https://github.com/grote/Transportr/issues/126

Sent from my Android device with K-9 Mail. Please excuse my brevity.

grote commented 8 years ago

It would of course be nice if Transportr would work fully offline. Unfortunately, this is far from easy. Most data is retrieved directly from the public transport companies and not available for offline processing.

Very few transport networks use the de-facto GTFS standard and publish this data. This could be used for offline routing. However, one would need to integrate a routing engine with Transportr.

If somebody wants to add optional GTFS offline processing, I would welcome this, but do not have any plans myself at the moment.

TeXitoi commented 8 years ago

You can look at https://github.com/bliksemlabs/rrrr if you need a gtfs routing module usable directly on mobile.

pixelrust commented 8 years ago

This would be very useful. When I installed Transportr, I assumed this would work.

I like how Transportr focuses on privacy and I'd love if someone added this feature to this beautiful app.

grote commented 7 years ago

graphhopper might also be a candidate for a routing engine to use.

steelman commented 7 years ago

Yet another use case: time tables cannot be "republished" due to DB copyright issues. However, an individual user can obtain the data, convert them and upload to a mobile device.

grote commented 7 years ago

I think we are not short of use cases, but rather short of people implementing this feature or at least a prototype to asses the feasibility.

steelman commented 7 years ago

As far as feasibility is concerned, I can tell that something like 17 years ago I had a Handspring Visor which was able to handle public transport time-tables (including routing with unlimited number of changes) for a quite big city. I know there was a lot of serious optimisations, but hey, it was m68k / 16 MB RAM.

As far as humanpower, I can't help much as Android programming is still ahead of me to learn (-;

cxxuzbim commented 7 years ago

Would a funding drive help to move this feature along? It may be worthwhile to hire a dev if a volunteer cannot be found.

grote commented 7 years ago

In my experience, it is rather difficult to collect serious amounts of money for small Free Software projects, but you are welcome to try.

To give you an idea, as a freelance developer I would normally be very reluctant to offer this for a fixed price, because the actual effort in terms of hours spend is very difficult to estimate. But if I were pressed to offer a fixed price, it would probably be somewhere around 5000 EUR for a very basic offline routing prototype.

patkan commented 7 years ago

It is AFAIK to late for this year, but maybe something like GSoC would be better suited. However, this also implies a substantial amount of time for coordinating the participant.

patkan commented 7 years ago

Just if somebody is planning to implement this: Another option could be OpenTripPlanner. This service takes GTFS and is implemented in java. Maybe public transport enabler can be extended to use OTP server (this would also be helpful for remote servers using this) If possible an instance of OTP could be started on the device with downloaded GTFS data and then it could be normally queried by public transport enabler.

Entze commented 7 years ago

Well there are a few takes/ideas.

I don't know how the app works internally but presumably the app fetches a timetable. If that is cached it could be used later on.

Another idea would be via graph based pathsearching.

Concerning development and implementation, I'm a (non-professional) java developer who is happy to help.

grote commented 7 years ago

Great @Entze, I think a good way to start is to look into the various routing engine options, see how they can be integrated into a Java Android app and in what format they expect the data to be in.

As for data fetching, we would need a system to download (and update) GTFS files from the internet and extract and convert them to whatever format the routing engine requires.

homlett commented 7 years ago

GTFS Offline's engine might be a start: https://github.com/wbrenna/GTFSOffline

grote commented 7 years ago

AFAIK, it doesn't do any routing, so that wouldn't help much. Writing GTFS to a database and looking up stuff that is just there is easy, but computing actual routes/itineraries is the difficult part.

Entze commented 7 years ago

Well not every city uses GTFS. For example my hometown Vienna uses to some extend the HAFAS format. How should be proceeded there? Convert the data first?

patkan commented 7 years ago

As I understand it, HAFAS is only an API. Therefore you will not be able to use it (unless you query your GTFS together, if you are interested @grote gave an interesting talk about creating GTFS from timetables and OSM). The right way to go would be asking the agency to release also GTFS-data. (If they are on Google Maps they already have it.)

GTFS is the (defacto?-)standard and most likely to be available from agencies. So if somebody finds the time to implement this feature, it should imo be able to work with GTFS.

Entze commented 7 years ago

Yeah, well there was a petition once to open the API and allow 3rd party apps. But the "Wiener Linien" (the public transport agency) is sceptical and quite anti-google, so they wont release the GTFS.

So ideally if the app is able to gather GTFS data (in any way) it should be possible to cache it and also use the offline cache as a fallback if no internet connection is available?

alexanderadam commented 6 years ago

The reason I would love to see some offline functionality might be a bit different: I won't always like to use roaming and some airport WIFIs have paywalls but I need to travel from an airport to the accommodation. So I know exactly what the start and destination locations are but due to uncertainties like flight delays/baggage claims/navigation in the airport/struggling with ticket vending machines I won't be able to know when I will be able to use public transport again. This situation can basically happen everywhere where you don't know the exact end of prior events (a sports match/concert/you name it).

In these cases offline routing is not required at all. The data could be requested before these events. A very low level solution would be to store all possible connections in a certain time window in a calendar. But I would rather love to see a solution in Transportr that allows me to persist the data within the app. Like a time based cache that will vanish at the end of the day.

PS: thank you vor Transportr. This application is really wonderful!

grote commented 6 years ago

@alexanderadam thanks for your feedback! What you want might be better covered by something like #171 though.

alexanderadam commented 6 years ago

@grote ha, thank you for you blazingly fast response. Yes that is probably be the case. I just saw that you mentioned the connection serialization for issue 171 in issue 345 as well. 😉

EDIT: I added my point briefly on 171 as well

jmaris commented 5 years ago

The alternative is to establish a json format to store information about networks, as well as a basic routing algorithm.

Altonss commented 1 week ago

Like it has already been mentionned in this issue, the necessary architectural changes needed for offline support are too big. Especially considering the little time available to the few maintainers of Transportr, I consider offline support as out of scope of the app in the near future. Therefore I'll close this issue for now, as it is not going to get implemented anytime soon :)