|0.3.3||May 23, 2023|
|0.3.2||Apr 10, 2023|
|0.2.0||Apr 1, 2023|
|0.1.0||Mar 27, 2023|
#216 in Geospatial
200 downloads per month
Similarly, there are two steps to writing the PBF format: encoding and serialization. Encoding converts OSM elements into fileblocks. This crate does not support encoding yet. Serialization flattens fileblocks into raw data.
This crate is written with async I/O for use with tokio.
The code is serial in nature but it's possible to parallelize encoding/decoding since fileblocks are independent in PBF.
Read parallelization example:
get_osm_pbf_locationsto get a stream of fileblock locations
parse_osm_pbf_at_locationfor each location independently
- Process blocks as desired
Write parallelization example:
- Split your blocks into chunks
write_osm_pbffor each chunk independently with an in-memory vector as the writer
- As each call completes, write them to their final destination (i.e. a file)
There is a feature for each supported compression algorithm:
Lz4 support is not available yet. Bzip2 has been deprecated for years so it is not supported.
There isn't any fine-grained control over encoding but feel free to file an issue if you are interested.