Swiftpack.co - Package - richwolf/Transit

Transit

Transit strives to be nothing less than the Swiftiest way to interact with GTFS static feeds.

Introduction

Some kind of introductory thing.

Installing Transit

Transit is distributed as a Swift package.

Using Transit

Optional and Conditionally Required Fields

ids

Tranist makes all its types Indentifiable so that you can use easily use them with frameworks like SwiftUI. Unfortunately, GTFS does not guarantee that IDs will be unique across all GTFS datasets. You might, for example, be dealing with two transit agencies that each vend a route whose ID is “1”. In order to guarantee that all Transit isntances contain unique IDs, Transit instances each of their own IDs.

desc versus details

Two GTFS dataset files (routes.txt and stops.txt) use a desc or “description” field. So-as-to avoid confusion with the CustomStringConvertible protocol (which requires that adoptors implement a description computed member), Transit uses details for the desc GTFS field. In other words:

myRoute.details

returns a GTFS Agency desc field value as a String whereas:

myRoute.description

returns a String suitable for use the the CustomStringConvertible protocol.

Agency

GTFS Field | GTFS Type | Member Name | Member Type --- | --- | --- | --- agency_id | ID | agencyID | TransitID? agency_name | Text | name | String agency_url | URL | url | URL agency_timezone | Timezone | timeZone | TimeZone agency_lang | Language code | language | String? agency_phone | Phone number | phone | String? agency_fare_url | URL | fareURL | URL? agency_email | Email | email | String?

Route

GTFS Field | GTFS Type | Member Name | Member Type --- | --- | --- | --- agency_id | ID | agencyID | TransitID?

Stop

GTFS Field | GTFS Type | Member Name | Member Type --- | --- | --- | --- agency_id | ID | agencyID | TransitID?

Github

link
Stars: 1

Dependencies

Used By

Total: 0