This project contains an ArcGIS Pro Python toolbox (.pyt) for drone route automation reporting.
The tool reads route information from an Excel file, geocodes origin and destination addresses, creates drone flight paths and road driving routes, compares travel distance and time, checks whether drone delivery is possible, and generates a route report table inside ArcGIS Pro.
The purpose of this project is to create a custom ArcGIS Pro Python toolbox for automating drone route comparison and reporting.
- Creates an ArcGIS Pro Python toolbox using a
.pytfile - Reads route records from an Excel spreadsheet
- Populates the Excel sheet name parameter automatically
- Geocodes origin and destination addresses using Google Maps API
- Creates straight-line drone flight paths
- Creates road driving routes using Google Directions API
- Calculates drone route distance and estimated flight time
- Calculates driving distance and driving time
- Checks drone feasibility based on maximum distance and payload
- Calculates time saved by drone route compared with driving route
- Estimates greenhouse gas savings based on avoided driving distance
- Creates a route report table
- Adds route layers to the current ArcGIS Pro map
- Applies different symbology for drone and driving routes
The tool requires the following inputs in ArcGIS Pro:
| Input | Description |
|---|---|
| Input Workspace | Workspace where output feature classes and report table will be created |
| Input Excel File | Excel file containing route records |
| Input Excel Sheet Name | Sheet name selected from the Excel file |
| Maximum Distance Drone Can Cover | Maximum drone flight distance in miles |
| Maximum Payload | Maximum payload the drone can carry |
| Google API Key | API key used for geocoding and driving route requests |
The Excel sheet should contain the following fields:
| Field Name | Description |
|---|---|
Branch__Route_Name_ |
Route name or branch route identifier |
Origin |
Origin address |
Destination |
Destination address |
Departure_Date |
Original departure date |
Departure_Time |
Departure time |
Payload |
Payload value for the route |
The tool first converts the selected Excel sheet into an ArcGIS table. It then reads each route record and extracts the route name, origin, destination, departure date, departure time, and payload.
For each route, the tool creates:
- A straight-line drone flight path between the origin and destination
- A road-based driving route using Google Directions API
- A report record comparing drone and driving results
The drone route is checked against the user-defined maximum drone distance and maximum payload. If either limit is exceeded, the route is marked as not possible.
The tool creates the following outputs:
- Drone flight path polyline feature classes
- Driving route polyline feature classes
- A report table named
Report - Route layers added to the current ArcGIS Pro map
The report table includes:
| Output Field | Description |
|---|---|
Route |
Route name |
Origin |
Origin address |
Destination |
Destination address |
Dep_Date |
Departure date |
Dep_Time |
Departure time |
Flight_Dist |
Drone flight distance |
Drive_Dist |
Driving distance |
Flight_Time |
Estimated drone flight time |
Drive_Time |
Estimated driving time |
Flight_Speed |
Drone speed used for calculation |
Time_Saved |
Difference between driving time and drone flight time |
GHG_Saved |
Estimated greenhouse gas savings |
Payload |
Payload for the route |
Possible |
Whether drone flight is possible, shown as T or F |
The tool applies simple symbology in ArcGIS Pro:
| Route Type | Meaning |
|---|---|
| Green flight path | Drone route is possible |
| Red flight path | Drone route is not possible |
| Blue drive path | Road driving route |
arcgis-drone-route-report-automation/
│
├── README.md
├── .gitignore
│
├── toolbox/
│ └── Routes_Report_Automation.pyt
│
├── sample_data/
│ └── Labcorp Simulated routes (1).xlsx
│
├── scripts/
│ └── Routes Report Automation v1.py
│
└── docs/
└── pyt_creation_notes.md
└── Documentation.pdf
- ArcGIS Pro
- ArcPy
- Python toolbox (
.pyt) - Google Maps API
- Google Directions API
- pandas
- polyline
- python-dateutil
- Excel route data
- GIS route visualization
- Feature class creation
- Attribute table reporting
This tool uses the following Python libraries:
arcpy
googlemaps
polyline
pandas
python-dateutil
arcpy is included with ArcGIS Pro. The other libraries may need to be installed in the ArcGIS Pro Python environment.
- Open ArcGIS Pro.
- Open or create a project with a map.
- In the Catalog pane, browse to the
toolboxfolder. - Add
Routes_Report_Automation.pyt. - Open the
List Route Automatetool. - Select an output workspace.
- Select the input Excel file.
- Select the Excel sheet name.
- Enter the maximum drone distance.
- Enter the maximum payload.
- Enter a valid Google API key.
- Run the tool.
- Review the generated flight paths, drive paths, and report table.
A Google API key is required to run the geocoding and driving route parts of this tool. Do not upload API keys to GitHub.
The sample Excel file is included only for showing the expected route input format.