{"id":13423614,"url":"https://github.com/ad-freiburg/pfaedle","last_synced_at":"2025-05-16T05:12:07.081Z","repository":{"id":40572799,"uuid":"137058575","full_name":"ad-freiburg/pfaedle","owner":"ad-freiburg","description":"Precise map-matching for public transit feeds. Generates high-quality GTFS shapes from OSM data.","archived":false,"fork":false,"pushed_at":"2025-05-12T07:21:38.000Z","size":7604,"stargazers_count":229,"open_issues_count":13,"forks_count":31,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-12T08:25:12.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ad-freiburg.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-12T10:53:15.000Z","updated_at":"2025-05-12T07:21:41.000Z","dependencies_parsed_at":"2024-06-20T17:31:50.376Z","dependency_job_id":"9a5fac6e-bb72-4c77-acfd-f4423547d6bf","html_url":"https://github.com/ad-freiburg/pfaedle","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpfaedle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpfaedle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpfaedle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpfaedle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-freiburg","download_url":"https://codeload.github.com/ad-freiburg/pfaedle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471011,"owners_count":22076587,"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","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":[],"created_at":"2024-07-31T00:00:38.862Z","updated_at":"2025-05-16T05:12:07.038Z","avatar_url":"https://github.com/ad-freiburg.png","language":"C++","funding_links":[],"categories":["C++","Producing Data","Uncategorized"],"sub_categories":["GTFS","Uncategorized"],"readme":"[![Left: station-to-station path of a single train through Switzerland obtained from schedule timetable data. Right: path of the same train map-matched by pfaedle.](geo/schweiz_ex_res.png?raw=true)](geo/schweiz_ex.png?raw=true)  \n*Left: station-to-station path of a single train through Switzerland obtained from official schedule data. Right: path of the same train map-matched by pfaedle.*\n\n[![Left: station-to-station path of a single bus through Stuttgart obtained from official schedule data. Right: path of the same bus map-matched by pfaedle.](geo/stuttgart_ex_res.png?raw=true)](geo/stuttgart_ex.png?raw=true)  \n*Left: station-to-station path of a single bus through Stuttgart obtained from official schedule data. Right: path of the same bus map-matched by pfaedle.*\n\n[![Build](https://github.com/ad-freiburg/pfaedle/actions/workflows/build.yml/badge.svg)](https://github.com/ad-freiburg/pfaedle/actions/workflows/build.yml)\n\n# pfaedle\n\nPrecise OpenStreetMap (OSM) map-matching for public transit schedules ([GTFS](https://developers.google.com/transit/gtfs/reference/) data).\nFirst described in [this 2018 SIGSPATIAL paper](http://ad-publications.informatik.uni-freiburg.de/SIGSPATIAL_Sparse%20map%20matching%202018.pdf).\n\nFor a quick visual inspection of the shape quality, see for example the schedule data for Germany or Switzerland in our tool [TRAVIC](https://travic.app/?z=7\u0026x=1261608.6\u0026y=6430601.6).\n\n## Requirements\n\n * `cmake`\n * `gcc \u003e= 5.0` (or `clang \u003e= 3.9`)\n * `libzip` (*optional*, for ZIP support)\n * `zlib` (*optional*, for gzip support)\n * `libbz2` (*optional*, for bzip2 support)\n\n## Building and Installation\n\nFetch this repository and init submodules:\n\n```shell\n$ git clone --recurse-submodules https://github.com/ad-freiburg/pfaedle\n```\n\n```shell\n$ mkdir build \u0026\u0026 cd build\n$ cmake ..\n$ make -j\n```\n\nTo install, type\n```shell\n$ make install\n```\n\n# General Usage\n\n## Generating shapes for a GTFS feed\n\n```shell\n$ pfaedle -x \u003cOSM FILE\u003e \u003cGTFS INPUT FEED\u003e\n```\n\nA shape'd version of the input GTFS feed will be written to `./gtfs-out`.\n\nBy default, shapes are only calculated for trips that don't have a shape in the\ninput feed. To drop all existing shapes, use the `-D` flag.\n\nFor example, you may generate (and replace existing, see `-D` flag) shapes for the GTFS dataset for Freiburg like this:\n\n```shell\n$ wget https://fritz.freiburg.de/csv_Downloads/VAGFR.zip\n$ wget http://download.geofabrik.de/europe/germany/baden-wuerttemberg/freiburg-regbez-latest.osm.bz2\n$ pfaedle -D -x freiburg-regbez-latest.osm.bz2 VAGFR.zip\n```\n\n## Generating shapes for a specific MOT\n\nTo generate shapes for a specific mot only, use the `-m` option. Possible\nvalues are either `tram`, `bus`, `coach`, `rail`, `subway`, `ferry`, `funicular`,\n`gondola`, `all` (default) or GTFS route type codes (0, 1, 2, 3, 4, 5, 6, 7, or [extended route types](https://developers.google.com/transit/gtfs/reference/extended-route-types)). Integer codes will only match the specific route type, while string codes will match classes of route types. For example, `-m 101` will only match routes with `route_type` `101` (high speed rail), while `-m rail` will match any rail service encoded via a standard `route_type` `2` or an extended `route_type` describing a rail service (e.g. `100`, `101`, `102`, ...).\n\nMultiple values can be specified (comma separated).\n\n## OSM filtering\n\n`pfaedle` comes with the ability to filter OpenStreetMap data. If you specify\nthe `-X` flag, `pfaedle` will filter the input OSM file and output a new OSM\nfile which contains exactly the data needed to calculate the shapes for the\ninput GTFS feed and the input configuration.\n\nThis can be used to avoid parsing (for example) the entire `planet.osm` on each\nrun.\n\n## via Docker\n\nYou can use the [Docker image](https://github.com/orgs/ad-freiburg/packages/container/package/pfaedle) by mounting the OSM \u0026 GTFS data into the container:\n\n```shell\n$ docker pull ghcr.io/ad-freiburg/pfaedle:latest\n$ docker run -i --rm \\\n\t# mount OSM data\n\t--volume /path/to/osm/data:/osm \\\n\t# mount GTFS data\n\t--volume /path/to/gtfs/data:/gtfs \\\n\t# mount default output folder gtfs-out\n\t--volume /path/to/output-dir:/gtfs-out \\\n\tghcr.io/ad-freiburg/pfaedle:latest \\\n\t# tell pfaedle where to find the data\n\t-x /osm/osm-data.xml.bz2 -i /gtfs/myfeed.zip\n```\n\n## Debugging\n\nThe following flags may be useful for debugging:\n\n * `-T \u003cGTFS TRIP ID\u003e` only calculate shape for a single trip (specified via its GTFS trip id) and output it as GeoJSON to\n   `\u003cdbg-path\u003e/path.json`\n * `--write-graph` write the graph used for routing as GeoJSON to\n * `--write-trgraph` write the complete network graph to `\u003cdbg-path\u003e/trgraph.json`\n\n# Configuration\n\nA default configuration file `pfaedle.cfg` can be found in this repo and will be installed with `make install`. Custom configuration files can be specified with the `-c` flag. If no `-c` flag is set, `pfaedle` will parse and merge the following cfg files in the given order (if present): `\u003cinstall prefix\u003e/etc/pfaedle/pfaedle.cfg`, `$HOME/.config/pfaedle/pfaedle.cfg`, `\u003cCWD\u003e/pfaedle.cfg`. Values given in later files will overwrite earlier defined values.\n\n# Attribution\n\nNote that the `shapes.txt` produced by `pfaedle` is based on OpenStreetMap data, which is licensed under ODbL 1.0 (see [here](https://osm.org/copyright)). If you copy, distribute, transmit or adapt the shapefied GTFS feed, please credit the contributors of OpenStreetMap.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-freiburg%2Fpfaedle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-freiburg%2Fpfaedle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-freiburg%2Fpfaedle/lists"}