{"id":33044387,"url":"https://github.com/cal-itp/gtfs-service-area","last_synced_at":"2025-11-16T20:01:46.909Z","repository":{"id":104714983,"uuid":"280746670","full_name":"cal-itp/gtfs-service-area","owner":"cal-itp","description":"Compute transit service area from static GTFS.","archived":true,"fork":false,"pushed_at":"2021-05-10T21:51:30.000Z","size":5287,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-11T16:09:16.563Z","etag":null,"topics":["geojson","gtfs-static","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cal-itp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-18T22:00:42.000Z","updated_at":"2023-03-11T03:04:21.000Z","dependencies_parsed_at":"2024-01-11T19:16:34.674Z","dependency_job_id":"ff0a0b65-0534-4842-931f-ccbde15a3529","html_url":"https://github.com/cal-itp/gtfs-service-area","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cal-itp/gtfs-service-area","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cal-itp%2Fgtfs-service-area","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cal-itp%2Fgtfs-service-area/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cal-itp%2Fgtfs-service-area/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cal-itp%2Fgtfs-service-area/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cal-itp","download_url":"https://codeload.github.com/cal-itp/gtfs-service-area/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cal-itp%2Fgtfs-service-area/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284767947,"owners_count":27060132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geojson","gtfs-static","nodejs"],"created_at":"2025-11-14T00:00:28.413Z","updated_at":"2025-11-16T20:01:46.903Z","avatar_url":"https://github.com/cal-itp.png","language":"JavaScript","funding_links":[],"categories":["Producing Data","Uncategorized"],"sub_categories":["GTFS","Uncategorized"],"readme":"# gtfs-service-area\r\n\r\nCompute a transit service area from static [GTFS](https://gtfs.org/reference/static). Results are output as single-layer `.geojson` files.\r\n\r\n**NOTE**: The functionality in this tool has been incorporated into the upstream [`gtfs-to-geojson`][gtfsgeojson]. This repo is now read-only and is no longer maintained.\r\n\r\n## Examples\r\n\r\nThe [`example`](example/) directory contains output using GTFS data from [Big Blue Bus][bbb] and [Monterey-Salinas Transit][mst], with settings from the [sample config file](config.sample.json) in this repository.\r\n\r\n## Getting Started\r\n\r\nCreate a configuration file from the sample:\r\n\r\n```bash\r\ncp config.sample.json config.json\r\n```\r\n\r\nEdit the collection of `agencies` as needed:\r\n\r\n```json\r\n\"agencies\": [\r\n    {\r\n        \"agency_key\": \"agency1\",\r\n        \"url\": \"https://www.agency1.com/gtfs.zip\"\r\n    },\r\n    {\r\n        \"agency_key\": \"agency2\",\r\n        \"url\": \"https://www.agency2.com/gtfs.zip\"\r\n    }\r\n],\r\n```\r\n\r\n### Option 1: Use [`docker-compose`](https://docs.docker.com/compose/)\r\n\r\n````bash\r\ndocker-compose run pipeline\r\n````\r\n\r\n### Option 2: Use [`npm`](https://www.npmjs.com/)\r\n\r\n1. Install dependencies:\r\n\r\n    ```bash\r\n    npm install\r\n    ```\r\n\r\n1. Run the generator:\r\n\r\n    ```bash\r\n    npm start\r\n    ```\r\n\r\nCheck the `geojson` directory for output:\r\n\r\n```bash\r\n.\r\n├── geojson\r\n│   ├── agency1\r\n│   │   ├── agency1-routes.geojson  \u003c-- GTFS route lines\r\n│   │   ├── agency1-stops.geojson   \u003c-- GTFS route stops\r\n│   │   ├── agency1-service-area-1.geojson   \u003c-- Computed service area(s)\r\n│   │   └── agency1-service-area-2.geojson\r\n│   ├── agency2\r\n│   │   ├── agency2-routes.geojson  \u003c-- GTFS route lines\r\n│   │   ├── agency2-stops.geojson   \u003c-- GTFS route stops\r\n│   │   ├── agency2-service-area-1.geojson   \u003c-- Computed service area(s)\r\n│   │   └── agency2-service-area-2.geojson\r\n```\r\n\r\n## Service Areas\r\n\r\nThis tool calculates service area using a number of different methods:\r\n\r\n| Type              | Description                                  |\r\n|-------------------|----------------------------------------------|\r\n| `envelope`        | [Bounding box][bbox] around routes lines     |\r\n| `convex`          | [Convex hull][convex] around route endpoints |\r\n| `stops`           | [Buffer][buffer] around stops                |\r\n| `stops-dissolved` | [Dissolve][dissolve] the buffer around stops |\r\n\r\nThe configuration file allows for specifying which service area calculation(s) are used, per-agency and/or on the run as a whole, with the `serviceAreas` key:\r\n\r\n```json\r\n{\r\n  \"agencies\": [\r\n    {\r\n      \"agency_key\": \"agency1\",\r\n      \"url\": \"https://www.agency1.com/gtfs.zip\",\r\n    },\r\n    {\r\n      \"agency_key\": \"agency2\",\r\n      \"url\": \"https://www.agency2.com/gtfs.zip\",\r\n      \"serviceAreas\": [\r\n        \"stops\"\r\n      ]\r\n    }\r\n  ],\r\n  \"serviceAreas\": [\r\n    \"envelope\",\r\n    \"convex\",\r\n    \"stops\",\r\n    \"stops-dissolved\"\r\n  ]\r\n}\r\n```\r\n\r\nIn the above example:\r\n\r\n* `agency1`: all 4 service area calculations from the top-level `serviceAreas` will run as no override was specified.\r\n* `agency2`: the top-level `serviceAreas` have been overridden and only the `stops` calculation will run.\r\n\r\n### Stop Buffers\r\n\r\nFor the `stops` and `stops-dissolved` calculation, an additional configuration key `bufferRadiusMeters` can be specified, either at the top-level or per-agency, to control the radius of buffers (in meters):\r\n\r\n```json\r\n{\r\n  \"agencies\": [\r\n    {\r\n      \"agency_key\": \"agency1\",\r\n      \"url\": \"https://www.agency1.com/gtfs.zip\",\r\n      \"serviceAreas\": [\r\n        \"stops\"\r\n      ]\r\n    },\r\n    {\r\n      \"agency_key\": \"agency2\",\r\n      \"url\": \"https://www.agency2.com/gtfs.zip\",\r\n      \"serviceAreas\": [\r\n        \"stops-dissolved\"\r\n      ],\r\n      \"bufferSizeMeters\": 750\r\n    }\r\n  ],\r\n  \"bufferSizeMeters\": 400\r\n}\r\n```\r\n\r\nIn the above example:\r\n\r\n* `agency1`: calculate a 400 meter buffer around stops, using the top-level `bufferSizeMeters`.\r\n* `agency2`: calculate a 750 meter buffer around stops, using the override `bufferSizeMeters`.\r\n\r\n## Additional Configuration\r\n\r\nThe configuration data is passed through to [`gtfs-to-geojson`][gtfsgeojson], and you may use any of the [supported options](https://github.com/BlinkTagInc/gtfs-to-geojson#configuration).\r\n\r\n*Note that this project may override some options as necessary for calculating service areas.*\r\n\r\n[bbb]: http://gtfs.bigbluebus.com\r\n[bbox]: http://wiki.gis.com/wiki/index.php/Minimum_bounding_rectangle\r\n[buffer]: http://wiki.gis.com/wiki/index.php/Buffer_(GIS)\r\n[convex]: http://wiki.gis.com/wiki/index.php/Convex_hull\r\n[dissolve]: http://wiki.gis.com/wiki/index.php/Dissolve\r\n[gtfsgeojson]: https://github.com/BlinkTagInc/gtfs-to-geojson\r\n[mst]: https://mst.org/about-mst/developer-resources/\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcal-itp%2Fgtfs-service-area","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcal-itp%2Fgtfs-service-area","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcal-itp%2Fgtfs-service-area/lists"}