wbrenna / gtfsoffline Goto Github PK
View Code? Open in Web Editor NEWA flexible Android transit app for use with any pro-GTFS transit agency!
License: GNU General Public License v3.0
A flexible Android transit app for use with any pro-GTFS transit agency!
License: GNU General Public License v3.0
Sometimes it will state a new bus departure when it is that route's end-of-line. This should be checked for and no longer displayed.
Testing with TTC STN and GRT, if I turn only TTC on, the Favourites tab gives TTC favourites with STN and GRT stop names.
Some queries can be avoided by hashing past stops a little more intelligently.
Now that the app is using an external storage permission, maybe just let it copy all *.db.gz from Downloads folder and do the gunzip itself.
Symptom: GTFSOfline will scan Download folder, but database does not appear in app.
Environment:
Motorola X Play (Lux) running custom 7.1.2 firmware (problem noticed after a /sdcard wipe).
Could be possible Debian 9 gzip added a feature to format to break readability, or (admittedly) gzip on phone unavailable/broken.
gzip on PC to compile *.db.gz is 1.6
Partial logcat to come to this conclusion:
01-24 15:50:19.251 W/System (9639): ClassLoader referenced unknown path: /data/app/com.wbrenna.gtfsoffline-1/lib/arm
...
01-24 15:50:26.881 V/UpdateActivity(9639): Download folder is: Download
01-24 15:50:26.885 V/UpdateActivity(9639): File found: halifax.db.gz
01-24 15:50:26.886 V/UpdateActivity(9639): halifax.db.gz
01-24 15:50:26.888 E/UpdateActivity(9639): IOException exception
01-24 15:50:26.888 W/System.err(9639): java.util.zip.ZipException: Not in GZIP format
01-24 15:50:26.888 W/System.err(9639): at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:163)
01-24 15:50:26.888 W/System.err(9639): at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:77)
01-24 15:50:26.889 W/System.err(9639): at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:89)
01-24 15:50:26.892 W/System.err(9639): at com.wbrenna.gtfsoffline.UpdateActivity$DBMover.doInBackground(UpdateActivity.java:153)
01-24 15:50:26.892 W/System.err(9639): at com.wbrenna.gtfsoffline.UpdateActivity$DBMover.doInBackground(UpdateActivity.java:95)
01-24 15:50:26.892 W/System.err(9639): at android.os.AsyncTask$2.call(AsyncTask.java:305)
01-24 15:50:26.892 W/System.err(9639): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-24 15:50:26.892 W/System.err(9639): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
01-24 15:50:26.892 W/System.err(9639): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
01-24 15:50:26.892 W/System.err(9639): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
01-24 15:50:26.892 W/System.err(9639): at java.lang.Thread.run(Thread.java:761)
01-24 15:50:26.910 V/UpdateActivity(9639): Finished copying stops!
01-24 15:50:26.938 I/ActivityManager(768): Displayed com.wbrenna.gtfsoffline/.UpdateActivity: +100ms
Put the Stop Number up next to the Stop Name, and use Route Number in the yellow box so it's easier to see. Add a direction to the route.
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.NullPointerException
at com.wbrenna.gtfsoffline.UpdateActivity$DBMover.doInBackground(UpdateActivity.java:134)
at com.wbrenna.gtfsoffline.UpdateActivity$DBMover.doInBackground(UpdateActivity.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more
Set the lookahead time to 8 hours and notice that 7.5 hour-away trips are returned before 19 minute-away ones. Tested 10.49PM on a Monday.
A Submissions Queue thread has been created for it: https://f-droid.org/forums/topic/grtransit-android-app/
At 1am does not find 6am routes, even if set to look 8 hours ahead.
10 is sometimes (rarely) too few. Create some settings like 30 and 90 maybe, in case you need to look far away (or at large bus terminals).
Dataset for IDS-JMK agency downloaded from
What is wrong?
./mksql3db.sh idsjmk.db idsjmk/*.txt
mksql3db.sh: no existing db; using version 1
using database version 2
idsjmk/agency.txt
idsjmk/api.txt
idsjmk/calendar_dates.txt
idsjmk/calendar.txt
idsjmk/routes.txt
idsjmk/stops.txt
idsjmk/stop_times.txt
idsjmk/transfers.txt
idsjmk/trips.txt
Checking for missing calendar_dates.txt or calendar.txt...
Creating indices...
Indices created.
Adding head signs if not already in DB...
Error: in prepare, no such column: table
select sql from sqlite_master where type="table" and tbl_name="trips";
error here ---^
Parse error near line 1: duplicate column name: trip_headsign
Parse error near line 2: near ",": syntax error
insert into trips select ,trip_headsign from (select ,(select coalesce(stop_na
error here ---^
Adding head signs completed
Deleting departure time of last stop of each trip...
Error: in prepare, no such column: table
select sql from sqlite_master where type="table" and tbl_name="stop_times";
error here ---^
Parse error near line 1: near "from": syntax error
insert into stop_times select from (select from stop_times group by trip_id
error here ---^
Parse error near line 2: no such column:
here departure_time is not NULL and arrival_time<>"" and rowid not in (select
error here ---^
Deleting departure times completed
Renaming and cleaning up...
mv: cannot stat 'idsjmk.db': No such file or directory
mv: cannot stat 'idsjmk.db.version': No such file or directory
idsjmk.db: 75.5% -- replaced with stdout
Thanks for sharing this app. It looks like very handy and useful.
Please, add Barcelona to the list of supported cities. I've found this which might be useful: https://www.tmb.cat/en/about-tmb/tools-for-developers
Thank you.
I noticed the search feature is absent in this fork. Was this a privacy decision or to keep it simple? Would it be something you'd consider adding in the future?
Fix in Location Helper!
When I perform these sequences of events, the dialog disappears on-screen rotation:
The expected behavior is the return to the previous state with the fragments of the previous image.
However, the fragment disappears.
Device:
Privacy preserving maps could be implemented by using mapsforge which uses OpenStreetMap vector data rendered locally similar to OsmAnd. Mapsforge files are stored in a shared directory so they can be used by multiple applications.
An example of an app that uses mapsforge is SatStat which also has an integrated downloader. If you don't wish to add an internet permission, the files could be added via drag and drop.
Hourtoggle should be equal to the lookahead time in order to make things more efficient. Currently breaks on lookahead > 8 since hourtoggle = 8.
Even slowly changing tabs leaks databases. Sometimes it still reports database leaks that have been removed from the system! It could be an onPostExecute not being reached due to a screen rotation or something like that...
At the worst I can try taking the closeDB out of onPostExecute and putting it immediately after all database queries.
greetings. I've been trying to get rtd denver's gtfs data to work, but it's not. dunno where to begin to figure out why not, since i'm quite new to android, although my phone is not: this is in a zte n817 running android v4.4.4.x. Hoping a kind programmer might take a look at rtd's data and clue me in whether the fault is theirs, mine or other :)
thanks in advance. rtd's gtfs page is here
http://www.rtd-denver.com/gtfs-developer-guide.shtml
When the DBs are changed in preferences, it sometimes just shows new tabs without loading the new DB or changing the DB for the tab.
If only one location service is enabled, the alternate service is queried (GPS/NETWORK). This probably means location services won't work if one of the two is turned off. Fix required in LocationHelper.java.
For each database, search calendar.txt and if the end dates are all before our date, just give a fixed warning.
Hello,
I get errors when launching DB generation script under Ubuntu 12.04 LTS. I only get a nearly empty file whereas GTFS data is OK:
nicolas@spiralo2:~/transports/GTFSOffline/data$ ./mksql3db.sh aTER.db ../../GTFS-viz/gtfs-data/ter/*.txt
using database version 7
../../GTFS-viz/gtfs-data/ter/agency.txt
../../GTFS-viz/gtfs-data/ter/calendar_dates.txt
../../GTFS-viz/gtfs-data/ter/calendar.txt
../../GTFS-viz/gtfs-data/ter/routes.txt
../../GTFS-viz/gtfs-data/ter/stops.txt
../../GTFS-viz/gtfs-data/ter/stop_times.txt
../../GTFS-viz/gtfs-data/ter/transfers.txt
../../GTFS-viz/gtfs-data/ter/trips.txt
Checking for missing calendar_dates.txt or calendar.txt...
WARNING: Could not find calendar_dates.txt. Creating an empty table for holiday data...
WARNING: Could not find calendar.txt. Creating an empty table for regular data...
Creating indices...
Error: near line 1: no such table: main.stops
Error: near line 2: no such table: main.routes
Error: near line 3: no such table: main.trips
Error: near line 4: no such table: main.trips
Error: near line 5: no such table: main.stop_times
Error: near line 6: no such table: main.stops
Indices created. Renaming and cleaning up...
aTER.db: 93.8%
-rw-r--r-- 1 nicolas nicolas 6144 août 13 14:34 aTER.db
-rw-rw-r-- 1 nicolas nicolas 412 août 13 14:34 aTER.db.gz
-rw-rw-r-- 1 nicolas nicolas 37 août 13 14:34 aTER.db.version
7 0 fe02b00de4d4fe2a93d2bd98e8c02387
aTER.db is "empty":
nicolas@spiralo2:~/transports/GTFSOffline/data$ more aTER.db
SQLite format 3
dar_dates_datecalendar_datesCREATE INDEX calendar_dates_date on calendar_dates ( date )?
?itablecalendarcalen
darCREATE TABLE``calendar(service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_
date)d))?tablecalendar_datescalendar_datesCREATE TABLE``calendar_dates(service_id,date,exception_type)l--?
tab
leandroid_metadataandroid_metadataCREATE TABLE "android_metadata" ("locale" TEXT DEFAULT``'en_US')
Still I have GTFS data:
nicolas@spiralo2:~/transports/GTFSOffline/data$ ls -l ../../GTFS-viz/gtfs-data/ter/
total 13072
-rw-rw-r-- 1 nicolas nicolas 116 juil. 7 09:35 agency.txt
-rw-rw-r-- 1 nicolas nicolas 292597 juil. 7 09:35 calendar_dates.txt
-rw-rw-r-- 1 nicolas nicolas 127098 juil. 7 09:35 calendar.txt
-rw-rw-r-- 1 nicolas nicolas 75653 juil. 7 09:35 routes.txt
-rw-rw-r-- 1 nicolas nicolas 473513 juil. 7 09:35 stops.txt
-rw-rw-r-- 1 nicolas nicolas 11309282 juil. 7 09:35 stop_times.txt
-rw-rw-r-- 1 nicolas nicolas 57 juil. 7 09:35 transfers.txt
-rw-rw-r-- 1 nicolas nicolas 1081951 juil. 7 09:35 trips.txt
nicolas@spiralo2:~/transports/GTFSOffline/data$
Do you know where the problem comes from?
Thanks for your help.
Did a sqlite search for the stop that is literally across the street from me. There it is, in the stops table. Yet, when I load up the app and search for stops, it only shows ones that are over 2 miles away.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.