nvandi.data
Real Work Case DATA ENGINEERING & GEOSPATIAL ยท 2026

Hauling Speed Analytics & Geospatial Data Pipeline

Developed an automated Python and GeoPandas pipeline that processes thousands of daily GPS and Odometer records from hauling trucks. The system maps coordinates to specific kilometer segments, classifies hauling direction, and calculates valid speed metrics and duration over-speed violations.

Data Processing Pipeline

01

Raw GPS Logs

Daily XLS (Odometer, Speed, etc)

02

Conversion

XLS to XLSX via Headless LibreOffice

03

Spatial Join

Map points to KM bounding boxes

04

Algorithm

Calc mean valid & >40km/h duration

05

Excel Report

Daily summary per hauling unit

Fully automated with Python & GeoPandas. The script processes thousands of raw daily coordinate logs and transforms them into accurate speed and duration reports.

01. The Challenge & Core Requirement

Mining and logistical hauling operations generate massive amounts of telemetry data. Each unit logs its Latitude, Longitude, Speed, and Odometer every few seconds, generating thousands of rows across dozens of Excel (XLS) files daily.

Manually processing this data to find out exactly how fast trucks are moving on specific segments of the road (KM markers) was impossible. The raw data contained anomalies (e.g., speed reading 0 when moving), required spatial context (matching a GPS point to a physical road kilometer), and needed complex time-clustering to measure exactly how long a truck drove above the safe speed limit (e.g., 40 km/h) without counting idle breaks.

02. My Core Role & Implementation

I designed and built the entire data processing pipeline using Python, Pandas, and GeoPandas, packaged neatly into a Jupyter Notebook that can be run on a schedule:

  • Automated Format Conversion: Wrote a script that uses a headless LibreOffice instance to automatically convert legacy .xls files into modern .xlsx files before ingestion, preventing corruption and ensuring `openpyxl` compatibility.
  • Geospatial Joining (GeoPandas): Mapped every GPS coordinate to a specific route kilometer marker (KM) using gpd.sjoin() with an intersects predicate against predefined bounding box shapefiles.
  • Direction Classification: Implemented logic to track the change in KM values over time (dKM) to automatically tag if a unit is moving forward (Return) or backward (Hauling) along the route.
  • Time-Clustered Speed Analytics: Developed custom algorithms like mean_valid_speed() (to ignore anomalous readings) and duration_over40_clustered(), which calculates the exact minutes spent over the speed limit while accurately handling breaks and pauses in the data feed.

03. Interactive Data Pipeline

Below is an interactive demonstration of how the raw telemetry logs are joined spatially and aggregated into clean analytical tables:

01. Raw Coordinate & Speed Feed

Each hauling unit (e.g. TRK-015, TRK-030) transmits location (Latitude/Longitude), speed, and odometer readings every few seconds. This data is merged from dozens of daily XLS files:

#DateUnitLatitudeLongitudeSpeed (km/h)Speed (km/h)Odometer
12025-12-28 08:14:38TRK-015_XX1234YY-2.78471121.202570030635.225
22025-12-28 08:14:26TRK-015_XX1234YY-2.78458121.2026802830635.340
32025-12-28 08:14:22TRK-015_XX1234YY-2.78451121.2028104230635.500
42025-12-16 07:49:05B-015_DD8966UF-2.832530121.2029503530635.750

02. Spatial Join & Direction Classification

Using GeoPandas, the Latitude/Longitude coordinates are mapped to predefined KM bounding boxes. The change in KM value over time is used to determine if the truck is returning empty or hauling a load:

Actual Plot: GeoPandas Spatial Join
Loading Plotly Cartesian Canvas...
Loading Plotly Cartesian Canvas...
# GeoPandas Spatial Join
gdf_join=gpd.sjoin(gdf_all, gdf_geofence, how="left", predicate="intersects")
# Direction Classification based on Delta KM
def classify_direction(d):
if d > 0: return "Return" # moving to higher KM
elif d < 0: return "Hauling" # moving to lower KM

03. Speed Metrics Aggregation & Final Output

After grouping, the data is processed to extract the mean valid speed (ignoring zeros or unreasonable speeds), and a time-clustering algorithm computes exactly how long the truck spent driving over 40 km/h:

Daily Average Speed per Segment - Dec 27
DriverUnitKM Route SegmentsAVG SpeedAVG Payload (t)
1234567891011121314151617181920212223
John SmithTRK-053--25393227242126342931393831353330393943412732.5826.71
UnknownTRK-02015232131372726383933322638373533323034-48452632.130.00
David MillerTRK-009234027393025232133413227373530352928393638392231.7024.60
Robert ChenTRK-008--20353322222229303127363732332931413641432831.3524.95
Michael ChangTRK-011323623353226222228353128363529333131363236342630.8226.32
James WilsonTRK-010264123353120193333343126343329302827403534343130.7225.46
William DavisTRK-054--25383025231923342732353830343131333338312730.2924.68
Thomas BrownTRK-003284330373222212127382726313225313130333536312630.1225.03
Daniel TaylorTRK-038113424363225232125333028353528332727383738362529.4925.70
Joseph AndersonTRK-050153224393224222227352829423927332729273035352629.4826.61
Route Average Speed213323333023212326312726323328302727313135312528.1426.03

04. Key Deliverables & Outcomes

The automated pipeline eliminated the need for manual Excel manipulation. What used to take hours of manual VLOOKUPs and formatting is now achieved in seconds.

Management now receives clean, aggregated daily Excel reports that pinpoint exactly which units were speeding, at what specific kilometer marker, and for how long. This granular level of spatial and temporal analytics is critical for enforcing safety protocols and optimizing hauling cycles.

Need automated data pipelines or geospatial analytics?

I specialize in building robust Python ETL pipelines, Pandas automations, and geospatial analysis workflows to extract insights from messy data.

Hire on Upwork โ†—