Skip to content

WSDOT-GIS/GTFS-JS

Repository files navigation

GTFS-JS

JavaScript library for working with GTFS data.

bitHound Score

Modules

gtfsx
conversionUtils

Module converting between object types.

Datafile
Agency

gtfsx

conversionUtils

Module converting between object types.

conversionUtils.convertDateToDateObject(n) ⇒ Date

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

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

Param Type Description
n number | Date A number representing a date. If a date is passed in, that same date is returned.

Datafile

Datafile ⏏

Kind: Exported class

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}.

Param Type Description
data Object Values to populate this object's parameters.

Datafile~description : string

Kind: inner property of Datafile

Datafile~md5sum : string

Kind: inner property of Datafile

Datafile~file_url : string

Kind: inner property of Datafile

Datafile~agencies : string

Kind: inner property of Datafile

Datafile~filename : string

Kind: inner property of Datafile
Example

"abq-ride_20120904_0303.zip"

Datafile~date_added : Date

Kind: inner property of Datafile

Datafile~uploaded_by_user : string

Kind: inner property of Datafile

Datafile~size : number

Kind: inner property of Datafile

Agency

Agency ⏏

Kind: Exported class

new Agency(data, datafiles)

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

Param Type Description
data Object Data corresponding to class's properties.
datafiles Object.<string, object> An array of DataFile objects.

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

Group an array of agencies by area.

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

Param Type Description
agencies Array.<Agency> An array of agencies.

Agency~dataexchange_id : string

Kind: inner property of Agency

Agency~feed_baseurl : string

Kind: inner property of Agency

Agency~name : string

Kind: inner property of Agency

Agency~area : string

Kind: inner property of Agency

Agency~url : string

Kind: inner property of Agency

Agency~country : string

Kind: inner property of Agency

Agency~state : string

Kind: inner property of Agency

Agency~license_url : string

Kind: inner property of Agency

Agency~dataexchange_url : string

Kind: inner property of Agency

Agency~date_added : Date

Kind: inner property of Agency

Agency~date_last_updated : Date

Kind: inner property of Agency

Agency~is_official : boolean

Kind: inner property of Agency

Agency~datafiles : Array.<DataFile>

Kind: inner property of Agency

Agency~latestFeedUrl : string

URL for the most current GTFS ZIP file

Kind: inner property of Agency