Feature Request: Route Summary CSV Export
Summary
Add a write_summary_to_csv(filename: str) method to RouteParams and a matching --export-csv PATH CLI argument so operators and researchers can export optimised routes as a plain CSV file.
Motivation
RouteParams currently supports two output formats:
write_to_geojson() - machine-readable GeoJSON (good for GIS tools)
write_to_file() - custom JSON snapshot
Neither is directly usable in common data-analysis workflows such as opening in Excel/LibreOffice Calc or reading with pandas.read_csv(). A CSV export removes this friction without adding new dependencies.
Proposed Changes
WeatherRoutingTool/routeparams.py
New method on RouteParams:
def write_summary_to_csv(self, filename: str) -> None:
...
Columns per waypoint:
| Column |
Unit |
waypoint_id |
- |
latitude_deg |
deg |
longitude_deg |
deg |
timestamp |
ISO-8601 |
speed_mps |
m/s |
engine_power_kW |
kW |
fuel_rate_kg_per_s |
kg/s |
wave_height_m |
m |
wind_resistance_N |
N |
dist_to_next_m |
m |
status |
- |
The destination (last) row uses -99 sentinels, consistent with the existing write_to_geojson() convention.
cli.py
New optional argument:
--export-csv PATH Path for a per-waypoint CSV summary of the optimised route.
WeatherRoutingTool/execute_routing.py
execute_routing() gains an optional csv_export_path: str = None parameter; fully backward-compatible.
Implementation
A working implementation is available on branch feature/route-summary-csv-export with two accompanying pytest tests covering column headers and sentinel values.
No New Dependencies
Uses Python's built-in csv module only.
Feature Request: Route Summary CSV Export
Summary
Add a
write_summary_to_csv(filename: str)method toRouteParamsand a matching--export-csv PATHCLI argument so operators and researchers can export optimised routes as a plain CSV file.Motivation
RouteParamscurrently supports two output formats:write_to_geojson()- machine-readable GeoJSON (good for GIS tools)write_to_file()- custom JSON snapshotNeither is directly usable in common data-analysis workflows such as opening in Excel/LibreOffice Calc or reading with
pandas.read_csv(). A CSV export removes this friction without adding new dependencies.Proposed Changes
WeatherRoutingTool/routeparams.pyNew method on
RouteParams:Columns per waypoint:
waypoint_idlatitude_deglongitude_degtimestampspeed_mpsengine_power_kWfuel_rate_kg_per_swave_height_mwind_resistance_Ndist_to_next_mstatusThe destination (last) row uses
-99sentinels, consistent with the existingwrite_to_geojson()convention.cli.pyNew optional argument:
WeatherRoutingTool/execute_routing.pyexecute_routing()gains an optionalcsv_export_path: str = Noneparameter; fully backward-compatible.Implementation
A working implementation is available on branch
feature/route-summary-csv-exportwith two accompanying pytest tests covering column headers and sentinel values.No New Dependencies
Uses Python's built-in
csvmodule only.