1 unstable release

0.1.0 Mar 6, 2024

#93 in Geospatial

Download history 119/week @ 2024-03-01 36/week @ 2024-03-08 10/week @ 2024-03-15 17/week @ 2024-03-29

103 downloads per month

MIT/Apache

22KB
377 lines

osmx-rs

This is a Rust port of OSMExpress, a fast storage format for OpenStreetMap data created by Brandon Liu for Protomaps. The format supports random access (looking up nodes, ways and relations by ID), spatial indexing of node locations, and in-place updates.

Usage

See the docs for API documentation and the examples directory for commented example programs.

The README, Manual, and Programming Guide of the OSMExpress C++ reference implementation may also be helpful.

Features

This crate supports reading from .osmx database files, including:

  • fetching nodes, ways and relations by ID
  • reading an element's tags
  • getting a node's location, a way's nodes, or a relation's members
  • finding nodes in a region using the spatial index
  • getting reverse relationships (finding all ways that a node is part of, or all relations that an element is a member of)

It does not yet support:

  • reading element metadata (e.g. the version number of an element or the changeset and user that most recently modified it)
  • writing data to an .osmx database, or creating a new .osmx database

Pull requests for these missing features are welcome.

Safety

osmx-rs is not designed for reading untrusted input files. Using this crate to read a malformed .osmx file may cause the process to panic, or worse. Pull requests to improve safety or prevent panics are welcome.

Also worth noting that osmx-rs depends on the lmdb crate, which wraps the LMDB C API and therefore requires the use of unsafe.

License

This code can be used under the terms of either the MIT license or Apache-2.0 license, at your option.

Dependencies

~6MB
~128K SLoC