smartilabs/phpgtfs

Data modeling and object writer for General Transit Feed Specification (GTFS)

dev-master 2019-08-29 08:12 UTC

This package is auto-updated.

Last update: 2024-10-29 05:17:02 UTC


README

phpgtfs is a data modeling and object writer for General Transit Feed Specification (GTFS).

Installation

Install with Composer

Usage

$agencies = new \smartilabs\phpgtfs\gtfs\Agencies();

$agency = new \smartilabs\phpgtfs\model\Agency();
$agency->agency_name = 'Demo agency';
$agency->agency_url = 'http://localhost/';
$agency->agency_timezone = 'America/Los_Angeles';
$agency->agency_lang = 'en';

$agencies->add($agency);

Then simply

\smartilabs\phpgtfs\Writer::write('gtfs/', $agencies);

and an agencies.txt file will be placed in the gtfs folder. Note that even unspecified columns will be written:

agency_id,agency_name,agency_url,agency_timezone,agency_lang,agency_phone,agency_fare_url
,"Demo agency",http://localhost/,America/Los_Angeles,en,,

License

MIT