-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support PBF writing #16
Comments
I like that idea! And builder structs seem like a good way to avoid having to allocate a node with all of its tags, only to be destroyed again so that it fits the PBF memory model. So I guess there should be a First I thought that |
Hey nyurik, I wanted to let you know, that I started pushing commits to this branch: https://github.com/b-r-u/osmpbf/tree/writer Writing blobs and blocks is implemented, but there is still a lot of functionality (and ergonomics) missing. |
Thanks!! I have been hacking locally on it for a long time on and off, and will push my work in progress to my fork. What do you think about the delta crate? I think it will make the code simpler to read, and might help with writing too |
@b-r-u what's the status of the rewrite? I have pushed my own work in that direction, but not sure if that's how you want to proceed. See https://github.com/nyurik/osmpbf/tree/write |
I would like to implement PBF write support. My initial thoughts are to have two structs:
BlockBuilder
struct equivalent toPrimitiveBlock
, contains shared state and a list ofGroupBuilder
sGroupBuilder
struct contains values that will go intoPrimitiveGroup
The
BlockBuilder
owns zero or moreGroupBuilder
instances, possibly of different types, and has methods to add node/way/rels to them. When adding a single feature the block builder would also track the bounding box of all features, as well as the shared tags table. Once the block is full, it self-compresses into a stream. The actual interfaces are TBD.The text was updated successfully, but these errors were encountered: