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

opl file format #137

Closed
missinglink opened this issue Nov 24, 2015 · 2 comments
Closed

opl file format #137

missinglink opened this issue Nov 24, 2015 · 2 comments

Comments

@missinglink
Copy link

hey @joto I've been playing with using your .opl format recently, are you still actively using this format for anything?

I've been playing with the idea of a human-readable/grep-able format and so I'm using this as a base.

I'd like to offer a suggestion for the existing format.

The tags are exported in order they are created in the database, this makes it hard to ensure consistency between two identical objects because the order is significant.

It might be better to alphabetically order the tags by key? This would ensure that 2 identical objects produced by different systems would produce output that hashes to the same value.

@joto
Copy link
Member

joto commented Nov 24, 2015

I am using it occasionally for quick scripts, nothing mayor.

Tags are written in the order they are read. Libosmium doesn't do any tag reordering and that is on purpose. One thing it would cost some overhead that not everybody wants to pay for. The other is consistency between different file formats and processing methods. And then there is the problem of how to do a defined ordering: people have different ideas on how to order strings.

So I don't see that as something that can be solved on the level of the file format. The file format should just be a true encoding of the data as it is. But you could write a libosmium-based program reasonably easily that reads an OSM file and writes it out again sorting the tags in the process.

If you have identical objects they have the same id/version, so I am not sure I see the problem with that.

@missinglink
Copy link
Author

ok that makes sense, I can see how re-ordering the keys is not a requirement for everyone and it will take some more CPU cycles to do it.

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

No branches or pull requests

2 participants