Drone Chainage & SRT Processing
A Streamlit application that automates extraction and processing of GPS metadata from DJI drone video .srt files, generates chainage markers along a reference alignment (KML), and produces synchronized SRT outputs and 3D visualizations.
🚀 Purpose
- Extract latitude, longitude, altitude, and timestamp data embedded in DJI
.srtfiles. - Chainage: compute distances along a surveyed alignment (a 2D KML LineString) and insert regular markers (every 50 m).
- Project drone track start/end onto the chainage alignment to find matching station values.
- Visualize the drone path and alignment in an interactive 3D view.
- Export:
- 3D KMLs of the drone route with START/END placemarks.
- Six separate SRT files (Latitude, Longitude, Altitude, Timer, LatLon, Chainage).
- Bulk‐processing support for multiple
.srtfiles in one go.
📋 Features & Workflow
- Upload Inputs
- DJI
.srt(with[latitude: …],[longitude: …],[altitude: …]). - Full‐chainage
.kml(2D LineString of reference alignment).
- DJI
- Generate 50 m Markers
- Interpolate along the KML every 0.05 km.
- Download
markers_50m.kmlfor inspection.
- Confirm Markers Direction
- If backward, reverse the alignment and regenerate markers.
- Project SRT Start/End
- Parse the initial
.srtinto GPS track points. - Compute total route length.
- Find nearest chainage-station for the first/last points.
- Parse the initial
- Confirm SRT Direction
- Reverse the track if start/end mapping is inverted.
- Visualize in 3D
- Chainage line (gray) at altitude = 0.
- Drone track (red) in true altitude.
- START (green) and END (blue) markers with station labels.
- Export Initial SRT-Derived Files
- Download
initial_srt_route.kmlwith START/END. - Download a ZIP of six SRT files prefixed
initial_01_…–initial_06_….
- Download
- Bulk Processing (optional)
- Upload multiple additional
.srtfiles. - Skip Steps 2–6 and generate 3D KML + SRT ZIP for each.
- Upload multiple additional
- Bundle & Download
- All KMLs and SRTs are packaged into a final
all_outputs.zipfor one-click retrieval.
- All KMLs and SRTs are packaged into a final
🔍 Under the Hood: Mathematical Background
1. Haversine Formula
Computes great‐circle distance between two GPS points (φ1,λ1) and (φ2,λ2):
Δφ=φ2−φ1,Δλ=λ2−λ1,a=sin2(Δφ/2)+cosφ1,cosφ2,sin2(Δλ/2),d=2Rarcsin(a),
where:
- φ = latitude (radians), λ = longitude (radians)
- R ≈ 6371 km (Earth’s radius)
- d = distance along Earth’s surface.
2. Cumulative Chainage
Given points P0,P1,…,Pn:
Ck=∑i=1kd(Pi−1,Pi),
where d() is the segment length from Haversine.
3. Regular Interval Markers
To place markers every Δ km:
- Build cumulative array [C0=0,C1,…,Cn].
- For each$ D=0, Δ, 2Δ,…,C_n$: find segment i with Ci−1<D≤Ci, compute fraction f=(D−Ci−1)/(Ci−Ci−1), and interpolated point P(D)=(1−f)Pi−1+fPi.