{"id":13724319,"url":"https://github.com/ipeaGIT/gtfs2emis","last_synced_at":"2025-05-07T18:31:37.563Z","repository":{"id":37483639,"uuid":"218305263","full_name":"ipeaGIT/gtfs2emis","owner":"ipeaGIT","description":"R package to estimate public transport emissions based on GTFS data","archived":false,"fork":false,"pushed_at":"2024-10-25T22:01:45.000Z","size":35406,"stargazers_count":28,"open_issues_count":12,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T22:31:30.672Z","etag":null,"topics":["emissions","environmental-modelling","gtfs","public-transport","r","rspatial","transport"],"latest_commit_sha":null,"homepage":"https://ipeagit.github.io/gtfs2emis/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipeaGIT.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}},"created_at":"2019-10-29T14:21:46.000Z","updated_at":"2024-10-25T21:53:59.000Z","dependencies_parsed_at":"2023-09-21T19:31:31.817Z","dependency_job_id":"425411d3-5641-48b8-a658-a32f95ebc3e7","html_url":"https://github.com/ipeaGIT/gtfs2emis","commit_stats":{"total_commits":653,"total_committers":6,"mean_commits":"108.83333333333333","dds":"0.38897396630934145","last_synced_commit":"af541d770b92b5879449546cc95766f0ca131490"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgtfs2emis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgtfs2emis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgtfs2emis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipeaGIT%2Fgtfs2emis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipeaGIT","download_url":"https://codeload.github.com/ipeaGIT/gtfs2emis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222281122,"owners_count":16960154,"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":["emissions","environmental-modelling","gtfs","public-transport","r","rspatial","transport"],"created_at":"2024-08-03T01:01:54.792Z","updated_at":"2025-05-07T18:31:37.538Z","avatar_url":"https://github.com/ipeaGIT.png","language":"R","readme":"# gtfs2emis: Estimating public transport emissions from GTFS data \u003cimg src=\"man/figures/logo.png\" alt=\"logo\" align=\"right\" width=\"180\"/\u003e\n\n[![CRAN/METACRAN\nVersion](https://www.r-pkg.org/badges/version/gtfs2emis)](https://CRAN.R-project.org/package=gtfs2emis)\n[![CRAN/METACRAN Total\ndownloads](https://cranlogs.r-pkg.org/badges/grand-total/gtfs2emis?color=blue)](https://CRAN.R-project.org/package=gtfs2emis)\n[![R-CMD-check](https://github.com/ipeaGIT/gtfs2emis/workflows/R-CMD-check/badge.svg)](https://github.com/ipeaGIT/gtfs2emis/actions)\n[![Lifecycle:\nexperimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![Codecov test\ncoverage](https://codecov.io/gh/ipeaGIT/gtfs2emis/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ipeaGIT/gtfs2emis?branch=master)\n[![DOI](https://img.shields.io/badge/DOI-10.1016/j.trd.2023.103757-blue)](https://doi.org/10.1016/j.trd.2023.103757)\n\n**gtfs2emis** is an R package to estimate the emission levels of public\ntransport vehicles based on General Transit Feed Specification (GTFS)\ndata. The package requires two main inputs: i) public transport data in\nGTFS standard format; and ii) some basic information on fleet\ncharacteristics such as vehicle age, technology, fuel, and Euro stage.\nAs it stands, the package estimates several pollutants (see table below)\nat high spatial and temporal resolutions. Pollution levels can be\ncalculated for specific transport routes, trips, time of the day, or for\nthe transport system as a whole. The output with emission estimates can\nbe extracted in different formats, supporting analysis of how emission\nlevels vary across space, time, and by fleet characteristics. A full\ndescription of the methods used in the gtfs2emis model is presented in\n[Vieira, Pereira and Andrade\n(2022)](https://doi.org/10.31219/osf.io/8m2cy).\n\n## Installation\n\nYou can install `gtfs2emis`:\n\n``` r\n# From CRAN\ninstall.packages(\"gtfs2emis\")\nlibrary(gtfs2emis)\n\n# or use the development version with latest features\nutils::remove.packages('gtfs2emis')\ndevtools::install_github(\"ipeaGIT/gtfs2emis\")\nlibrary(gtfs2emis)\n```\n\n## Usage and Data requirements\n\nThe `gtfs2emis` package has two core functions.\n\n1.  `transport_model()` converts GTFS data into a GPS-like table with\n    the space-time positions and speeds of public transport vehicles.\n    The only input required is a `GTFS.zip` feed.\n\n2.  `emission_model()` estimates hot-exhaust emissions based on four\n    inputs:\n\n-   1)  the result from the `transport_model()`;\n-   2)  a `data.frame` with info on fleet characteristics;\n-   3)  a `string` indicating which emission factor model should be considered;\n-   4)  a `string` indicating which pollutants should be estimated.\n\nTo help users analyze the output from `emission_model()`, the\n`gtfs2emis` package has few functions:\n\n3.  `emis_to_dt()` to convert the output of `emission_model()` from\n    `list` to `data.table`.\n4.  `emis_summary()` to aggregate emission estimates by the time of the\n    day, vehicle type, or road segment.\n5.  `emis_grid()` to spatially aggregate emission estimates using any\n    custom spatial grid or polygons.\n\n## Demonstration on sample data\n\nTo illustrate functionality, the package includes small sample data sets\nof the public transport and fleet of Curitiba (Brazil), Detroit (USA),\nand Dublin (Ireland). Estimating the emissions of a given public\ntransport system using `gtfs2emis` can be done in three simple steps, as\nfollows.\n\n### 1. Run transport model\n\nThe first step is to use the `transport_model()` function to convert\nGTFS data into a GPS-like table, so that we can get the space-time\nposition and speed of each vehicle of the public transport system at\nhigh spatial and temporal resolutions.\n\n``` r\n# read GTFS.zip\ngtfs_file \u003c- system.file(\"extdata/irl_dub_gtfs.zip\", package = \"gtfs2emis\")\ngtfs \u003c- gtfstools::read_gtfs(gtfs_file)\n\n# generate transport model\ntp_model \u003c- transport_model(gtfs_data = gtfs,spatial_resolution = 100,parallel = TRUE) \n```\n\n### 2. Prepare fleet data\n\nThe second step is to prepare a `data.frame` with some characteristics\nof the public transport fleet. Note that different emission factor\nmodels may require information on different fleet characteristics, such\nas vehicle age, type, Euro standard, technology, and fuel. This can be\neither: - A simple table with the overall composition of the fleet. In\nthis case, the `gtfs2emis` will assume that fleet is homogeneously\ndistributed across all routes; OR - A detailed table that (1) brings\ninfo on the characteristics of each vehicle and, (2) tells the\nprobability with which each vehicle type is allocated to each transport\nroute.\n\nHere is what a simple fleet table to be used with the EMEP-EEA emission\nfactor model looks like:\n\n``` r\nfleet_file \u003c- system.file(\"extdata/irl_dub_fleet.txt\", package = \"gtfs2emis\")\n\nfleet_df \u003c- read.csv(fleet_file)\nfleet_df\n#\u003e             veh_type euro fuel   N fleet_composition    tech\n#\u003e 1 Ubus Std 15 - 18 t  III    D  10        0.00998004       -\n#\u003e 2 Ubus Std 15 - 18 t   IV    D 296        0.29540918     SCR\n#\u003e 3 Ubus Std 15 - 18 t    V    D 148        0.14770459     SCR\n#\u003e 4 Ubus Std 15 - 18 t   VI    D 548        0.54690619 DPF+SCR\n```\n\n### 3. Run emission model\n\nIn the final step, the `emission_model()` function to estimate hot\nexhaust emissions of our public transport system. Here, the user needs\nto pass the results from `transport_model()`, some fleet data as\ndescribed above, and select which emission factor model and pollutants\nshould be considered (see the options available below). The output from\n`emission_model()` is a `list` with several `vectors` and `data.frames`\nwith emission estimates and related information such as vehicle\nvariables (`fuel`, `age`, `tech`, `euro`, `fleet_composition`), travel\nvariables (`slope`, `load`, `gps`) or pollution (`EF`, `emi`).\n\n``` r\nemi_list \u003c- emission_model(tp_model = tp_model\n, ef_model = \"ef_europe_emep\"\n, fleet_data = fleet_df\n, pollutant = c(\"NOx\",\"PM10\")\n)\n\nnames(emi_list)\n#\u003e  [1] \"pollutant\"         \"veh_type\"          \"euro\"             \n#\u003e  [4] \"fuel\"              \"tech\"              \"slope\"            \n#\u003e  [7] \"load\"              \"speed\"             \"EF\"               \n#\u003e [10] \"emi\"               \"fleet_composition\" \"tp_model\"\n```\n\n## Emission factor models and pollutants available\n\nCurrently, the `gtfs2emis` package provides a computational method to\nestimate running exhaust emissions factors based on the following\nemission factor models:\n\n-   Brazil\n    -   CETESB: 2019 model from the Environmental Company of Sao Paulo (CETESB)\n-   Europe\n    -   [EMEP/EEA](https://www.eea.europa.eu/themes/air/air-pollution-sources-1/emep-eea-air-pollutant-emission-inventory-guidebook/emep):\n        European Monitoring and Evaluation Programme, developed by the\n        European Environment Agency (EEA).\n-   United States\n    -   [EMFAC2017/CARB](https://arb.ca.gov/emfac/): California Emission\n        Factor model, developed by the California Air Resources Board\n        (CARB).\n    -   [MOVES3/EPA](https://www.epa.gov/moves): Vehicle Emission\n        Simulator, developed by the Environmental Protection Agency\n        (EPA).\n\n#### List of pollutants available by emission factor models\n\n| Source         | Pollutants                                                                                                                         |\n|--------------|----------------------------------------------------------|\n| CETESB         | CH4, CO, CO2, ETOH, FC (Fuel Consumption), FS (Fuel Sales), gCO2/KWH, gD/KWH, HC, KML, N2O, NH3, NMHC, NO, NO2, NOx, PM10 and RCHO |\n| EMFAC2017/CARB | CH4, CO, CO2, N2O, NOx, PM10, PM25, ROG (Reactive Organic Gases), SOX, and TOG (Total Organic Gases)                               |\n| EMEP/EEA       | CH4, CO, CO2, EC, FC, N2O, NH3, NOx, PM10, SPN23 (#kWh), and VOC                                                                   |\n| MOVES3/EPA     | CH4, CO, CO2, EC, HONO, N2O, NH3, NH4, NO, NO2, NO3, NOx, PM10, PM25, SO2, THC, TOG, and VOC                                       |\n\n#### Fleet characteristics required by each emission factor model\n\n| Source         | Buses                        | Characteristics                              |\n|-----------------|----------------------|----------------------------------|\n| CETESB         | Micro, Standard, Articulated | Age, Fuel, EURO standard                     |\n| EMEP/EAA       | Micro, Standard, Articulated | Fuel, EURO standard, technology, load, slope |\n| EMFAC2017/CARB | Urban Buses                  | Age, Fuel                                    |\n| MOVES3/EPA     | Urban Buses                  | Age, Fuel                                    |\n\n### Emissions from road vehicle tire, brake, and surface wear\n\n`gtfs2emis` also provides emissions estimates from tire, brake and\nsurface wear using the [EMEP/EEA\nmodel](https://www.eea.europa.eu/themes/air/air-pollution-sources-1/emep-eea-air-pollutant-emission-inventory-guidebook/emep).\nThe function estimates emissions of particulate matter (PM),\nencompassing black carbon (BC), which arises from distinct sources\n(tire, brake, and road surface wear). The focus is on primary particles,\nwhich refer to those that are directly emitted, rather than those\ngenerated from the re-suspension of previously deposited material.\n\n## Learn more\n\nCheck out the guides for learning everything there is to know about all\nthe different features:\n\n-   [Getting\n    started](https://ipeagit.github.io/gtfs2emis/articles/gtfs2emis_intro_vignette.html)\n-   [Defining Fleet\n    data](https://ipeagit.github.io/gtfs2emis/articles/gtfs2emis_fleet_data.html)\n-   [Exploring Emission\n    Factors](https://ipeagit.github.io/gtfs2emis/articles/gtfs2emis_emission_factor.html)\n-   [Exploring Non Exhaust Emission\n    Factors](https://ipeagit.github.io/gtfs2emis/articles/gtfs2emis_non_exhaust_ef.html)\n\n### **Related packages**\n\nThere are several others transport emissions models available for\ndifferent purposes (see below). As of today, `gtfs2emis` is the only\nmethod with the capability to estimate emissions of public transport\nsystems using GTFS data.\n\n-   R: [vein](https://github.com/atmoschem/vein) Bottom-up and top-down\n    inventory using GPS data.\n-   R: [EmissV](https://github.com/atmoschem/emissv) Top-down inventory.\n-   Python:\n    [PythonEmissData](https://github.com/adelgadop/PythonEmissData)\n    Jupyter notebook to estimate simple top-down emissions.\n-   Python: [YETI](https://github.com/twollnik/YETI) YETI - Yet Another\n    Emissions From Traffic Inventory\n-   Python: [mobair](https://github.com/matteoboh/mobility_emissions)\n    bottom-up model using GPS data.\n\n### **Future enhancements**\n\n-   Include cold-start, resuspension, and evaporative emissions factors\n-   Add railway emission factors\n\n------------------------------------------------------------------------\n\n## Citation\n\n``` r\ncitation(\"gtfs2emis\")\n#\u003e To cite gtfs2emis in publications use:\n#\u003e \n#\u003e   Vieira, J. P. B., Pereira, R. H. M., \u0026 Andrade, P. R. (2023). Estimating \n#\u003e      Public Transport Emissions from General Transit Feed Specification Data. \n#\u003e      Transportation Research Part D: Transport and Environment. Volume 119, \n#\u003e      103757. https://doi.org/10.1016/j.trd.2023.103757\n#\u003e \n#\u003e A BibTeX entry for LaTeX users is\n#\u003e   \n#\u003e   @article{vieira2023estimating,\n#\u003e     title = {Estimating Public Transport Emissions from {{General Transit Feed Specification}} Data},\n#\u003e     author = {Vieira, Jo{\\~a}o Pedro Bazzo and Pereira, Rafael H. M. and Andrade, Pedro R.},\n#\u003e     year = {2023},\n#\u003e     month = jun,\n#\u003e     journal = {Transportation Research Part D: Transport and Environment},\n#\u003e     volume = {119},\n#\u003e     pages = {103757},\n#\u003e     issn = {1361-9209},\n#\u003e     doi = {10.1016/j.trd.2023.103757},\n#\u003e     urldate = {2023-05-06},\n#\u003e     langid = {english},\n#\u003e     keywords = {Emission factors,Emission models,GTFS,Gtfs2emis,Public transport emissions,Urban bus}\n#\u003e   }\n```\n\n### Credits \u003cimg src=\"man/figures/ipea_logo.png\" alt=\"ipea\" align=\"right\" width=\"300\"/\u003e\n\nThe **gtfs2emis** package is developed by a team at the Institute for\nApplied Economic Research (IPEA) in collaboration from the National\nInstitute for Space Research (INPE), both from Brazil.\n","funding_links":[],"categories":["Producing Data","Emissions"],"sub_categories":["GTFS","Emission Observation and Modeling"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FipeaGIT%2Fgtfs2emis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FipeaGIT%2Fgtfs2emis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FipeaGIT%2Fgtfs2emis/lists"}