Position Data DTO Reference
The ThingsTelemetry\Traccar\Dto\PositionData represents a single Traccar position fix reported by a device.
use ThingsTelemetry\Traccar\Facades\Position;
$pos = Position::get(12345); // PositionDataid → integer
Unique position identifier in Traccar.
$pos->id; // 12345deviceId → integer
The device that produced this position.
$pos->deviceId; // 42protocol → string
Connector/protocol name that produced the position (e.g., osmand, teltonika).
$pos->protocol; // "osmand"deviceTime → CarbonImmutable
Timestamp when the device recorded the position (ISO 8601).
$pos->deviceTime->toIso8601String(); // "2019-08-24T14:15:22Z"fixTime → CarbonImmutable
Timestamp of the GPS fix (ISO 8601).
$pos->fixTime->toIso8601String(); // "2019-08-24T14:15:22Z"serverTime → CarbonImmutable
Timestamp when the server stored the position (ISO 8601).
$pos->serverTime->toIso8601String(); // "2019-08-24T14:15:23Z"valid → boolean
Indicates whether the position is considered valid by Traccar.
$pos->valid; // truelatitude → float
Latitude in decimal degrees.
$pos->latitude; // -1.286389longitude → float
Longitude in decimal degrees.
$pos->longitude; // 36.817223altitude → float
Altitude in meters.
$pos->altitude; // 1679.3speed → float
Speed in knots as reported by Traccar.
$pos->speed; // 12.5 // knotscourse → float
Heading/course in degrees (0–360).
$pos->course; // 275.0address → string
Resolved human-readable address, if reverse geocoding is enabled. Can be an empty string.
$pos->address; // "1600 Amphitheatre Pkwy, Mountain View, CA" or ""accuracy → float
Estimated accuracy (unit as provided by Traccar, typically meters).
$pos->accuracy; // 5.0network → array<string, mixed>
Raw network-related information associated with the position.
$pos->network; // [ 'cellTowers' => [...], 'wifiAccessPoints' => [...] ]geofenceIds → array<int, int>
IDs of geofences related to this position. Can be an empty array.
$pos->geofenceIds; // [3, 5] or []attributes → array<string, mixed>
Additional attributes returned by Traccar for the position. May include vendor/device-specific keys. Can be empty.
$pos->attributes; // [ 'sat' => 12, 'battery' => 88, 'ignition' => true, ... ]Notes
- All fields are required on the DTO. When constructing via
PositionData::fromArray(...), empty/invalid time strings are parsed safely and default tonow(). addressmay be an empty string if reverse geocoding is disabled or not available.geofenceIdsmay be an empty array if no geofences are associated.attributesandnetworkdefault to empty arrays when missing.