## utdf2gmns: Introduction
This open-source package is a tool to convert utdf file to GMNS format.
## Required Data Input Files:
* [X] UTDF.csv
* [X] node.csv (GMNS format)
* [X] movement.csv (GMNS format)
## **Produced outputs**
**If input folder have UTDF.csv only, outputs are:**
* A dictionary store utdf data with keys: Networks, Node, Links, Timeplans, Lanes, and utdf_intersection_geo
* A file named utdf2gmns.pickle to store dictionary object.
**If input folder have extra node.csv and movement.csv, outputs are:**
* Two files named movement_utdf.csv and intersection_utdf.csv
* A file named utdf2gmns.pickle to store dictionary object.
## **Package dependencies**:
* [X] geocoder==1.38.1
* [X] numpy==1.23.3
* [X] openpyxl==3.0.10
* [X] pandas==1.4.4
## Data Conversion Steps:
Step 1: Read UTDF.csv file and perform geocoding, then produce utdf_geo, utdf_lane, and utdf_phase_timeplans.
Step 2: Match four files (utdf_geo, node, utdf_lane, utdf_pahse_timeplans, movement) to produce movement_utdf
## Installation
`pip install UTDF2GMNS`
## Example
```python
import utdf2gmns as ug
import pandas as pd
if__name__=="main":
city =" Bullhead City, AZ"
# option= 1, generate movement_utdf.csv directly
# option= 2, generate movement_utdf.csv step by step (more flexible)
option =1
if option ==1:
# NOTE: Option 1, generate movement_utdf.csv directly
path =r"C:\Users\roche\Desktop\coding\data_bullhead_seg4" # the fold contain UTDF.csv, node.csv and movement.csv
res = ug.generate_movement_utdf(path, city,isSave2csv=True)
if option ==2:
# NOTE: Option 2, generate movement_utdf.csv step by step (more flexible)
path_utdf =r"C:\Users\roche\Desktop\coding\data_bullhead_seg4\UTDF.csv"
path_node =r"C:\Users\roche\Desktop\coding\data_bullhead_seg4\node.csv"
path_movement =r"C:\Users\roche\Desktop\coding\data_bullhead_seg4\movement.csv"
# Step 1: read UTDF.csv
utdf_dict_data = ug.generate_utdf_dataframes(path_utdf, city)
# Step 1.1: get intersection data from UTDF.csv
df_intersection = utdf_dict_data["utdf_intersection"]
# Step 1.2: geocoding intersection data
df_intersection_geo = ug.generate_coordinates_from_intersection(df_intersection)
# Step 2: read node.csv and movement.csv
df_node = pd.read_csv(path_node)
df_movement = pd.read_csv(path_movement)
# Step 3: match intersection_geo and node
df_intersection_node = ug.match_intersection_node(df_intersection_geo, df_node)
# Step 4: match movement and intersection_node
df_movement_intersection = ug.match_movement_and_intersection_node(df_movement, df_intersection_node)
# Step 5: match movement and utdf_lane
df_movement_utdf_lane = ug.match_movement_utdf_lane(df_movement_intersection, utdf_dict_data)
# Step 6: match movement and utdf_phase_timeplans
df_movement_utdf_phase = ug.match_movement_utdf_phase_timeplans(df_movement_utdf_lane, utdf_dict_data)
```
## TODO LIST
* [X] Print out how many intersections being geocoded.
* [ ] Print out how many movements being matched or not matched for signalized intersecton nodes in osm2gmns files.
* [ ] Add cycle length and green time for each movement.
* [ ] Check reasonable capacity.
* [ ] Check each movement is reasonable (like 15s of green time...). other attributes.
* [ ] Check number of lanes correctness between osm2gmns file and synchro file per movements.
* [X] Print out check log.
* [X] Number of lanes of the movements from synchro file.
* [ ] Add signal info to micre-link.csv
* [X] Add function to verify whether geocoded for utdf_geo
Raw data
{
"_id": null,
"home_page": "https://github.com/asu-trans-ai-lab/utdf2gmns",
"name": "UTDF2GMNS",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Xiangyong Luo, Dr.Xuesong (Simon) Zhou",
"author_email": "luoxiangyong01@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9b/bd/4b0fde20b9d5746d7c9783cd07f4228326c5f9bd730537469ccda736946f/UTDF2GMNS-0.2.2.tar.gz",
"platform": null,
"description": "## utdf2gmns: Introduction\r\n\r\nThis open-source package is a tool to convert utdf file to GMNS format.\r\n\r\n## Required Data Input Files:\r\n\r\n* [X] UTDF.csv\r\n* [X] node.csv (GMNS format)\r\n* [X] movement.csv (GMNS format)\r\n\r\n## **Produced outputs**\r\n\r\n**If input folder have UTDF.csv only, outputs are:**\r\n\r\n* A dictionary store utdf data with keys: Networks, Node, Links, Timeplans, Lanes, and utdf_intersection_geo\r\n* A file named utdf2gmns.pickle to store dictionary object.\r\n\r\n**If input folder have extra node.csv and movement.csv, outputs are:**\r\n\r\n* Two files named movement_utdf.csv and intersection_utdf.csv\r\n* A file named utdf2gmns.pickle to store dictionary object.\r\n\r\n## **Package dependencies**:\r\n\r\n* [X] geocoder==1.38.1\r\n* [X] numpy==1.23.3\r\n* [X] openpyxl==3.0.10\r\n* [X] pandas==1.4.4\r\n\r\n## Data Conversion Steps:\r\n\r\nStep 1: Read UTDF.csv file and perform geocoding, then produce utdf_geo, utdf_lane, and utdf_phase_timeplans.\r\n\r\nStep 2: Match four files (utdf_geo, node, utdf_lane, utdf_pahse_timeplans, movement) to produce movement_utdf\r\n\r\n## Installation\r\n\r\n`pip install UTDF2GMNS`\r\n\r\n## Example\r\n\r\n```python\r\nimport utdf2gmns as ug\r\nimport pandas as pd\r\nif__name__==\"main\":\r\n city =\" Bullhead City, AZ\"\r\n # option= 1, generate movement_utdf.csv directly\r\n # option= 2, generate movement_utdf.csv step by step (more flexible)\r\n\r\n option =1\r\n\r\n if option ==1:\r\n # NOTE: Option 1, generate movement_utdf.csv directly\r\n path =r\"C:\\Users\\roche\\Desktop\\coding\\data_bullhead_seg4\" # the fold contain UTDF.csv, node.csv and movement.csv\r\n res = ug.generate_movement_utdf(path, city,isSave2csv=True)\r\n\r\n if option ==2:\r\n # NOTE: Option 2, generate movement_utdf.csv step by step (more flexible)\r\n path_utdf =r\"C:\\Users\\roche\\Desktop\\coding\\data_bullhead_seg4\\UTDF.csv\"\r\n path_node =r\"C:\\Users\\roche\\Desktop\\coding\\data_bullhead_seg4\\node.csv\"\r\n path_movement =r\"C:\\Users\\roche\\Desktop\\coding\\data_bullhead_seg4\\movement.csv\"\r\n\r\n # Step 1: read UTDF.csv\r\n utdf_dict_data = ug.generate_utdf_dataframes(path_utdf, city)\r\n\r\n # Step 1.1: get intersection data from UTDF.csv\r\n df_intersection = utdf_dict_data[\"utdf_intersection\"]\r\n\r\n # Step 1.2: geocoding intersection data\r\n df_intersection_geo = ug.generate_coordinates_from_intersection(df_intersection)\r\n\r\n # Step 2: read node.csv and movement.csv\r\n df_node = pd.read_csv(path_node)\r\n df_movement = pd.read_csv(path_movement)\r\n\r\n # Step 3: match intersection_geo and node\r\n df_intersection_node = ug.match_intersection_node(df_intersection_geo, df_node)\r\n\r\n # Step 4: match movement and intersection_node\r\n df_movement_intersection = ug.match_movement_and_intersection_node(df_movement, df_intersection_node)\r\n\r\n # Step 5: match movement and utdf_lane\r\n df_movement_utdf_lane = ug.match_movement_utdf_lane(df_movement_intersection, utdf_dict_data)\r\n\r\n # Step 6: match movement and utdf_phase_timeplans\r\n df_movement_utdf_phase = ug.match_movement_utdf_phase_timeplans(df_movement_utdf_lane, utdf_dict_data)\r\n\r\n```\r\n\r\n## TODO LIST\r\n\r\n* [X] Print out how many intersections being geocoded.\r\n* [ ] Print out how many movements being matched or not matched for signalized intersecton nodes in osm2gmns files.\r\n* [ ] Add cycle length and green time for each movement.\r\n* [ ] Check reasonable capacity.\r\n* [ ] Check each movement is reasonable (like 15s of green time...). other attributes.\r\n* [ ] Check number of lanes correctness between osm2gmns file and synchro file per movements.\r\n* [X] Print out check log.\r\n* [X] Number of lanes of the movements from synchro file.\r\n* [ ] Add signal info to micre-link.csv\r\n* [X] Add function to verify whether geocoded for utdf_geo\r\n",
"bugtrack_url": null,
"license": "",
"summary": "This open-source package is a tool to convert utdf file to GMNS format.",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/asu-trans-ai-lab/utdf2gmns"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3fc767d10d1cd8c59ff499579915000bd8d37a965010133ffff6fc3ac37478ee",
"md5": "02d27f1158b6b40801fadc1bbfdbfbff",
"sha256": "7828ed4f7556bf1115e76380828d98917ea301577c946c9d262965c72d832260"
},
"downloads": -1,
"filename": "UTDF2GMNS-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02d27f1158b6b40801fadc1bbfdbfbff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 20882,
"upload_time": "2023-06-26T02:44:03",
"upload_time_iso_8601": "2023-06-26T02:44:03.191032Z",
"url": "https://files.pythonhosted.org/packages/3f/c7/67d10d1cd8c59ff499579915000bd8d37a965010133ffff6fc3ac37478ee/UTDF2GMNS-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9bbd4b0fde20b9d5746d7c9783cd07f4228326c5f9bd730537469ccda736946f",
"md5": "1c81cb609869506e194e0203e03a8dbe",
"sha256": "7911b23f82871c64df16545b25ccf1a83a47353dcd37dbabc90ffb522d59a2a3"
},
"downloads": -1,
"filename": "UTDF2GMNS-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "1c81cb609869506e194e0203e03a8dbe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 17483,
"upload_time": "2023-06-26T02:44:04",
"upload_time_iso_8601": "2023-06-26T02:44:04.795465Z",
"url": "https://files.pythonhosted.org/packages/9b/bd/4b0fde20b9d5746d7c9783cd07f4228326c5f9bd730537469ccda736946f/UTDF2GMNS-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-26 02:44:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "asu-trans-ai-lab",
"github_project": "utdf2gmns",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "geocoder",
"specs": [
[
"==",
"1.38.1"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"1.23.3"
]
]
},
{
"name": "openpyxl",
"specs": [
[
"==",
"3.0.10"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"1.4.4"
]
]
}
],
"lcname": "utdf2gmns"
}