update
This commit is contained in:
89
README.md
Normal file
89
README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# 🗺️ Rust Vector Map
|
||||
|
||||
A high-performance, GPU-accelerated vector map renderer built with **Rust**, **WebAssembly**, and **ScyllaDB**.
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **GPU Rendering**: Uses `wgpu` to render millions of vertices (buildings, roads, parks) directly on the GPU.
|
||||
- **WebAssembly**: Core logic runs in Wasm for near-native performance in the browser.
|
||||
- **Scalable Backend**: Powered by **ScyllaDB** to handle massive OpenStreetMap datasets with low latency.
|
||||
- **Custom Vector Tiles**: Efficient binary format for fast network transfer and parsing.
|
||||
- **Interactive**: Smooth zooming, panning, and dynamic level-of-detail.
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
- **Frontend**: Rust (`winit`, `wgpu`, `wasm-bindgen`) compiled to WebAssembly.
|
||||
- **Backend**: Rust (`Axum`) REST API serving tile data.
|
||||
- **Database**: ScyllaDB (Cassandra-compatible) storing processed OSM data.
|
||||
- **Importer**: Custom Rust tool (`osmpbf`) to ingest `.osm.pbf` files.
|
||||
|
||||
## 🛠️ Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Rust](https://rustup.rs/) (latest stable)
|
||||
- [Docker](https://www.docker.com/) & Docker Compose
|
||||
- `wasm-pack`: `cargo install wasm-pack`
|
||||
|
||||
### 1. Start the Database
|
||||
|
||||
Start ScyllaDB in a container:
|
||||
|
||||
```bash
|
||||
docker compose up -d scylla
|
||||
```
|
||||
|
||||
### 2. Import Data
|
||||
|
||||
1. Download an OpenStreetMap PBF file (e.g., from [Geofabrik](https://download.geofabrik.de/)).
|
||||
2. Save it as `sample.osm.pbf` in the project root.
|
||||
3. Run the importer:
|
||||
|
||||
```bash
|
||||
cargo run --bin importer
|
||||
```
|
||||
|
||||
*Note: This process may take a few minutes depending on the size of the PBF file.*
|
||||
|
||||
### 3. Run the Application
|
||||
|
||||
**Option A: Docker (Recommended)**
|
||||
|
||||
Build and run the entire stack:
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
**Option B: Manual (Development)**
|
||||
|
||||
1. **Build Frontend**:
|
||||
```bash
|
||||
cd frontend
|
||||
wasm-pack build --target web --out-name wasm --out-dir ../backend/static
|
||||
cd ..
|
||||
```
|
||||
|
||||
2. **Run Backend**:
|
||||
```bash
|
||||
cargo run --bin backend
|
||||
```
|
||||
|
||||
### 4. View the Map
|
||||
|
||||
Open your browser and navigate to:
|
||||
|
||||
```
|
||||
http://localhost:3000
|
||||
```
|
||||
|
||||
## 📂 Project Structure
|
||||
|
||||
- `/backend`: Axum server and database logic.
|
||||
- `/frontend`: Rust Wasm application and rendering engine.
|
||||
- `/importer`: Tool for parsing and ingesting OSM data.
|
||||
- `docker-compose.yml`: Service orchestration.
|
||||
|
||||
## 📜 License
|
||||
|
||||
MIT License
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
- "9042:9042"
|
||||
- "9160:9160"
|
||||
- "10000:10000"
|
||||
command: --smp 1 --memory 2G --overprovisioned 1 --api-address 0.0.0.0 --max-memory-for-unlimited-query-soft-limit 1073741824 --tombstone-warn-threshold 10000000
|
||||
command: --smp 1 --memory 4G --overprovisioned 1 --api-address 0.0.0.0 --max-memory-for-unlimited-query-soft-limit 1073741824 --tombstone-warn-threshold 10000000
|
||||
volumes:
|
||||
- scylla_data:/var/lib/scylla
|
||||
|
||||
|
||||
Reference in New Issue
Block a user