A high-performance OpenStreetMap viewer built with WGPU and Rust.
Ensure you have Rust and Cargo installed on your system. Then, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/wgpu-osm-view.git cd wgpu-osm-view
-
Build the project:
cargo build --release
-
Download an OpenStreetMap PBF file for your desired region and place it in the project directory.
Run the application with:
cargo run --release -- <.osm file path>
The viewer will load the OpenStreetMap data and display it in a window. You can interact with the map using the following controls:
- Left-click and drag to pan the view
- Mouse wheel to zoom in/out
- Right-click to reset the camera
- Efficient OSM Data Parsing: Quickly loads and processes large OpenStreetMap PBF files.
- Hardware-Accelerated Rendering: Utilizes WGPU for fast, cross-platform graphics rendering.
- Intuitive Camera Controls: Smooth panning and zooming for easy map navigation.
- Caching System: Implements a smart caching mechanism to improve load times for subsequent runs.
- SMAA Anti-Aliasing: Enhances visual quality with subpixel morphological anti-aliasing.
The project uses several configuration options that can be adjusted in the source code:
cell_size
inSortedRenderData
: Controls the granularity of spatial partitioning for rendering optimization.SmaaMode
inGraphics::new()
: Adjusts the level of anti-aliasing (currently set toSmaa1X
).MAX_BUFFER_SIZE
inGraphics::new()
: Sets the maximum allowed buffer size for vertex data.
To modify these settings, edit the corresponding values in the main.rs
and graphics.rs
files.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Write clean, well-documented code adhering to Rust best practices.
- Ensure all existing tests pass and add new tests for your changes.
- Submit a pull request with a clear description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, bug reports, or feature requests, please open an issue on the GitHub repository