transito feature request: local API, for other Apps running on the same device, so that they can query Transito locally for nearby stations or stations for given coordinates.
maybe routes and connecitons also. Or translating a given station name to coordinates.
The "Öffi" app does a search for nearby stations, but only online, not offline. If Transito is installed on a device, an other App could locally search for nearby stations, if transito offers the function through some API.
Mobroute (the library behind transito) that provides GTFS stops & routing information etc. can be compiled to a C library via cgo. Then Offi or other apps can use this C library (.so/.h) directly. I plan to document the C usecase better soon as well (as using the go library now is the primary library integration method).
As for a common API (opposed to a library), the unfortunate thing AFAIK is that that requires a pretty platform-specific implementation (e.g. Android has one way, Linux another, iOS another etc.) so I'm unlikely to work on that.
For the library usecase I'm happy to answer questions from other app developers wishing to integrate PT & GTFS features present in transito in another app.
But that would mean two have to copies of the gtfs database on the android device? one in the transito app, another one in the compiled c-library?
All GTFS data is stored in a single SQLite DB. Other then loading new GTFS data, everything via the library is RO (stops querying, routing calcs, etc.) So if multiple apps can access the same filepath DB there's no reason same data can't be shared from library's end. On linux this is pretty trivial (and mobroute CLI & transito app UI on linux already do this / share same SQLite db file). So in that way there would be only 1 DB shared (and no copies involved).
Would need to look into the android-specific way to do this / share a common filepath (atleast as RO)
android-specific way to do this / share a common filepath (atleast as RO)
that would be great!
Does Android's built-in SQLlite support Stored Procedures? SP would be a good way 1) to give only limiled access to other apps to the database 2) as a level of abstraction, in case the database scheme needs to get changed in Transito.