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

osm-file processing #108

Closed
Jack8787 opened this issue Oct 3, 2019 · 1 comment
Closed

osm-file processing #108

Jack8787 opened this issue Oct 3, 2019 · 1 comment
Labels

Comments

@Jack8787
Copy link

Jack8787 commented Oct 3, 2019

Hello, I'd like to figure out how, after all, pbf-files are processed by using pbf-module.
I'm working with central-america-latest.osm.pbf, here is what I'm triing to do:

---- Pbf = require('pbf'), Example = require('./protobuf/example.js');
// so far, so good - the file example.js is compiled as described in the documentation

---- fs.createReadStream -> chunk -> var pbf = new Pbf(chunk) -> objs = Example.read(pbf) -> ?
Error: Example.read is not a function. What could I miss in documentation? Maybe this module is not intended for streams?

@kjvalencik
Copy link
Collaborator

The pbf library does not directly support the PBF Format. You would need a high level wrapper that understands the repeating block format.

Additionally, protobuf does not support streams directly. When decoding a pbf OSM file, it would be necessary to buffer until an entire message is available to decode.

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

No branches or pull requests

3 participants