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

fileinfo: show PBF blob compression #205

Open
simon04 opened this issue Jan 4, 2021 · 3 comments
Open

fileinfo: show PBF blob compression #205

simon04 opened this issue Jan 4, 2021 · 3 comments
Labels
enhancement Wishlist item.

Comments

@simon04
Copy link

simon04 commented Jan 4, 2021

Currently, osmium-tool reports no compression, not taking into account whether a PBF blob has been compressed using zlib or lzma:

$ osmium fileinfo austria-210101.osm.pbf
File:
  Name: austria-210101.osm.pbf
  Format: PBF
- Compression: none
+ Compression: zlib
  Size: 633228853
@joto
Copy link
Member

joto commented Jan 5, 2021

That behaviour is correct. The compression reported is the outside compression on something like .osm.bz2. The man page says:

File  This  section  shows the information available without opening the file itself.  It contains the file name, the format deduced from the file name, the compression used and the size of the file in bytes.

The compression inside the PBF blobs is not reported. This is because different blocks could be compressed differently. (I don't expect any software to actually do that, but it is possible.)

@simon04
Copy link
Author

simon04 commented Jan 6, 2021

I see: the file section is not the correct section. The PBF compression could be included in the --extended output

...
Data:
  Bounding box: (8.8331793,46.2012502,18.994394,49.3061616)
  Timestamps:
    First: 2005-07-28T14:53:13Z
    Last: 2021-01-01T21:36:42Z
  ...
  All objects have following metadata attributes: version+timestamp
  Some objects have following metadata attributes: version+timestamp
+ All PBF data blocks use the compression: zlib

@joto
Copy link
Member

joto commented Jan 6, 2021

While I agree that this could be useful, it would need quite a lot of changes to libosmium and osmium-tool. The information is only available deep in side the library and there is no easy way to get it to the application. So this is unlikely to get implemented soon. I'll leave the issue open for the time being.

@joto joto added the enhancement Wishlist item. label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Wishlist item.
Development

No branches or pull requests

2 participants