awesome-quant
awesome-quant copied to clipboard
gtfs realtime pbf is empty?
I'm using a JavaScript module generated by this library for GTFS Realtime to load https://data.texas.gov/Transportation/CapMetro-Vehicle-Positions-PB-File/eiei-9rpf and the result I'm getting back is empty.
Here's my code:
fetch('https://data.texas.gov/download/eiei-9rpf/application%2Foctet-stream', {mode: 'no-cors'}).then(function(result) {
var bufferRes = result.arrayBuffer();
var pbf = new Pbf(new Uint8Array(bufferRes));
var obj = FeedMessage.read(pbf);
console.log(obj.entity);
});
The console.log()
output is []
.
Here it is on JS fiddle:
https://jsfiddle.net/opb6deqL/
Am I doing something wrong or maybe the GTFS Realtime dataset I'm trying to pull data from is malformed or something? Downloading https://data.texas.gov/download/eiei-9rpf/application%2Foctet-stream gets me a 25KB file so it's clearly not empty. And given that the PB file has been downloaded 186M times it's hard to believe that it's malformed and no one has ever noticed. Most likely, I'm probably doing something wrong but idk what.
Thanks!