Crates.io | mapsforge-rs |
lib.rs | mapsforge-rs |
version | 0.1.0 |
source | src |
created_at | 2024-11-13 19:52:39.796565 |
updated_at | 2024-11-13 19:52:39.796565 |
description | A Rust parser for Mapsforge binary map files |
homepage | |
repository | https://github.com/ChetanXpro/mapsforge-rs |
max_upload_size | |
id | 1446992 |
size | 11,916 |
A Rust parser for Mapsforge binary map files. This library provides functionality to read and parse Mapsforge map files (.map), which are commonly used for offline mapping applications.
Add this to your Cargo.toml
:
[dependencies]
mapsforge-rs = "0.1.0"
use std::fs::File;
use std::io::BufReader;
use mapsforge_rs::MapHeader;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open and read the map file
let file = File::open("path/to/map.map")?;
let mut reader = BufReader::new(file);
// Parse the header
let header = MapHeader::read_from_file(&mut reader)?;
// Access header information
println!("Map bounds: {:?}", header.bounding_box);
println!("File version: {}", header.file_version);
println!("Tile size: {}", header.tile_size);
Ok(())
}
byteorder
crate for handling endiannessContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is in active development. Current focus is on implementing basic file parsing capabilities.