Crates.io | libosmium |
lib.rs | libosmium |
version | 0.3.1 |
source | src |
created_at | 2022-08-05 13:22:35.409174 |
updated_at | 2022-12-30 16:27:00.014278 |
description | Rust binding and wrapper for libosmium |
homepage | https://github.com/gammelalf/libosmium |
repository | https://github.com/gammelalf/libosmium |
max_upload_size | |
id | 639350 |
size | 1,726,105 |
Rust binding and wrapper around the excellent libosmium c++ library.
This crate was started out of necessity for a larger project. Therefore, it won't get much attention unless I need another feature or find a bug. But feel free to contribute.
This crate exposes libosmium's osm object classes (i.e. OSMObject
, Node
, Way
, etc.)
and the Handler
interface to read those from a file (currently only .pbf
).
Since libosmium has its own memory management, all objects are only exposed via references. So most of the types on rust's side are empty enums which can't be instantiated.
To expose these c++ classes' methods, this crate uses a small c++ shim (namely src/libosmium.cpp
)
which reexports them as un-mangled functions taking pointers.
Methods whose behaviour is trivial enough are simply implemented directly in rust to avoid unnecessary boilerplate.
This package builds libosmium and therefore needs its dependencies.
Install for debian:
apt install build-essential libboost-dev libprotozero-dev zlib1g-dev
Install for arch:
pacman -Sy cmake make boost-libs protozero zlib