slv.measurements.mobile.location.classify_location#

slv.measurements.mobile.location.classify_location(feat, moving_speed=2.0, moving_speed_est=1.5, line_distance=50.0, scatter_m=1.0, low_nsat=6, yard_buffer=30.0, near_yard_m=300.0, off_track_m=100.0, smooth_min=15, use_footprint=False)[source]#

Classify each row of location_features() into one of STATES.

Rules, per minute:

  1. no fixes → unknown

  2. moving (speed_max >= moving_speed, or where no speed was recorded speed_est >= moving_speed_est) on a track (d_track < line_distance): line if within near_yard_m of a storage polygon, else route; moving off-track inside the yard buffer → yard.

  3. stationary near the yard: degraded fix (scatter > scatter_m or nsat <= low_nsat, majority-voted over smooth_min minutes) → depot; with use_footprint a clean fix whose median sits inside the depot footprint is also depot. Off by default: the yard loop runs through the padded footprint, so it mislabels clean yard nights (e.g. 2025-02-16). Otherwise yard.

  4. stationary elsewhere → stopped.

  5. overrides to unknown: d_track > off_track_m (unless inside the yard buffer), or within near_yard_m of the storage polygon while neither on the line nor inside the yard buffer.

Returns a frame with state (categorical), indoor (nullable boolean: depot → True, other located states → False, unknown → NA), yard_name (copied from feat if present), degraded (raw per-minute flag), degraded_smooth and, when battery voltage is present, powered (volt_min >= POWER_OFF_V).

Return type:

DataFrame