Skip to content
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

Invalid wire type when decoding protobuf #2

Open
anyweez opened this issue Dec 31, 2019 · 0 comments
Open

Invalid wire type when decoding protobuf #2

anyweez opened this issue Dec 31, 2019 · 0 comments

Comments

@anyweez
Copy link

anyweez commented Dec 31, 2019

I'm getting an error when I run the following code on a fresh install

const ss = require('sharedstreets-api');

// 1. Get roads from shared streets
const tile = [1186, 1466, 12];
const layer = "geometry";

ss.downloadTile(tile, layer, {
    output: 'json',
}).then(data => {
    const body = pbf.geometry(data);
}).catch(err => console.error(err));

The error is:

Error: invalid wire type 4 at offset 23
    at Reader.skipType (/Users/luke/git/curbmap-builder/node_modules/protobufjs/src/reader.js:373:19)
    at Function.decode (/Users/luke/git/curbmap-builder/node_modules/sharedstreets-pbf/proto/sharedstreets.js:1767:24)
    at Function.decodeDelimited (/Users/luke/git/curbmap-builder/node_modules/sharedstreets-pbf/proto/sharedstreets.js:1787:21)
    at readBuffer (/Users/luke/git/curbmap-builder/node_modules/sharedstreets-pbf/index.js:91:30)
    at Object.geometry (/Users/luke/git/curbmap-builder/node_modules/sharedstreets-pbf/index.js:23:12)
    at /Users/luke/git/curbmap-builder/node_modules/sharedstreets-api/index.js:50:58
    at processTicksAndRejections (internal/process/task_queues.js:85:5)

I'm guessing there may be a mismatch between the protobuf definition used to encode the data I'm getting in response and what my local system is trying to use to decode it...any ideas? The URL I'm retrieving from is https://tiles.sharedstreets.io/12-1186-1466.geometry.pbf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant