Differentiating between vehicles

Hi I was wondering how I can differentiate between vehicles in the realtime transit feed, is it in the entity IDs?


    Thank you for your feedback. We have forwarded your query to our developers and here's their reply. "How to differentiate between vehicles in the realtime transit feed?" To answer your question... Basically, every vehicle has an identifier and a label. A vehicle should have the following format: "vehicle": {"id": "xxxxx", "label": "xxxxxx"}. On this basis, we can differentiate vehicles. Hope this helps you. If you need more assistance, could you, please share with us: • The endpoint(s) you're calling? • The data/response you're receiving? We would be able to show you how to make a difference.
    Posted by Hidden Thu, 27 Oct 2022 23:29:28 GMT
    Sorry I realised my question was a bit vague. My goal is to differentiate between buses and boats etc in the Realtime Transit Feed (GTFS) Vehicle Positions api. I am looking to get real-time positions of buses but I cannot tell if it is a boat or not, some I have been able to filter out through observation (longer license plates, IDs etc) but when I render it on my map a few seem to remain as shown on my app by buses in the ocean.
    Posted by Hidden Fri, 28 Oct 2022 02:49:51 GMT
    Thank you for the clarification. Here's the reply from our developers. There are two separate endpoints from the Realtime Transit Feed (GTFS) API to get positions: 'Vehicle positions' and 'Ferry positions'. The endpoint Ferry positions return only ferries (boats) positions, and Vehicle Positions return location only for buses and trains.
    Posted by Hidden Mon, 31 Oct 2022 00:49:25 GMT
    The problem I am having is vehicle positions also seem to include boats. For example my GET https://api.at.govt.nz/v2/public/realtime/vehiclelocations request returns the following entity. This is a boat and can be found here https://www.marinetraffic.com/cs/ais/details/ships/shipid:5996943/mmsi:512008206/imo:0/vessel:HANSE_508 { "id": "512008206", "vehicle": { "position": { "latitude": -36.621386666666666, "longitude": 174.79075833333334, "speed": 0 }, "timestamp": 1667264269, "vehicle": { "id": "512008206", "label": "HANSE 508", "license_plate": "ZMX8965" } }, "is_deleted": false }
    Posted by Hidden Tue, 01 Nov 2022 01:04:03 GMT
    Sorry for the delayed response. We are having a look at this currently and will get back to you shortly.
    Posted by Hidden Tue, 15 Nov 2022 20:03:49 GMT
    On further investigation, the vehicle locations endpoint returns all vehicles including boats. Apologies for suggesting otherwise in the earlier comment. Suggestion from our Developer is you can grab the vehicle id and call the trip updates endpoint - https://api.at.govt.nz/realtime/legacy/tripupdates?vehicleid={vehicle-id} In the response body from the trip updates endpoint, if the entity array is populated then the bus is currently on a trip and If entity array is empty then the vehicle could be a boat or a bus which is not on a trip. Hope this helps and thanks for your patience.
    Posted by Hidden Tue, 15 Nov 2022 22:25:18 GMT

You're not signed in. Please sign-in to report an issue or post a comment.