gps2gtfs


Namegps2gtfs JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/aaivu/gps2gtfs
SummaryA Python package to process raw GPS data of public transit and transform to GTFS format.
upload_time2023-08-13 17:27:20
maintainer
docs_urlNone
authorAaivu
requires_python>=3.6
licenseMIT
keywords gtfs gps travel time public transit heterogeneous traffic condition its
VCS
bugtrack_url
requirements numpy pandas geopandas flake8 flake8-annotations flake8-bandit flake8-black flake8-bugbear flake8-import-order black
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gps2gtfs: A Python package to process raw GPS data of public transit and transform to GTFS format

![project] ![research]

- <b>Project Lead(s) / Mentor(s)</b>

  1. Dr. T. Uthayasanker

- <b>Contributor(s)</b>
  1. R. Shiveswarran
  2. S. Gopinath
  3. S. Kajanan
  4. A. Kesavi

## Description

<div style="text-align: justify;">
The "gps2gtfs" Python package provides a streamlined solution for preprocessing GPS (Global Positioning System) raw data and converting it into GTFS (General Transit Feed Specification) data format. Leveraging the power of DataFrame and GeoDataFrame with parallelization, this package offers efficient methods to extract essential trip details from raw GPS data. These details encompass trip sequences, stop information, arrival time to stops, departure time from stops, dwell time at stops, travel durations, running times between stops, and the seamless transformation into GTFS data structure. Currently, "gps2gtfs" handles static (schedule) trip data at heterogeneous traffic condition, with the potential for future expansion to accommodate dynamic real-time trip data. Furthermore, in the future, a visualization package can be seamlessly integrated with existing packages.
</div>

<br>

<b>Keywords:</b> GTFS, GPS, Travel Time, Public Transit, Heterogeneous Traffic Condition, ITS (Intelligent Transportation System)

## Architecture

<div style="text-align: justify;">
The "gps2gtfs" framework is developed using Python 3, with a thoughtfully designed package structure that ensures minimal interdependence among the main packages. The core components encompass distinct packages, each serving a specific purpose: data_field, load_data, preprocessing, trip, stop, reporting, pipeline, and utility. Users are expected to provide input for a single route, and the system facilitates the inclusion of multiple routes into the pipeline through user-driven iteration.
</div>

<br>

The package is structured into eight(8) primary packages:

1. <b>data_field:</b> This package is responsible for managing column names for user input and a predefined set of output columns. The fields provided by the user should be a superset of the defined fields within this package.
2. <b>load_data:</b> This package handles the loading of necessary data into the pipeline.
3. <b>preprocessing:</b> The preprocessing package is designed to clean the data loaded from the previous step.
4. <b>trip:</b> The trip package focuses on extracting trips and generating associated features.
5. <b>stop:</b> Within the stop package, the identification of stops and the creation of related features take place.
6. <b>reporting:</b> This package is responsible for generating outputs containing the extracted information.
7. <b>pipeline:</b> This package contains functionality to execute the trip extraction pipeline and the trip & stop extraction pipeline.
8. <b>utility:</b> The utility module provides support for various utility functions, including input/output operations, data conversions, and logging.


### Architecture digram of gps2gfts

<img width="1000" alt="img1" src="https://github.com/aaivu/gps2gtfs/assets/74850246/678af0a8-64e3-49b5-8fb6-66b331ea7cae" >

<hr>

### How the gps2gfts works

<img width="1000" alt="img2" src="https://github.com/aaivu/gps2gtfs/assets/74850246/92cf2e62-2be4-49e1-b401-78ebbe20d194">

<br>

## Quick Example

It is essential to provide input files in CSV format for proper functionality. Additionally, the utilization of this package requires the presence of a main thread.

### 1. Pipeline to extract trips details

```py
from gps2gtfs.pipeline.trip import run


if __name__ == "__main__":
    raw_gps_data_path = "path/to/raw_gps_data/csv"
    trip_terminals_data_path = "path/to/trip_terminals_data/csv"
    terminals_buffer_radius = 100

    run(
        raw_gps_data_path,
        trip_terminals_data_path,
        terminals_buffer_radius,
    )
```

<hr>

### 2. Pipeline to extract trips and stops details

```py
from gps2gtfs.pipeline.trip_stop import run


if __name__ == "__main__":
    raw_gps_data_path = "path/to/raw_gps_data/csv"
    trip_terminals_data_path = "path/to/trip_terminals_data/csv"
    stops_data_path = "path/to/stops_data/csv"
    terminals_buffer_radius = 100
    stops_buffer_radius = 50
    stops_extended_buffer_radius = 100

    run(
        raw_gps_data_path,
        trip_terminals_data_path,
        stops_data_path,
        terminals_buffer_radius,
        stops_buffer_radius,
        stops_extended_buffer_radius,
    )
```

<!-- ## More references

Please cite our work when you use;

S. Ratneswaran and U. Thayasivam, "Extracting potential Travel time information from raw GPS data and Evaluating the Performance of Public transit - a case study in Kandy, Sri Lanka," 2023 3rd International Conference on Intelligent Communication and Computational Techniques (ICCT), Jaipur, India, 2023, pp. 1-7, doi: https://doi.org/10.1109/ICCT56969.2023.10075789

## Note:

The raw GPS data set and processed GPS data sets are available upon request (contact: shiveswarran.22@cse.mrt.ac.lk)

--- -->

## License

MIT License. You can see [here](https://github.com/aaivu/gps2gtfs/blob/master/LICENSE).

## Code of Conduct

Please read our [code of conduct document here](https://github.com/aaivu/aaivu-introduction/blob/master/docs/code_of_conduct.md).

[project]: https://img.shields.io/badge/-Project-blue
[research]: https://img.shields.io/badge/-Research-yellowgreen



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aaivu/gps2gtfs",
    "name": "gps2gtfs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "GTFS,GPS,Travel Time,Public Transit,Heterogeneous Traffic Condition,ITS",
    "author": "Aaivu",
    "author_email": "helloaaivu@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# gps2gtfs: A Python package to process raw GPS data of public transit and transform to GTFS format\n\n![project] ![research]\n\n- <b>Project Lead(s) / Mentor(s)</b>\n\n  1. Dr. T. Uthayasanker\n\n- <b>Contributor(s)</b>\n  1. R. Shiveswarran\n  2. S. Gopinath\n  3. S. Kajanan\n  4. A. Kesavi\n\n## Description\n\n<div style=\"text-align: justify;\">\nThe \"gps2gtfs\" Python package provides a streamlined solution for preprocessing GPS (Global Positioning System) raw data and converting it into GTFS (General Transit Feed Specification) data format. Leveraging the power of DataFrame and GeoDataFrame with parallelization, this package offers efficient methods to extract essential trip details from raw GPS data. These details encompass trip sequences, stop information, arrival time to stops, departure time from stops, dwell time at stops, travel durations, running times between stops, and the seamless transformation into GTFS data structure. Currently, \"gps2gtfs\" handles static (schedule) trip data at heterogeneous traffic condition, with the potential for future expansion to accommodate dynamic real-time trip data. Furthermore, in the future, a visualization package can be seamlessly integrated with existing packages.\n</div>\n\n<br>\n\n<b>Keywords:</b> GTFS, GPS, Travel Time, Public Transit, Heterogeneous Traffic Condition, ITS (Intelligent Transportation System)\n\n## Architecture\n\n<div style=\"text-align: justify;\">\nThe \"gps2gtfs\" framework is developed using Python 3, with a thoughtfully designed package structure that ensures minimal interdependence among the main packages. The core components encompass distinct packages, each serving a specific purpose: data_field, load_data, preprocessing, trip, stop, reporting, pipeline, and utility. Users are expected to provide input for a single route, and the system facilitates the inclusion of multiple routes into the pipeline through user-driven iteration.\n</div>\n\n<br>\n\nThe package is structured into eight(8) primary packages:\n\n1. <b>data_field:</b> This package is responsible for managing column names for user input and a predefined set of output columns. The fields provided by the user should be a superset of the defined fields within this package.\n2. <b>load_data:</b> This package handles the loading of necessary data into the pipeline.\n3. <b>preprocessing:</b> The preprocessing package is designed to clean the data loaded from the previous step.\n4. <b>trip:</b> The trip package focuses on extracting trips and generating associated features.\n5. <b>stop:</b> Within the stop package, the identification of stops and the creation of related features take place.\n6. <b>reporting:</b> This package is responsible for generating outputs containing the extracted information.\n7. <b>pipeline:</b> This package contains functionality to execute the trip extraction pipeline and the trip & stop extraction pipeline.\n8. <b>utility:</b> The utility module provides support for various utility functions, including input/output operations, data conversions, and logging.\n\n\n### Architecture digram of gps2gfts\n\n<img width=\"1000\" alt=\"img1\" src=\"https://github.com/aaivu/gps2gtfs/assets/74850246/678af0a8-64e3-49b5-8fb6-66b331ea7cae\" >\n\n<hr>\n\n### How the gps2gfts works\n\n<img width=\"1000\" alt=\"img2\" src=\"https://github.com/aaivu/gps2gtfs/assets/74850246/92cf2e62-2be4-49e1-b401-78ebbe20d194\">\n\n<br>\n\n## Quick Example\n\nIt is essential to provide input files in CSV format for proper functionality. Additionally, the utilization of this package requires the presence of a main thread.\n\n### 1. Pipeline to extract trips details\n\n```py\nfrom gps2gtfs.pipeline.trip import run\n\n\nif __name__ == \"__main__\":\n    raw_gps_data_path = \"path/to/raw_gps_data/csv\"\n    trip_terminals_data_path = \"path/to/trip_terminals_data/csv\"\n    terminals_buffer_radius = 100\n\n    run(\n        raw_gps_data_path,\n        trip_terminals_data_path,\n        terminals_buffer_radius,\n    )\n```\n\n<hr>\n\n### 2. Pipeline to extract trips and stops details\n\n```py\nfrom gps2gtfs.pipeline.trip_stop import run\n\n\nif __name__ == \"__main__\":\n    raw_gps_data_path = \"path/to/raw_gps_data/csv\"\n    trip_terminals_data_path = \"path/to/trip_terminals_data/csv\"\n    stops_data_path = \"path/to/stops_data/csv\"\n    terminals_buffer_radius = 100\n    stops_buffer_radius = 50\n    stops_extended_buffer_radius = 100\n\n    run(\n        raw_gps_data_path,\n        trip_terminals_data_path,\n        stops_data_path,\n        terminals_buffer_radius,\n        stops_buffer_radius,\n        stops_extended_buffer_radius,\n    )\n```\n\n<!-- ## More references\n\nPlease cite our work when you use;\n\nS. Ratneswaran and U. Thayasivam, \"Extracting potential Travel time information from raw GPS data and Evaluating the Performance of Public transit - a case study in Kandy, Sri Lanka,\" 2023 3rd International Conference on Intelligent Communication and Computational Techniques (ICCT), Jaipur, India, 2023, pp. 1-7, doi: https://doi.org/10.1109/ICCT56969.2023.10075789\n\n## Note:\n\nThe raw GPS data set and processed GPS data sets are available upon request (contact: shiveswarran.22@cse.mrt.ac.lk)\n\n--- -->\n\n## License\n\nMIT License. You can see [here](https://github.com/aaivu/gps2gtfs/blob/master/LICENSE).\n\n## Code of Conduct\n\nPlease read our [code of conduct document here](https://github.com/aaivu/aaivu-introduction/blob/master/docs/code_of_conduct.md).\n\n[project]: https://img.shields.io/badge/-Project-blue\n[research]: https://img.shields.io/badge/-Research-yellowgreen\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package to process raw GPS data of public transit and transform to GTFS format.",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/aaivu/gps2gtfs/issues",
        "Documentation": "https://github.com/aaivu/gps2gtfs/blob/master/PACKAGE_DESCRIPTION.md",
        "Download": "https://pypi.org/project/gps2gtfs/",
        "Homepage": "https://github.com/aaivu/gps2gtfs",
        "Source": "https://github.com/aaivu/gps2gtfs"
    },
    "split_keywords": [
        "gtfs",
        "gps",
        "travel time",
        "public transit",
        "heterogeneous traffic condition",
        "its"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3de0b63f58e2cb8eed0b61ea4fbab922abd7816f45f894cc839f9f7df0dde64c",
                "md5": "9354a4977e73882df3cd0dcfdd9b088c",
                "sha256": "997d4c80812f57e52e74373ec5b1d190e4de53d731228fd1e2079f746b679744"
            },
            "downloads": -1,
            "filename": "gps2gtfs-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9354a4977e73882df3cd0dcfdd9b088c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 22663,
            "upload_time": "2023-08-13T17:27:20",
            "upload_time_iso_8601": "2023-08-13T17:27:20.821287Z",
            "url": "https://files.pythonhosted.org/packages/3d/e0/b63f58e2cb8eed0b61ea4fbab922abd7816f45f894cc839f9f7df0dde64c/gps2gtfs-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-13 17:27:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aaivu",
    "github_project": "gps2gtfs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "geopandas",
            "specs": []
        },
        {
            "name": "flake8",
            "specs": []
        },
        {
            "name": "flake8-annotations",
            "specs": []
        },
        {
            "name": "flake8-bandit",
            "specs": []
        },
        {
            "name": "flake8-black",
            "specs": []
        },
        {
            "name": "flake8-bugbear",
            "specs": []
        },
        {
            "name": "flake8-import-order",
            "specs": []
        },
        {
            "name": "black",
            "specs": []
        }
    ],
    "lcname": "gps2gtfs"
}
        
Elapsed time: 0.10458s