Frage

I'm trying to work on an app which uses GTFS. This may seems like a stupid question but I couldn't find any answer to it.

The GTFS for Israel, a rather small country with not so many buses infrastructure, is around 120 MB zipped file. Right now the only possible way I could think of for getting it working is to download the file, but downloading 120 MB using the phone could take quite a long time. Sure you can do this only once and save it in a database on the phone, but it still requires downloading 120 MB.

Since it is zipped, I can't unzip it over the server and than just get the txt files..

So basically I'm asking, How can I get the information to the phone, without downloading the zipped file?

I've seen and used apps which uses that same GTFS file, and they load up really fast, even on the first load..

I hope you understand my issue, not sure how to explain it better.

Thanks!

P.s I would make an iPhone app too, and it's the same issue, hence the iPhone tag

War es hilfreich?

Lösung

One approach might be to preprocess the GTFS data during your app development. You could load it into a SQLite database, and use Core Data to get the data you need out of the file at runtime. This also gives you an opportunity to include only the data that you actually need for your app - it doesn't make sense to ask users to download extra data that they won't need.

Andere Tipps

Use protocol binary format (pbf) formely google and now open source. It is compact and very fast searchable, so no need to decompress it on a device and load it into a database on that device because pbf acts as a database. Just include pbf library in your code to query it. Of course you have to compress it once before distributing the data online.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top