Left-hand traffic area classifier for Point, Line, and Bbox queries over well_known left-right-hand-traffic.osm.
| Target | Command | Purpose |
|---|---|---|
| Library | cargo test / cargo build |
Core Rust classifier API |
| CLI | cargo run -- point <lat> <lon> |
Query a point, line, or bbox from the terminal |
| web | cargo web |
Generates dist/gauche-wasm-map.html |
| bench | cargo bench |
Runs the root ffi-vs-rust and queries Criterion benches |
| FFI wasm | cargo build --manifest-path ffi/Cargo.toml --target wasm32-unknown-unknown --release |
Opaque-handle wasm API for C/C++ consumers |
| generate-c | cargo generate-c |
Regenerate checked-in c/gauche_ffi.c and c/gauche_ffi.h from wasm via w2c2 |
| C++ wrapper | cmake -S cpp -B cpp/build && cmake --build cpp/build |
Consumable C++ library and example over the checked-in C FFI |
| release-all | cargo release-all |
Rebuild release targets, then regenerate c/ and dist/ artifacts |
pointreturnsyesornolineandbboxreturnyes,no, orpartiallypartiallyresults fall back to exact geometry checks
cargo run -- point 51.5072 -0.1276
cargo run -- line 51.5 -0.1 52.0 0.2
cargo run -- bbox 49.0 -5.0 55.0 2.0If your project vendors this repository, add the cpp/ directory and link the target:
add_subdirectory(path/to/gauche-rs/cpp)
target_link_libraries(my_app PRIVATE gauche::cpp)Then include:
#include <gauche/gauche.hpp>cpp/CMakeLists.txt installs headers, library, and exported targets.
For single-config generators (Ninja/Unix Makefiles):
cmake -S cpp -B cpp/build -DGAUCHE_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build cpp/build
cmake --install cpp/build --prefix /your/prefixFor multi-config generators (Visual Studio/Xcode):
cmake -S cpp -B cpp/build -DGAUCHE_BUILD_EXAMPLES=OFF
cmake --build cpp/build --config Release
cmake --install cpp/build --prefix /your/prefix --config ReleaseThe install currently exports targets but does not provide a gaucheConfig.cmake, so use:
include("/your/prefix/lib/cmake/gauche/gaucheCppTargets.cmake")
target_link_libraries(my_app PRIVATE gauche::gauche_cpp)preprocessed/bitmap.binstores the 0.1° bitmap used at runtime.dist/gauche-wasm-map.htmlis the generated web artifact.c/gauche_ffi.c,c/gauche_ffi.h, andc/w2c2/w2c2/are checked in and regenerated from the wasm FFI target.
src/lib.rs— core classifiersrc/main.rs— CLIsrc/bin/web-build.rs— web target generatorsrc/bin/generate-c.rs— wasm-to-C generatorffi/— wasm FFI cratebenches/ffi-vs-rust.rs— Root ffi-vs-rust Criterion benchmarkbenches/queries.rs— Root query Criterion benchmarkcpp/— CMake-based C++ wrapper and example