ODOT Camera and Incident Mapper
is a Python script that fetches camera and incident data from the Ohio Department of Transportation (ODOT) API, and visualizes the data on an interactive map using the Folium library. This tool helps monitor highway conditions and visualize traffic incidents in Ohio.
- Fetch camera data from ODOT API (Camera Data Documentation).
- Fetch incident data (accidents) from ODOT API (Incident Data Documentation).
- Visualize cameras and incidents on an interactive map.
- Use environment variables to store API keys securely.
- Python 3.x
requests
libraryfolium
librarypython-dotenv
library
-
Clone the repository:
git clone https://github.com/yourusername/odot-camera-and-incident-mapper.git cd odot-camera-and-incident-mapper
-
Install the required libraries:
pip install requests folium python-dotenv
-
Create a
.env
file in the root directory and add your ODOT API key:OHGO_API_KEY=your_api_key_here
-
Run the script:
python odot_camera_and_incident_mapper.py
-
The script will fetch camera and incident data, and save the generated map as
ohgo_cameras_incidents_map.html
.
- The script fetches camera data using the provided ODOT API URLs (Camera Data Documentation).
- The script fetches incident data using the provided ODOT API URLs (Incident Data Documentation).
- It handles pagination to ensure all data is retrieved.
- Cameras are plotted on the map with blue markers.
- Incidents are plotted on the map with red markers.
- Detailed information is provided in the popups for each marker.
odot_camera_and_incident_mapper.py
: Main script file responsible for mapping incidents and camera data.odot_camera_info_cli.py
: Separate CLI script for accessing camera data in the terminal..env
: File to store environment variables (not included in version control).ohgo_cameras_incidents_map.html
: Generated map file displaying camera locations and incidents.
Feel free to submit issues or pull requests if you have suggestions for improvements or new features.
This project is licensed under the MIT License. See the LICENSE
file for details.
Happy mapping!