A small Rust engine for spatial queries and pathfinding over a 3D starmap.
Features:
- Nearest neighbours: N nearest systems within a radius using a 3D k‑d tree.
- Gate pathfinding: A* through a gate network using minimal fuel cost (one unit per gate jump).
- Sweep optimisation: Greedy minimum-distance visit of all systems within a radius of a point.
The crate is structured as a reusable library with an AWS Lambda binary entrypoint.
src/lib.rs– coreSystemtype and module wiring.src/spatial/kd_tree.rs– k‑d tree implementation and nearest‑within‑radius query.src/graph/graph.rs– starmap graph structure.src/graph/pathfinder.rs– A* over the gate graph.src/sweep/sweep.rs– greedy sweep to visit all systems in a radius.src/main.rs– AWS Lambda handler that exposes three operations:nearestpathsweep
cargo test{
"kind": "nearest",
"system_name": "A",
"radius": 3.0,
"count": 3
}{
"kind": "path",
"start_id": 1,
"end_id": 3
}{
"kind": "sweep",
"center": [0.0, 0.0, 0.0],
"radius": 3.0
}Both the nearest and sweep requests accept either explicit coordinates via
origin/center fields or a system_name that is resolved against the
loaded starmap dataset.
Run the dataset builder to download the latest
evefrontier_datasets
release and emit a compressed bundle suitable for Lambda deployment:
cargo run --bin build_datasetThe command stores the resulting files in data/:
starmap.bin– Zstandard-compressedStarGraphready for inclusion in the Lambda package.starmap.meta.json– Build metadata (release tag, counts, timestamp).
The binary starmap_lambda is suitable for deployment to AWS Lambda using the
provided.al2 runtime and tools such as cargo-lambda.
Set the STARMAP_DATASET environment variable to the path of the compressed
dataset (for example, data/starmap.bin) to have the Lambda load it at startup.
If the variable is unset or loading fails, the handler falls back to a small
in-memory demo graph.