Home

Awesome

GTFS-JS

JavaScript library for working with GTFS data.

bitHound Score

Modules

<dl> <dt><a href="#module_gtfsx">gtfsx</a></dt> <dd></dd> <dt><a href="#module_conversionUtils">conversionUtils</a></dt> <dd><p>Module converting between object types.</p> </dd> <dt><a href="#module_Datafile">Datafile</a></dt> <dd></dd> <dt><a href="#module_Agency">Agency</a></dt> <dd></dd> </dl>

<a name="module_gtfsx"></a>

gtfsx

<a name="module_conversionUtils"></a>

conversionUtils

Module converting between object types.

<a name="module_conversionUtils.convertDateToDateObject"></a>

conversionUtils.convertDateToDateObject(n) ⇒ <code>Date</code>

Converts a number representing a date returned from GTFS-Exchange into a Date object.

Kind: static method of <code>conversionUtils</code>
Returns: <code>Date</code> - - The date equivalent of the input number.

ParamTypeDescription
n<code>number</code> | <code>Date</code>A number representing a date. If a date is passed in, that same date is returned.

<a name="module_Datafile"></a>

Datafile

<a name="exp_module_Datafile--Datafile"></a>

Datafile ⏏

Kind: Exported class
<a name="new_module_Datafile--Datafile_new"></a>

new Datafile(data)

Represents an element of the datafile array returned from the API endpoint http://www.gtfs-data-exchange.com/api/agency?agency={dataexchange_id}.

ParamTypeDescription
data<code>Object</code>Values to populate this object's parameters.

<a name="module_Datafile--Datafile..description"></a>

Datafile~description : <code>string</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Datafile--Datafile..md5sum"></a>

Datafile~md5sum : <code>string</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Datafile--Datafile..file_url"></a>

Datafile~file_url : <code>string</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Datafile--Datafile..agencies"></a>

Datafile~agencies : <code>string</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Datafile--Datafile..filename"></a>

Datafile~filename : <code>string</code>

Kind: inner property of <code>Datafile</code>
Example

"abq-ride_20120904_0303.zip"

<a name="module_Datafile--Datafile..date_added"></a>

Datafile~date_added : <code>Date</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Datafile--Datafile..uploaded_by_user"></a>

Datafile~uploaded_by_user : <code>string</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Datafile--Datafile..size"></a>

Datafile~size : <code>number</code>

Kind: inner property of <code>Datafile</code>
<a name="module_Agency"></a>

Agency

<a name="exp_module_Agency--Agency"></a>

Agency ⏏

Kind: Exported class
<a name="new_module_Agency--Agency_new"></a>

new Agency(data, datafiles)

An object representing an agency that publishes GTFS data to GTFS-Exchange.

ParamTypeDescription
data<code>Object</code>Data corresponding to class's properties.
datafiles<code>Object.<string, object></code>An array of DataFile objects.

<a name="module_Agency--Agency.groupByArea"></a>

Agency.groupByArea(agencies) ⇒ <code>Object.<string, Array.<Agency>></code>

Group an array of agencies by area.

Kind: static method of <code>Agency</code>
Returns: <code>Object.<string, Array.<Agency>></code> - - Arrays of agencies grouped by area.

ParamTypeDescription
agencies<code>Array.<Agency></code>An array of agencies.

<a name="module_Agency--Agency..dataexchange_id"></a>

Agency~dataexchange_id : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..feed_baseurl"></a>

Agency~feed_baseurl : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..name"></a>

Agency~name : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..area"></a>

Agency~area : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..url"></a>

Agency~url : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..country"></a>

Agency~country : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..state"></a>

Agency~state : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..license_url"></a>

Agency~license_url : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..dataexchange_url"></a>

Agency~dataexchange_url : <code>string</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..date_added"></a>

Agency~date_added : <code>Date</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..date_last_updated"></a>

Agency~date_last_updated : <code>Date</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..is_official"></a>

Agency~is_official : <code>boolean</code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..datafiles"></a>

Agency~datafiles : <code>Array.<DataFile></code>

Kind: inner property of <code>Agency</code>
<a name="module_Agency--Agency..latestFeedUrl"></a>

Agency~latestFeedUrl : <code>string</code>

URL for the most current GTFS ZIP file

Kind: inner property of <code>Agency</code>