#openstreetmap #api #api-bindings #geospatial #gis

osm-api

Rust binding for the Open Street Map Api

2 releases

new 0.1.1 Feb 14, 2025
0.1.0 Feb 13, 2025

#77 in Geospatial

Download history 237/week @ 2025-02-11

238 downloads per month

MIT/Apache

22KB
378 lines

OpenStreetMap API Rust Binding

A Rust binding for the OpenStreetMap API that allows you to interact with OpenStreetMap data programmatically. This crate aims to provide a simple and efficient way to access and manipulate OSM data in your Rust projects. NOTE: This project is still on early stages of development, and many function are not yet implemented. If you interested in contributing, please feel free to do so.

Features

  • Rust-friendly API: Convenient Rust interface for interacting with OSM data.
  • XML Parsing: Built-in support for parsing and serializing OSM XML data.
  • Extensible: Designed to be extended with additional API functions and authentication support.

API Documentation

Installation

Add this crate to your Cargo.toml:

cargo add osm-api

Usage Example

Below is a simple example demonstrating how to fetch and display OSM data:

extern crate osm_api;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Replace "some_endpoint" with an actual API endpoint.
    let response = osm_api::get_data("some_endpoint")?;
    println!("{:#?}", response);
    Ok(())
}

Current TODO

  • Implement tests
  • Add functions for direct access to the API
  • Integrate OAuth features for authentication
  • Improve overall documentation

Version Compatibility

API version Rust binding version
0.6 0.1.*

Contributing

Contributions are welcome! If you encounter issues or have ideas for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License OR APACHE-2.0 License.

Dependencies

~6–18MB
~234K SLoC