osmium - add output header to PBF

404 views Asked by At

I create multiple synthetic OSM PBF files with pyosmium and later on I want to merge them and use osmium executable to set some custom headers on the PBF for archiving purposes.

However, calls such as

osmium cat --no-progress example1.pbf example2.pbf --output-header=sorting=blabla -O -o test_data.pbf

are not setting any headers which are viewable with osmium fileinfo. According to libosmium's documentation it should be possible to set arbitrary header key/value pairs. The only header I can permanently change is generator, so this works:

osmium cat --no-progress example1.pbf example2.pbf --output-header=generator=blabla -O -o test_data.pbf

I could imagine that the problem is that the input PBFs don't have the headers that I want to set in the output PBF (input PBFs actually do have the generator header). However, if that is the problem, how do I use pyosmium to add headers to the PBFs I create in the first place?

1

There are 1 answers

0
nilsnolde On

Was answered by the main dev of osmium in https://github.com/osmcode/osmium-tool/issues/181.

Basically the headers are pretty restricted and it's hard-coded which ones are allowed based on the output format (or input for reading).