Skip to content

trip status lastLocationUpdateTime is 0, even when location has been updated recently #151

Open
@barbeau

Description

@barbeau

I'm working on showing real-time vehicle positions in OBA Android (OneBusAway/onebusaway-android#176 (comment)), using the trips-for-route API - for example:

http://api.tampa.onebusaway.org/api/where/trips-for-route/Hillsborough%20Area%20Regional%20Transit_5.json?key=TEST&includeStatus=true

I want to include the age of the location data in the marker balloons - however, the lastLocationUpdateTime field that should have this info is always 0 - for example:

status: {
activeTripId: "Hillsborough Area Regional Transit_98712",
blockTripSequence: 10,
closestStop: "Hillsborough Area Regional Transit_4552",
closestStopTimeOffset: -3,
distanceAlongTrip: 3482.2091907523863,
frequency: null,
lastKnownDistanceAlongTrip: 0,
lastKnownLocation: {
lat: 28.05448341369629,
lon: -82.41543579101562
},
lastKnownOrientation: 0,
lastLocationUpdateTime: 0,
lastUpdateTime: 1445033457692,
nextStop: "Hillsborough Area Regional Transit_4553",
nextStopTimeOffset: 38,
orientation: 270,
phase: "in_progress",
position: {
lat: 28.053266455191782,
lon: -82.416329
},
predicted: true,
scheduleDeviation: 180,
scheduledDistanceAlongTrip: 3482.2091907523863,
serviceDate: 1444968000000,
situationIds: [ ],
status: "default",
totalDistanceAlongTrip: 19440.69118417295,
vehicleId: "Hillsborough Area Regional Transit_2507"
},
tripId: "Hillsborough Area Regional Transit_98712"

For now, I'm using lastUpdateTime instead as a workaround.

Here are the source GTFS-rt feeds for HART:
http://realtime.prod.obahart.org:8088/trip-updates?debug
http://realtime.prod.obahart.org:8088/vehicle-positions?debug

I haven't had a chance to look into this yet, but I wanted to capture the information here for review later. The GTFS-rt feeds don't have timestamps in the vehicle position entities themselves - only the feed itself has a timestamp, which could be why the lastLocationUpdateTime isn't being populated. If that's the case, you could potentially argue that this is working as intended. At any rate, just wanted to document this behavior so we know why its doing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions