RustGIS is a fast, free and open-source GIS in pure Rust for mapping, analyzing and sharing geospatial data, on the desktop and in the browser. Its architecture: layered crates, everything is a command, a thin egui front end, headless screenshots for UI work.
- No
unwrap(),expect(),panic!,unreachable!,todo!in non-test code; nounsafe(unsafe_code = "forbid"). Crate roots carry the#![deny(clippy::unwrap_used, …)]block. - Input from files and command parameters is hostile:
get()over indexing, clamp sizes, bound recursion.Session::runandanalysis::runcatch escaped panics as a last resort. crates/engine/src/tests.rs::hostile_params_never_panicand the analysis equivalent run every command/tool with junk parameters. Keep them green; every crash fix gets a regression test.
| Layer | Crate | Job |
|---|---|---|
| L0 | geom |
coordinates, extents, Web Mercator, geodesic measurement, scale |
| L1 | data |
features, typed attributes, GeoJSON/CSV/Shapefile/KML/GPX I/O, GeoPackage/GeoParquet/FlatGeobuf/LiDAR (LAS/LAZ) providers (source; GeoPackages in the browser through the pure-Rust sqlite reader; GDAL formats and DuckDB queries through their programs), SQL where clauses, rasters (GeoTIFF/ASCII grid, Zarr stores, EPSG reprojection) |
| L2 | map, analysis |
layers, symbology, labels, camera, basemaps, web tile layers; geoprocessing tools |
| L2 | tiles |
web map tiles: XYZ/TMS/WMS rasters, Mapbox Vector Tiles, PMTiles and MBTiles archives, a MapLibre style subset; the tile cache and background fetching (see docs/user-guide/maps.md › Basemaps) |
| L3 | render |
tiny-skia map renderer, label placement, PNG export, font discovery |
| L3 | plugins |
plugins: sandboxed WebAssembly modules (wasmi) adding commands and tools; .rgplugin packages, the plugin registry (see docs/plugins.md) |
| L3 | geolibre |
the GeoLibre/Whitebox tool suite as geoprocessing tools (engine feature geolibre): run by the optional geolibre program natively, by geolibre-rust's WASI runner in the browser |
| L4 | engine |
Session, undo, command registry, sample project |
| L5 | assistant |
the AI Assistant: a chat agent (sans I/O: provider builds and reads OpenAI/Anthropic/Gemini requests, agent loops, tools run commands; file, network and plugin commands wait for the user's approval) |
| L6 | ui-egui |
ribbon, panes, map view, attribute table, dialogs (swappable) |
| apps | rustgis, rustgis-cli, rustgis-web, rustgis-python |
desktop app, command line, browser (WebAssembly), the rustgis Python package (PyO3, built with maturin) |
- Everything is a command: a
CommandSpecincrates/engine/src/cmd/*.rs. UI-only commands (ui.*) live incrates/ui-egui/src/lib.rs. The ribbon, shortcuts, command search and CLI dispatch by id. Commands never open dialogs. - Never break wasm: everything below
apps/must build forwasm32-unknown-unknown(CI runscargo build --target wasm32-unknown-unknown -p rustgis-web; the Zstandard decoder inrustgis-datais C, so this needs clang). Useweb_time, notstd::time; file access goes throughServiceson the web.rustgis-geolibrebuilds for both: natively it runs thegeolibreprogram; in the browser the web app runs geolibre-rust's WASI runner asynchronously (external_start→Services::geolibre_run→gp.finish). - Interface text is translatable: wrap user-visible literals in
tl!("…"), usei18n::fmt("… {name} …", &[("name", …)])instead offormat!for messages, and pass labels to the ribbon widgets (they translate). Then add the new strings to every catalog incrates/ui-egui/src/i18n/*.tsv(format indocs/i18n.md). Command ids, data and the CLI are never translated. - Layering is enforced by
cargo xtask layers: nothing below L6 depends on egui/eframe/rfd.
- No third-party vendor icons, images, styles, fonts, help text or code. Icons are drawn in
code (
icons.rs). Every asset file has a row inATTRIBUTION.md. - Screenshots and other images are not committed here: they live in
opengeos/rustgis-assets (WebP, served at
https://assets.rustgis.app/images/…) and docs link to them by URL.
cargo xtask ci (fmt, clippy -D warnings, tests, layers) before every commit.
cargo run --release -p rustgis(opens the World Atlas sample).- Headless screenshots:
cargo run --release -p rustgis-ui-egui --example ui_shot -- script.jsonl(see the example header). For UI work, look at the PNG. - CLI:
rustgis-cli run --sample --cmd 'gp.run={"tool":"buffer","params":{"input":"Cities","distance":100}}' --cmd 'share.exportMap={"path":"out.png"}'.