slv.measurements.mobile.receptors.find_segment_crossings#

slv.measurements.mobile.receptors.find_segment_crossings(fixes, points=None, max_gap='10min', max_point_dist=60.0)[source]#

Split the GPS record into crossings of the 2-km segments.

Each fix is snapped to the nearest 50-m network point (dropped if farther than max_point_dist m) and inherits its segment; a crossing is a run of consecutive fixes on one segment with no gap longer than max_gap. One row per crossing:

crossing, segment, lines (letters common to every point hit — the line the train was on, in LINE_LETTERS order; "RGB" when only shared trunk points were hit), t_start, t_end, t_median, n_fix, n_points (distinct 50-m points hit), n_segment_points (points the segment has on that line), span_m, segment_extent_m and coverage.

span_m is measured along the route (the s_<line> coordinate of the points hit, from load_trax_network_points()), not as a straight line from the first fix: on a bent segment a full traverse can be 2.6 km of rail but only 1.8 km of chord, so a chord would make the same coverage look different on straight and bent segments. segment_extent_m is the along-route length of the release geometry (release_points()) and coverage = span_m / segment_extent_m is the fraction of it the train actually drove.

Return type:

DataFrame