-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary tiles #37
Comments
Let's try to use protobuf. Essentially you want a binary file that has:
The See: https://deck.gl/#/documentation/deckgl-api-reference/layers/path-layer?section=use-binary-attributes which specifically talks about how to use binary attributes with the |
Something like this seems like it would work but I got a few errors, from malformed data? getTileData: ({ x, y, z }) =>
fetch(`${baseurl}/${z}/${x}/${y}.pbf`)
.then(response => {
if (response.status === 200) {
return response.arrayBuffer();
}
return null;
})
.then(buffer => {
if (buffer) {
const pbf = new Protobuf(buffer);
const obj = ScheduleTile.read(pbf);
console.log(obj);
const data = {
length: obj.startIndices.slice(-1)[0],
startIndices: new Uint16Array(obj.startIndices), // this is required to render the paths correctly!
attributes: {
getPath: {
value: new Float32Array(obj.positions),
size: 2
},
getTimestamps: {
value: new Float32Array(obj.timestamps),
size: 1
}
}
};
console.log(data);
return data;
}
return {
length: 0,
startIndices: new Uint16Array(0),
positions: new Float32Array(0),
timestamps: new Float32Array(0)
};
}), |
Explore using binary tiles, possibly with Apache Arrow, to offload computation off the CPU.
"Use binary data" is a section of the deck.gl performance optimization guide.
Also see:
visgl/deck.gl#3467
The text was updated successfully, but these errors were encountered: