{"id":28298981,"url":"https://github.com/patrickbr/gtfstidy","last_synced_at":"2025-06-15T07:30:52.862Z","repository":{"id":49845745,"uuid":"65672890","full_name":"patrickbr/gtfstidy","owner":"patrickbr","description":"A tool for checking, sanitizing and minimizing GTFS feeds.","archived":false,"fork":false,"pushed_at":"2025-02-11T10:28:08.000Z","size":196,"stargazers_count":131,"open_issues_count":13,"forks_count":18,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-30T06:19:30.179Z","etag":null,"topics":["gtfs","minimization","tidy","validation"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickbr.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":"2016-08-14T15:26:58.000Z","updated_at":"2025-05-12T11:58:14.000Z","dependencies_parsed_at":"2023-11-28T09:26:31.236Z","dependency_job_id":"9f7b180d-5340-4b66-ae08-ebcf510bb7e1","html_url":"https://github.com/patrickbr/gtfstidy","commit_stats":{"total_commits":134,"total_committers":5,"mean_commits":26.8,"dds":"0.20149253731343286","last_synced_commit":"646982af85abff972d50f1976e24f3f9029bb523"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/patrickbr/gtfstidy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbr%2Fgtfstidy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbr%2Fgtfstidy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbr%2Fgtfstidy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbr%2Fgtfstidy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickbr","download_url":"https://codeload.github.com/patrickbr/gtfstidy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickbr%2Fgtfstidy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259940447,"owners_count":22935283,"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":["gtfs","minimization","tidy","validation"],"created_at":"2025-05-23T06:15:40.667Z","updated_at":"2025-06-15T07:30:52.848Z","avatar_url":"https://github.com/patrickbr.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/patrickbr/gtfstidy)](https://goreportcard.com/report/github.com/patrickbr/gtfstidy) [![Go Reference](https://pkg.go.dev/badge/github.com/patrickbr/gtfstidy.svg)](https://pkg.go.dev/github.com/patrickbr/gtfstidy)\n\n# gtfstidy\n\nTidy (and validate) [GTFS](https://developers.google.com/transit/gtfs/) feeds.\n\nFixes small inconsistencies, minimizes the overall feed size, and prepares the feed for secure, standard-compliant further use.\n\nOutput feeds are **semantically equivalent** to the input feed. In this context, semantical equivalency means that the output feed provides exactly the same trips with exactly the same attributes (routes, stop-times, shapes, agency, fares etc.). In other words, the output feed is equivalent to the input feed from a passenger's perspective.\n\n## 0. Features\n\n* **Clean CSV output.** Only quote string values where needed, use dynamic float precision and remove whitespace. Only output files that are necessary.\n* **Default-value error handling.** If non-required fields in the input-feed have errors, fall back to the default value according to the GTFS standard\n* **Drop-entities error handling.** If non-fixable errors occur, drop the affected entity (trip, route, stop, etc.).\n* **Orphan deletion**. Delete stops, routes, stop times and shapes that aren't referenced anywhere\n* **ID minimization**. Replace IDs with dense integer or character IDs\n* **Shape minimization**. Minimize shape geometries using the [Douglas-Peucker](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm) algorithm\n* **Service minimization**. Minimize services in `calender.txt` and `calender_dates.txt` by searching optimal progression and/or exception covers.\n* **Trip/Stop-Time minimization**. Minimize trips and stop-times by analyzing `stop_times.txt` and `frequencies.txt` and searching for optimal frequency covers.\n* **Shape remeasurement**. If shape measures (`shape_dist_traveled`) have gaps, try to fill them by interpolating surrounding measurements\n* **Duplicate removal**. Safely remove routes, shapes and services that are semantically equivalent to others and combine them into one.\n* **Extensive feed validation**. Validation includes for example checking stop time progressions, ID references, ID collisions,  missing required fields, shape measurements, timezone strings, general field value range validity, URLs, mail addresses, ISO language codes, timepoint validity ...\n* **Entropy-minimizing heuristics**. Sort lines prior to writing them to keep the entropy of the resulting CSV files small. This often leads to better compression results (see below).\n\nFor more features, see the help page (`--help`).\n\n## 1. Installation\n    $ go install github.com/patrickbr/gtfstidy@latest\n\n## 2. Usage\nEach GTFS processor has to be enabled explicitly. See\n\n    $ gtfstidy --help\n\nfor possible options.\n\nYou can use\n\n\t$ gtfstidy -v \u003cfeed\u003e\n\nto do a simple feed validation.\n\n## 3. Example\n\nProcess the SFMTA-Feed with all processors enabled:\n\n    $ gtfstidy -SCRmTcdsOeD sanfrancisco.zip\n\nValidate the SFMTA-Feed:\n\n    $ gtfstidy -v sanfrancisco.zip\n\n## 4. Evaluation\n\nAll zipped sizes using `zip -9`.\n\n### SFMTA feed\n\nProcessed with `-SCRmTcdsOeD`.\n\n| File  | # lines before | size before (B) | | # lines after | size after (B) |\n|---|---|---|---|---|---|\n| `agency.txt`  | 2  | 159 | | 2 | 153 |\n| `calendar_dates.txt`  | 11  | 172  | | 11 | 161 |\n| `calendar.txt`  | 4  | 194  | | 4 | 190 |\n| `fare_attributes.txt`  | 3  |  109 | | 3 | 107 |\n| `fare_rules.txt`  | 83 | 1k  | | 83 |  392 |\n| `frequencies.txt` | --- | ---  | | **3,904** | **111k** |\n| `routes.txt`  | 83  | 3,2K   | | 83 | 1,9k |\n| `shapes.txt`  | 201,831  |  7.4M  | | **19,863** | **620K** |\n| `stops.txt`  | 3,556  | 212K   | | 3,540 | 172K |\n| `stop_times.txt`  | 1,115,598  | 46M   | | **893,344** | **25M** |\n| `trips.txt`  | 28,989  | 1,4M   | | **21,741** | **739K** |\n\nCompression gain:\n\n| File  | processors | size before (B)| | size after (B)|\n|---|---|---|---|---|\n| `feed.zip`  | `-SCRmTcdsOeD` | 8.8M | | **5.9M** |\n| `feed.zip`  | *none* | 8.8M | | 8.5M |\n\n### Switzerland feed\n\nProcessed with `-SCRmTcdsOeD`.\n\n| File  | # lines before | size before (B) | | # lines after | size after (B) |\n|---|---|---|---|---|---|\n| `agency.txt`  | 424  | 40K | | 424 | 33K |\n| `calendar_dates.txt`  | 4,387,195  | 113M  | | **455,843** | **6.6M** |\n| `calendar.txt`  | 32,822  | 2M  | | **28,873** | **1014K** |\n| `fare_attributes.txt`  | --- |  --- | | --- | --- |\n| `fare_rules.txt`  | --- | ---  | | --- |  --- |\n| `frequencies.txt` | --- | ---  | | **2,023** | **57K** |\n| `routes.txt`  | 5,564  | 254K   | | 4,613 | **105K** |\n| `shapes.txt`  | ---  | --- | | --- | --- |\n| `stops.txt`  | 31,753  | 2.4M  | | 31,753 | **1.4M** |\n| `stop_times.txt`  | 11,569,991  | 790M   | | **10,771,471** | **323M** |\n| `transfers.txt`  | 21,691  | 846K | | 21,691 | **295K** |\n| `trips.txt`  | 1,055,231  | 86M | | **662,771** | **26M** |\n\nCompression gain:\n\n| File  | processors | size before (B)| | size after (B)|\n|---|---|---|---|---|\n| `feed.zip`  | `-SCRmTcdsOeD` | 80M | | **63M** |\n| `feed.zip`  | *none* | 80M | | 77M |\n\n### Prague feed\n\nProcessed with `-SCRmTcdsOeD`.\n\n| File  | # lines before | size before (B) | | # lines after | size after (B) |\n|---|---|---|---|---|---|\n| `agency.txt`  | 21  | 1.7K | | 21 | 1.6K |\n| `calendar_dates.txt`  | 1  | 32  | | 8 | 122 |\n| `calendar.txt`  | 49  | 1.8K  | | 27 | 972 |\n| `fare_attributes.txt`  | ---  |  --- | | --- | --- |\n| `fare_rules.txt`  | --- | ---  | | --- |  --- | ? |\n| `frequencies.txt` | --- | ---  | | **21,425** | **604K** |\n| `routes.txt`  | 434  | 25K   | | 434 | 22K |\n| `shapes.txt`  | 784,062  |  22M  | | **578,211** | **15M** |\n| `stops.txt`  | 7,401  | 385K   | | 7,401 | 323K |\n| `stop_times.txt`  | 1,879,757  | 69M   | | **751,415** | **23M** |\n| `trips.txt`  | 87,348  | 3.3M   | | **34,812** | **1.1M** |\n\nCompression gain:\n\n| File  | processors | size before (B)| | size after (B)|\n|---|---|---|---|---|\n| `feed.zip`  | `-SCRmTcdsOeD` | 16M | | **9.4M** |\n| `feed.zip`  | *none* | 16M | | 16M |\n\n## 5. Available processors\n\nThere are two classes of processors. Processors with a lowercase flag modify existing entries. Processors with an uppercase flag **delete** existing entries, either because they are duplicates or because they can be combined with other entries.\n\n### ID minimizer\n\n---\n\nIDs are packed into dense integer arrays, either as base 10 or base 36 integers. You should not use this processor if you are referencing entities from outside the static feed (for example, if the IDs are references from a GTFS-realtime feed).\n\n#### Flags\n\n* `-i`: pack IDs into dense base 10 integers\n* `-d`: pack IDs into dense base 36 integers\n\n#### Modifies\nEvery file.\n\n\n#### Example\n##### Before\n\n`routes.txt`\n\n```\nroute_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color\nAB,DTA,10,Airport - Bullfrog,,3,,,\nBFC,DTA,20,Bullfrog - Furnace Creek Resort,,3,,,\nSTBA,DTA,30,Stagecoach - Airport Shuttle,,3,,,\nCITY,DTA,40,City,,3,,,\nAAMV,DTA,50,Airport - Amargosa Valley,,3,,,\nAAMV2,DTA,50,Airport - Amargosa Valley,,3,,,\n```\n\n##### After\n`routes.txt`\n```\nroute_id,agency_id,route_short_name,route_long_name,route_type\n2,1,20,Bullfrog - Furnace Creek Resort,3\n3,1,30,Stagecoach - Airport Shuttle,3\n4,1,40,City,3\n5,1,50,Airport - Amargosa Valley,3\n6,1,50,Airport - Amargosa Valley,3\n1,1,10,Airport - Bullfrog,3\n```\n\n### Orphan remover\n\n---\n\nFeed is checked for entries that are not referenced anywhere. These entries are removed from the output.\n\n#### Flags\n* `-O`: remove entities that are not referenced anywhere\n\n#### Modifies\n\n`trips.txt`, `stops.txt`, `routes.txt`, `calendar_dates.txt`, `calendar.txt`\n\n#### Example\n\n##### Before\n\n`stops.txt`\n\n```\nstop_id,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,parent_station\nMETA1,Furnace Creek,,36.425288,-117.1333162,,,\nMETA2,Furnace Creek,,36.425288,-117.1333162,,,\nFUR_CREEK_RES,Furnace Creek Resort (Demo),,36.425288,-117.133162,,,META1\n```\n\n##### After\n\n`stops.txt`\n\n```\nstop_id,stop_name,stop_lat,stop_lon,parent_station\nMETA1,Furnace Creek,36.42529,-117.133316,\nFUR_CREEK_RES,Furnace Creek Resort (Demo),36.42529,-117.13316,META1\n```\n\n### Shape minimizer\n\n---\n\nMinimizes shape geometries using Douglas-Peucker. This processor **implicitly calls the shape remeasurer!** The shape coordinates are projected to web mercator ([EPSG:3857](http://spatialreference.org/ref/sr-org/7483/)) prior to minimization. The ε value for Douglas-Peucker is set to 1.0\n\n#### Flags\n\n* `-s`: minimize shapes (using Douglas-Peucker)\n\n#### Modifies\n\n`shapes.txt`\n\n#### Example\n\n##### Before\n\n`shapes.txt`\n\n```\nshape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled\nA_shp,0,0,1,\nA_shp,0.6,0.5,2,6.8310\nA_shp,1,1,3,15.8765\nA_shp,2,1,4\nA_shp,3,1,5,36.76\nA_shp,3.5,1,6,\nB_shp,0,0,1,\nB_shp,0.6,0.5,2,6.8310\nB_shp,1,1,3,15.8765\nB_shp,2,1,4\nB_shp,3,1,5,36.76\nB_shp,3.5,1,6,\n```\n\n##### After\n\n`shapes.txt`\n\n```\nshape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled\nA_shp,0,0,1,0\nA_shp,0.6,0.5,2,6.831\nA_shp,1,1,3,15.8765\nA_shp,3.5,1,6,42.910156\nB_shp,0,0,1,0\nB_shp,0.6,0.5,2,6.831\nB_shp,1,1,3,15.8765\nB_shp,3.5,1,6,42.910156\n```\n### Service minimizer\n\n---\n\nMinimizes service ranges in `calendar.txt` and `calendar_dates.txt` by searching for optimal coverages of range entries in `calendar.txt` and exception entries in `calendar_dates.txt`.\n\n#### Flags\n\n* `-c`: minimize services by searching for the optimal exception/range coverage\n\n#### Modifies\n\n`calendar.txt`, `calendar_dates.txt`\n\n#### Example\n\n##### Before\n\n`calendar.txt`\n\n```\n(empty)\n```\n\n`calendar_dates.txt`\n\n```\nservice_id,date,exception_type\nFULLW,20160814,1\nFULLW,20160815,2\nFULLW,20160816,1\nFULLW,20160817,1\nFULLW,20160818,1\nFULLW,20160819,1\nFULLW,20160820,1\nFULLW,20160821,1\n```\n\n##### After\n\n`calendar.txt`\n\n```\nservice_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date\nFULLW,0,1,1,1,1,1,1,20160814,20160821\n```\n`calendar_dates.txt`\n```\n(empty)\n```\n\n### Trip/Stop-times minimizer\n\nMinimizes stop times in `stop_times.txt` and trips in `trips.txt` by searching for progression (frequency) covers on the stop times. If multiple trips with equivalent attributes (route, shapes etc) and the same relative stop times are found, they are checked for frequency patterns. If a pattern can be found, the trips are combined into a single frequency-based trip (via `frequency.txt`). Existing frequencies in `frequencies.txt` are also optimized and/or combined with entries in `stop_times.txt`.\n\nThe algorithm is based on a CAP (Cover by Arithmetic Progression) algorithm proposed by [Hannah Bast and Sabine Storandt](http://ad-publications.informatik.uni-freiburg.de/SIGSPATIAL_frequency_BS_2014.pdf).\n\n#### Flags\n\n* `-T`: search for frequency patterns in explicit trips and combine them\n\n#### Modifies\n\n`trips.txt`, `stop_times.txt`, `frequencies.txt`\n\n#### Example\n\n##### Before\n\n`stop_times.txt`\n```\ntrip_id,arrival_time,departure_time,stop_id,stop_sequence\nAB1a,8:00:00,8:00:00,BEATTY_AIRPORT,1\nAB1a,8:10:00,8:15:00,BULLFROG,2\nAB1b,8:10:00,8:10:00,BEATTY_AIRPORT,1\nAB1b,8:20:00,8:25:00,BULLFROG,2\nAB1c,8:20:00,8:20:00,BEATTY_AIRPORT,1\nAB1c,8:30:00,8:35:00,BULLFROG,2\nAB1d,8:30:00,8:30:00,BEATTY_AIRPORT,1\nAB1d,8:40:00,8:45:00,BULLFROG,2\n```\n`trips.txt`\n```\nroute_id,service_id,trip_id,trip_headsign,direction_id,block_id,shape_id\nAB,FULLW,AB1a,to Bullfrog,0,1,A_shp\nAB,FULLW,AB1b,to Bullfrog,0,1,A_shp\nAB,FULLW,AB1c,to Bullfrog,0,1,A_shp\nAB,FULLW,AB1d,to Bullfrog,0,1,A_shp\n```\n`frequencies.txt`\n```\n(empty)\n```\n\n##### After\n\n`stop_times.txt`\n```\ntrip_id,arrival_time,departure_time,stop_id,stop_sequence\nAB1a,8:00:00,8:00:00,BEATTY_AIRPORT,1\nAB1a,8:10:00,8:15:00,BULLFROG,2\n```\n`trips.txt`\n```\nroute_id,service_id,trip_id,trip_headsign,direction_id,block_id,shape_id\nAB,FULLW,AB1a,to Bullfrog,0,1,A_shp\n```\n`frequencies.txt`\n```\ntrip_id,start_time,end_time,headway_secs,exact_times\nAB1a,8:00:00,8:40:00,600,1\n```\n### Route duplicate remover\n\n---\n\nRemoves duplicate routes (routes that have the same attributes and the same fare rules), updates references in `trips.txt` and deletes redundant rules in `fare_rules.txt` as well.\n\n#### Flags\n\n* `-R`: remove route duplicates\n\n#### Modifies\n\n`routes.txt`, `trips.txt`, `fare_rules.txt`\n\n#### Example\n\n##### Before\n\n`routes.txt`\n\n```\nroute_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color\nAB,DTA,10,Airport - Bullfrog,,3,,,\nBFC,DTA,20,Bullfrog - Furnace Creek Resort,,3,,,\nCFC,DTA,20,Bullfrog - Furnace Creek Resort,,3,,,\n```\n`fare_rules.txt`\n```\nfare_id,route_id,origin_id,destination_id,contains_id\np,AB,,,\np,BFC,,,\np,CFC,,,\n```\n\n##### After\n\n`routes.txt`\n```\nroute_id,agency_id,route_short_name,route_long_name,route_type\nAB,DTA,10,Airport - Bullfrog,3\nCFC,DTA,20,Bullfrog - Furnace Creek Resort,3\n```\n\n`fare_rules.txt`\n```\nfare_id,route_id\np,AB\np,CFC\n```\n\n### Service duplicate remover\n\n---\n\nRemoves duplicate services (services that cover the same set of dates) and updates references.\n\n#### Flags\n\n* `-C`: remove duplicate services in calendar.txt and calendar_dates.txt\n\n#### Modifies\n\n`calendar_dates.txt`, `calendar.txt`, `trips.txt`\n\n#### Example\n\n##### Before\n\n`calendar_dates.txt`\n```\nservice_id,date,exception_type\nB,20160815,1\nB,20160816,1\nB,20160817,1\nB,20160818,1\nB,20160819,1\nB,20160820,1\n```\n`calendar.txt`\n```\nservice_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date\nA,1,1,1,1,1,1,0,20160814,20160821\n```\n\n##### After\n\n`calendar_dates.txt`\n```\n(empty)\n```\n`calendar.txt`\n```\nservice_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date\nA,1,1,1,1,1,1,0,20160814,20160821\n```\n\n### Shape duplicate remover\n\n---\n\nRemoves duplicate shapes and updates references in `trips.txt`. Shape equality testing is done with a simple heuristic which resembles the [Fréchet-Distance](https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance) but is faster. The check never underestimates the distance between two shapes, but overestimates it for shapes with total distances that are `\u003e\u003e` the max distance. **This processor implicitely calls the shape remeasurer**.\n\n#### Flags\n* `-S`: remove shape duplicates\n\n#### Modifies\n`shapes.txt`, `trips.txt`\n\n#### Example\n\n##### Before\n\n`shapes.txt`\n\n```\nshape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled\nA_shp,0,0,1,0\nA_shp,0.6,0.5,2,6.831\nA_shp,1,1,3,15.8765\nA_shp,2,1,4,26.315065\nA_shp,3,1,5,36.76\nA_shp,3.5,1,6,42.910156\nB_shp,0,0,1,0\nB_shp,0.6,0.5,2,6.831\nB_shp,1,1,3,15.8765\nB_shp,2,1,4,26.315065\nB_shp,3,1,5,36.75\nB_shp,3.500005,1,6,42.91\n```\n\n##### After\n\n`shapes.txt`\n\n```\nshape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled\nB_shp,0,0,1,0\nB_shp,0.6,0.5,2,6.831\nB_shp,1,1,3,15.8765\nB_shp,2,1,4,26.315065\nB_shp,3,1,5,36.75\nB_shp,3.500005,1,6,42.91\n```\n\n### Shape remeasurer\n\n---\n\nRemeasures shapes and fills measurement gaps.\n\n#### Flags\n\n* `-m`: remeasure shapes (filling measurement-holes)\n\n#### Modifies\n\n`shapes.txt`\n\n#### Example:\n\n##### Before\n\n`shapes.txt`\n\n```\nshape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled\nA_shp,0,0,1,\nA_shp,0.6,0.5,2,6.8310\nA_shp,1,1,3,15.8765\nA_shp,2,1,4\nA_shp,3,1,5,36.76\nA_shp,3.5,1,6,\n```\n\n##### After\n\n`shapes.txt`\n\n```\nshape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled\nA_shp,0,0,1,0\nA_shp,0.6,0.5,2,6.831\nA_shp,1,1,3,15.8765\nA_shp,2,1,4,26.315065\nA_shp,3,1,5,36.76\nA_shp,3.5,1,6,42.910156\n\n```\n\n### Set erroneous values to standard defaults\n\n---\n\nIf optional field values of feed entries have errors, this processors sets them to the default values specified in the GTFS standard.\n\n#### Flags\n\n* `-e`: if non-required fields have errors, fall back to the default values\n\n#### Modifies\n\nEvery file, if errors are present.\n\n#### Example:\n\n##### Before\n\n`routes.txt`\n\n```\nroute_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color\nAB,DTAoopserror,10,Airport - Bullfrog,,3,,,\nBFC,DTA,20,Bullfrog - Furnace Creek Resort,,3,,,\nSTBA,DTA,30,Stagecoach - Airport Shuttle,,3,,,\nCITY,DTA,40,City,,3,,,\nAAMV,DTA,50,Airport - Amargosa Valley,,3,,,\nAAMV2,DTA,50,Airport - Amargosa Valley,,3,,,\n```\n\n##### After\n\n`routes.txt`\n\n```\nroute_id,agency_id,route_short_name,route_long_name,route_type\nCITY,DTA,40,City,3\nAAMV,DTA,50,Airport - Amargosa Valley,3\nAAMV2,DTA,50,Airport - Amargosa Valley,3\nAB,,10,Airport - Bullfrog,3\nBFC,DTA,20,Bullfrog - Furnace Creek Resort,3\nSTBA,DTA,30,Stagecoach - Airport Shuttle,3\n```\n\n### Drop erroneous entries\n\n---\n\nIf feed entries have errors that can't be fixed in any other way (e.g. by `-e`), this processor completely removes them. This cascades through the entire feed: if an erroneous route is deleted, all trips that refer to this route are also deleted, all stop times for trips referencing this route are deleted as well and so on. You effectively get an error-free subset of the input feed.\n\n#### Flags:\n\n* `-D`: drop erroneous entries from feed\n\n#### Modifies:\n\nEvery file, if errors are present.\n\n#### Example:\n\n##### Before\n\n`routes.txt`\n\n```\nroute_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color\nAB,DTAoopserror,10,Airport - Bullfrog,,3,,,\nBFC,DTA,20,Bullfrog - Furnace Creek Resort,,3,,,\nSTBA,DTA,30,Stagecoach - Airport Shuttle,,3,,,\nCITY,DTA,40,City,,3,,,\nAAMV,DTA,50,Airport - Amargosa Valley,,3,,,\nAAMV2,DTA,50,Airport - Amargosa Valley,,3,,,\n```\n\n##### After\n\n`routes.txt`\n\n```\nroute_id,agency_id,route_short_name,route_long_name,route_type\nCITY,DTA,40,City,3\nAAMV,DTA,50,Airport - Amargosa Valley,3\nAAMV2,DTA,50,Airport - Amargosa Valley,3\nBFC,DTA,20,Bullfrog - Furnace Creek Resort,3\nSTBA,DTA,30,Stagecoach - Airport Shuttle,3\n```\n\n## 6. Processing order\n\nThe order in which feed processors are called is *always the same*, regardless of the flag ordering. The processors are run in this order:\n\n1. Default erroneous values (`-e`)\n2. Drop erroneous entries (`-D`)\n3. Remove orphans (`-O`)\n4. Remeasure shapes (`-m`)\n5. Minimize shapes (`-s`)\n6. Remove shape duplicates (`-S`)\n7. Remove route duplicates (`-R`)\n8. Remove service duplicates (`-C`)\n9. Minimize services (`-c`)\n10. Minimize stop-times/trips (`-T`)\n11. Minimize IDs (`-i` or `-d`)\n\n## 7. License\n\nGPL v2, see LICENSE\n","funding_links":[],"categories":["Producing Data","Uncategorized"],"sub_categories":["GTFS","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickbr%2Fgtfstidy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickbr%2Fgtfstidy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickbr%2Fgtfstidy/lists"}