This script creates routes in Google Roads API from a CSV file.
- Python 3
requestsandPyYAMLPython packages
- Install the required packages:
pip install requests PyYAML
- Open the
config.yamlfile. - Set your Google Project ID in the
google_project_idfield. - Configure the
csv_formatsection to match your CSV file's structure.- Use
combined_coordinatesif your CSV has origin and destination in single columns. - Use
separate_coordinatesif your CSV has latitude and longitude in separate columns.
- Use
- (Optional) Set a
route_name_prefixto be added to each route name. - (Optional) Customize the
log_fileandmax_routes_to_create.
Run the script from the route_registration_script directory:
python3 create_routes_in_jurisdiction.py your_data.csv
Replace your_data.csv with the path to your CSV file.