Skip to content

Commit c49747c

Browse files
committed
Update file format docs
1 parent 0d7e9da commit c49747c

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

_file_formats_manual/03_formats.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,17 @@ description, even if the file name has the correct suffix.
156156

157157
Here is a list of optional settings currently supported:
158158

159-
| Format | Option | Default | Description
160-
| ------ | ------ | ------- | -----------
161-
| PBF | `pbf_dense_nodes` | true | Use DenseNodes (more space efficient)
162-
| PBF | `pbf_compression` | gzip | Compress blocks using gzip (use "none" to disable)
163-
| XML | `xml_change_format` | false | Set change format, can also be set by using `osc` instead of `osm` suffix
164-
| XML | `force_visible_flag` | false | Write out `visible` flag on each object, also set if `osh` instead of `osm` suffix used
165-
| *all* | `add_metadata` | true | *see below*
166-
| PBF, XML, OPL | `locations_on_ways` | false | Add node locations to way nodes (libosmium-specific extension)
167-
| DEBUG | `use_color` | false | Output with ANSI colors
168-
| DEBUG | `add_crc32` | false | Add CRC32 checksum to all objects
159+
| Format | Option | Default | Description
160+
| ------ | ------ | ------- | -----------
161+
| PBF | `pbf_dense_nodes` | true | Use DenseNodes (more space efficient)
162+
| PBF | `pbf_compression` | zlib | Compression for PBF blocks (`none`, `zlib`, `lz4`)
163+
| PBF | `pbf_compression_level` | | Compression level for PBF blobs
164+
| XML | `xml_change_format` | false | Set change format, can also be set by using `osc` instead of `osm` suffix
165+
| XML | `force_visible_flag` | false | Write out `visible` flag on each object, also set if `osh` instead of `osm` suffix used
166+
| *all* | `add_metadata` | true | *see below*
167+
| PBF, XML, OPL | `locations_on_ways` | false | Add node locations to way nodes (libosmium-specific extension)
168+
| DEBUG | `use_color` | false | Output with ANSI colors
169+
| DEBUG | `add_crc32` | false | Add CRC32 checksum to all objects
169170

170171
### Writing metadata on OSM objects (`add_metadata`)
171172

_file_formats_manual/05_pbf.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,27 @@ Osmium usually will compress PBF blocks using zlib. To disable this, use the
1717
format parameter `pbf_compression=none`. This makes reading and writing faster,
1818
but the resulting files are larger.
1919

20+
From Libosmium 2.16, the compression type LZ4 is also supported
21+
(`pbf_compression=lz4`). Compression and decompression with LZ4 is much faster
22+
than with zlib, but the compression ratio is not quite as good. Note that LZ4
23+
compression is optional and only available if it was compiled in. Most other
24+
programs reading PBF files will not be able to read it.
25+
26+
Also from Libosmium version 2.16 you can set the compression level with the
27+
file format option `pbf_compression_level`. Allowed values depend on the
28+
PBF compression used.
29+
30+
| PBF compression | Option | Level |
31+
| --------------- | ------ | --------- |
32+
| No compression | `none` | n/a |
33+
| ZLIB | `zlib` | 0 - 9 |
34+
| LZ4 | `lz4` | 1 - 65537 |
35+
2036
PBF files contain a string table in each data block. Some programs sort this
2137
string table for slightly better compression. Osmium does not do this to make
2238
writing of PBF files faster.
2339

2440
Usually PBF files contain all the metadata for objects such as changeset id,
25-
username, etc. To save some space you can disable writing of metatdata with the
41+
username, etc. To save some space you can disable writing of metadata with the
2642
format option `add_metadata=false`.
2743

_file_formats_manual/10_format_comparison.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ But sometimes you can decide. Here are some guidelines:
1616
writing is fast in Osmium, because it uses multithreading. The only drawback
1717
is that you can't easily look inside those files because of the binary
1818
format.
19-
* You can disable compression (option `pbf_compression=none`) on PBF files
20-
which makes them larger but faster to read. This might make sense if you
21-
will read those files very often and aren't concerned about disk usage. You
22-
have to experiment.
19+
* You can use LZ4 compression (option `pbf_compression=lz4`) on PBF files or
20+
disable compression altogether (option `pbf_compression=none`) which makes
21+
them larger but faster to read. This might make sense if you will read those
22+
files very often and aren't concerned about disk usage. You have to
23+
experiment. Note that most other PBF-reading programs will not support the
24+
LZ4 compression.
2325
* The OSM API uses the XML format, so if you interact with that API, you'll
2426
want to use XML. Also OSM change files only come in XML format, so most
2527
software can only use them in that format.

0 commit comments

Comments
 (0)