Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Browser](https://youtu.be/XFhqlSiKn6U) walks through the main features, and the
<td width="50%" valign="top"><img src="https://assets.rustgis.app/images/plugins.webp" alt="The Plugin Manager browsing the plugin registry, listing Basemaps, Hello RustGIS, Map Explorer and Vector Toolkit with their permissions" width="100%"><p align="center"><sub><b>Plugins.</b> Install sandboxed plugins from <a href="https://plugins.rustgis.app">plugins.rustgis.app</a>.</sub></p></td>
</tr>
<tr>
<td width="50%" valign="top"><img src="https://assets.rustgis.app/images/modelbuilder.webp" alt="ModelBuilder after a run: Cities buffered by 300 km clip the Rivers, and Countries are dissolved by continent; every node is ticked and the results are on the map" width="100%"><p align="center"><sub><b>ModelBuilder.</b> Chain tools on a node canvas and run them in one go.</sub></p></td>
<td width="50%" valign="top"><img src="https://assets.rustgis.app/images/modelbuilder.webp" alt="Model Designer after a run: Cities buffered by 300 km clip the Rivers, and Countries are dissolved by continent; every node is ticked and the results are on the map" width="100%"><p align="center"><sub><b>Model Designer.</b> Chain tools on a node canvas and run them in one go.</sub></p></td>
<td width="50%" valign="top"><img src="https://assets.rustgis.app/images/web-data.webp" alt="The Sentinel-2 Explorer in the Web Data pane over Bern: the clearest recent scenes as cards with previews, their footprints drawn on the map" width="100%"><p align="center"><sub><b>Web Data.</b> STAC, Overture Maps, NASA and open-data portals, where the map is.</sub></p></td>
</tr>
<tr>
Expand Down Expand Up @@ -109,7 +109,7 @@ Every screenshot is RustGIS itself, rendered offscreen by `cargo run -p rustgis-
| **Web tiles** | XYZ/TMS/WMS raster tiles, Mapbox Vector Tiles and MapLibre styles (sprites, patterns, expressions), cached and fetched in the background |
| **Cartography** | Single symbol, unique values (also by expression), graduated colours with seven classification methods and manual breaks, proportional symbols, pie and bar diagrams; symbol size, colour, width and angle, and label text, size, colour and angle, by expression; label classes with SQL queries, straight and curved line placement, river names fitted along their lines, labels curved along polygons and guide lines, installed font families (desktop), scale ranges and annotation; stacked and dashed line strokes, PNG and JPEG picture markers (also from ArcGIS services and QGIS styles), hatch, marker, gradient and shapeburst fills, custom colour ramps and the matplotlib colour maps, symbol levels, reference scales and polygons without fill; masking, display filters, aggregation bins, 2.5D extrusion; graphics and dynamic text |
| **Editing** | Create, move, rotate, scale, merge, split and explode features; vertex editing, constrained rotated boxes with paddle/numeric controls, cut polygons, reshape and trace along an edge; coincident polygon vertices in a layer moved together with Shared Vertices turned on; snapping, templates, elevation, traverse, topology rules; domains, subtypes, attribute rules, contingent values, relationships, archiving; Calculate Field with an expression language and Calculate Geometry in metric or imperial units, from the attribute table; edits saved back to GeoPackage and PostGIS tables, and published back to the Shapefile or GeoJSON file a layer was read from (desktop); undo for everything in the project (undoing a save doesn't reverse what was written to the table) |
| **Analysis** | Selection by attributes (SQL) and location; Buffer, Near, Clip, Erase, Split, Intersect, Identity, Union, Symmetrical Difference, Update, Summarize Within, Summary Statistics, Pivot Table, Tabulate Intersection, Spatial Join, Zonal Statistics, Kernel Density, A5 grids; viewshed, line of sight, IDW, ordinary kriging, shortest path, Service Area and OD Cost Matrix over a line network, Tabulate Area, suitability modelling; tools in the background on the desktop with progress and Cancel, many on several cores, and in batches; ModelBuilder on a node canvas, scripts with command, parameter and value completion, and history copied as code; 1,000+ [GeoLibre](https://github.com/opengeos/geolibre-rust) and Whitebox raster, vector, LiDAR, hydrology and terrain tools |
| **Analysis** | Selection by attributes (SQL) and location; Buffer, Near, Clip, Erase, Split, Intersect, Identity, Union, Symmetrical Difference, Update, Summarize Within, Summary Statistics, Pivot Table, Tabulate Intersection, Spatial Join, Zonal Statistics, Kernel Density, A5 grids; viewshed, line of sight, IDW, ordinary kriging, shortest path, Service Area and OD Cost Matrix over a line network, Tabulate Area, suitability modelling; tools in the background on the desktop with progress and Cancel, many on several cores, and in batches; Model Designer on a node canvas, scripts with command, parameter and value completion, and history copied as code; 1,000+ [GeoLibre](https://github.com/opengeos/geolibre-rust) and Whitebox raster, vector, LiDAR, hydrology and terrain tools |
| **Data management** | Dissolve, Merge and Join Field; geometry conversions (feature to point, feature vertices to points, points along lines, polygon to line, split line at vertices, unsplit line, feature envelope to polygon, XY table to point) and minimum bounding geometry; check and repair geometry |
| **Imagery** | Ortho and reality mapping, pixel classification (k-means, minimum distance, a trainable neural network), mensuration, hosted imagery tiles |
| **Layouts and reports** | Page layouts with map frames, legends, scale bars, grids, bar and column charts and map series; publication sheets and figures in one command, format panes, guides, snapping and element locks; reports with groups, statistics, charts and subreports; vector PDF and SVG, and GeoPDF with [supported map frames](docs/user-guide/layouts.md#layouts) georeferenced; presentations (HTML slideshow, PDF); notebooks (Jupyter in and out) |
Expand Down
2 changes: 1 addition & 1 deletion apps/rustgis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ impl eframe::App for App {
press(&mut raw_input.events, k);
}
}
// Undo and Redo as when typed: a focused text field or ModelBuilder's canvas takes
// Undo and Redo as when typed: a focused text field or Model Designer's canvas takes
// the Mac's key, the keymap the key it gives them; with none, the command runs.
menu::Action::Keys { command, .. } => {
let own = ctx.text_edit_focused() || (self.0.mb.shown() && !ctx.egui_wants_keyboard_input());
Expand Down
4 changes: 2 additions & 2 deletions apps/rustgis/src/menu.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! macOS: the native menu bar (#1077), beside the ribbon rather than a copy of it. Each item runs
//! a command the app already has, so the menus add no behaviour of their own: File, View and Help
//! items run their commands as the ribbon does (asking to save first when one would replace the
//! project), the Edit items work as their keys do (on a focused text field, ModelBuilder's canvas,
//! project), the Edit items work as their keys do (on a focused text field, Model Designer's canvas,
//! or the project), and Quit RustGIS asks to save unsaved changes. The shortcuts shown are the
//! keymap's, and items grey out as their commands do; Undo and Redo don't, since a text field
//! undoes its own text when the project has nothing to undo.
Expand All @@ -28,7 +28,7 @@ use serde_json::Value;
pub enum Action {
/// Runs a command with these parameters (JSON, or empty for none), as the ribbon does.
Command(&'static str, &'static str),
/// Undo or Redo: as its key would when typed (a focused text field or ModelBuilder's canvas
/// Undo or Redo: as its key would when typed (a focused text field or Model Designer's canvas
/// takes the Mac's, `fallback`; the keymap the one it gives the command), else runs the
/// command. Shows the keymap's key, else `fallback` when no other command has it.
Keys {
Expand Down
4 changes: 2 additions & 2 deletions crates/engine/src/cmd/sharing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ fn share_bytes_inner(s: &mut Session, kind: &str, p: &Value, out: Output<'_>) ->
}
"webTool" => {
let i = shared_model(s, p)?;
let m = s.project.models.get_mut(i).ok_or("make a model first (ModelBuilder)")?;
let m = s.project.models.get_mut(i).ok_or("make a model first (Model Designer)")?;
let name = m.name.clone();
let (bytes, report) = crate::durable::output(m, None, |m| out.json_pretty(&crate::model::to_web_tool_file(&m.name, &m.steps)))?;
crate::durable::notify(s, &report);
Expand Down Expand Up @@ -1937,7 +1937,7 @@ fn shared_model(input: &impl super::InputSource, p: &Value) -> Result<usize, Str
let s = &context;
match ps(p, "model") {
Some(n) => s.project.models.iter().position(|m| m.name.eq_ignore_ascii_case(n)).ok_or_else(|| format!("no model '{n}'")),
None => s.project.models.len().checked_sub(1).ok_or_else(|| "make a model first (ModelBuilder)".into()),
None => s.project.models.len().checked_sub(1).ok_or_else(|| "make a model first (Model Designer)".into()),
}
}
/// Binds effective included datasets and the actual target path without producing export bytes.
Expand Down
10 changes: 5 additions & 5 deletions crates/engine/src/cmd/workflows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn commands() -> Vec<C> {
r#"{"threads"?: the most threads one piece of work uses, 1–1024, for the whole process and not saved with the project (null: the default, the cores up to 16); without it, the setting is only said}"#,
),
C::new("gp.gallery", "Tool Gallery", "Analyze › Portal", gallery).roles(&[]).effects(crate::policy::Effects::NONE).view().params(r#"{"kind": "ready"|"feature"|"raster"}"#),
C::new("model.new", "ModelBuilder", "Analyze › Geoprocessing", new_model).roles(&[crate::ParamRole { key: "steps", role: crate::Role::ModelSteps }, crate::ParamRole { key: "graph", role: crate::Role::ModelGraph }]).effects(crate::policy::Effects::NONE.with(crate::policy::Effect::Reserved).with(crate::policy::Effect::Files)).params(
C::new("model.new", "Model Designer", "Analyze › Geoprocessing", new_model).roles(&[crate::ParamRole { key: "steps", role: crate::Role::ModelSteps }, crate::ParamRole { key: "graph", role: crate::Role::ModelGraph }]).effects(crate::policy::Effects::NONE.with(crate::policy::Effect::Reserved).with(crate::policy::Effect::Files)).params(
r#"{"name"?: string, "graph"?: {"nodes": [{"id", "kind": "input"|"tool"|"output", "x", "y" (optional), an input's "layer", a tool's "tool" and "params", an output's "name"}], "edges": [{"from", "fromPort": "out", "to", "toPort": a tool's layer parameter | "in" (output)}]}, "steps"?: [{"tool": id, "params": {…, "%1" for step 1's output}}], "fromHistory"?: bool, "imported"?: bool (from a file: its tools may not touch files)}"#,
),
C::new("model.save", "Save Model", "Analyze › Geoprocessing", save_model).roles(&[crate::ParamRole { key: "graph", role: crate::Role::ModelGraph }]).effects(crate::policy::Effects::NONE.with(crate::policy::Effect::Reserved))
Expand Down Expand Up @@ -1109,7 +1109,7 @@ fn new_model(s: &mut Session, p: &Value) -> CmdResult {
}
}
}
// Steps stay steps (ModelBuilder shows them as a graph, and saves one).
// Steps stay steps (Model Designer shows them as a graph, and saves one).
let mut name = base.clone();
let mut i = 1;
while s.project.models.iter().any(|m| m.name.eq_ignore_ascii_case(&name)) {
Expand All @@ -1130,7 +1130,7 @@ fn new_model(s: &mut Session, p: &Value) -> CmdResult {
let cut = kept < length;
if cut {
s.notify(
format!("ModelBuilder: a model has that name already, so the name given is cut to {kept} characters to fit \" {i}\""),
format!("Model Designer: a model has that name already, so the name given is cut to {kept} characters to fit \" {i}\""),
false,
);
}
Expand Down Expand Up @@ -1454,13 +1454,13 @@ fn model_file(s: &mut Session, p: &Value, out: super::exports::Output<'_>) -> Re
}

/// Runs a model saved as steps (no graph) in order, putting each step's output layer name in place
/// of `%n` anywhere in the parameters, as models always ran before ModelBuilder drew graphs.
/// of `%n` anywhere in the parameters, as models always ran before Model Designer drew graphs.
fn run_steps(s: &mut Session, model: Model) -> CmdResult {
if model.steps.is_empty() {
return Err(format!("{} has no steps", model.name));
}
// A model that came in a file (an opened project, or an imported tool) may not touch files.
// Each step is checked as the `gp.run` it is, tool and all, as ModelBuilder's graphs are.
// Each step is checked as the `gp.run` it is, tool and all, as Model Designer's graphs are.
if !s.item_trusted("model", &model.name)
&& let Some((i, st)) = model
.steps
Expand Down
4 changes: 2 additions & 2 deletions crates/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,10 @@ pub struct Session {
/// Models made in this session (lower-cased names); the steps of others may not touch files.
trusted_models: policy::Trust,
/// What the last model run did, node by node (`model::RunReport`), kept even when the run
/// failed and the project was restored, so ModelBuilder can show which node stopped it.
/// failed and the project was restored, so Model Designer can show which node stopped it.
pub model_run: Option<model::RunReport>,
/// Counts the projects started in this session (new, open): front ends holding state about
/// the project (ModelBuilder's canvas) drop it when this changes.
/// the project (Model Designer's canvas) drop it when this changes.
pub project_starts: u64,
/// Notebooks made in this session (lower-cased names); the cells of others may not touch files.
trusted_notebooks: policy::Trust,
Expand Down
2 changes: 1 addition & 1 deletion crates/engine/src/model.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! ModelBuilder's models as graphs: the ports each node offers, the problems that keep a model
//! Model Designer's models as graphs: the ports each node offers, the problems that keep a model
//! from running, the order its nodes run in, an automatic layout, and the run itself.
//!
//! A graph has three kinds of node. An **input** names a layer of the map; a **tool** is a
Expand Down
4 changes: 2 additions & 2 deletions crates/engine/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ pub struct ProjectedCells {
}

/// A model: geoprocessing steps run in order. A parameter value `%n` stands for the output layer
/// of step n (1-based). A model drawn in ModelBuilder keeps its `graph` too, which is what runs;
/// of step n (1-based). A model drawn in Model Designer keeps its `graph` too, which is what runs;
/// `steps` then holds the same tools in run order, for older versions and web tools.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
Expand All @@ -951,7 +951,7 @@ pub struct Model {
pub graph: Option<ModelGraph>,
}

/// A model as ModelBuilder draws it: input, tool and output nodes joined by edges from an output
/// A model as Model Designer draws it: input, tool and output nodes joined by edges from an output
/// port to an input port (see `crate::model`).
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
Expand Down
10 changes: 5 additions & 5 deletions crates/engine/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20817,19 +20817,19 @@ fn model_new_refuses_or_says_what_it_leaves() {
let r = s.run("model.new", &json!({"name": at(200), "steps": [step.clone()]})).unwrap();
assert_eq!(r["model"].as_str().map(|n| (n.chars().count(), n.ends_with(" 2"))), Some((200, true)), "{r}");
assert_eq!(
said(&s, mark, "ModelBuilder"),
["ModelBuilder: a model has that name already, so the name given is cut to 198 characters to fit \" 2\""]
said(&s, mark, "Model Designer"),
["Model Designer: a model has that name already, so the name given is cut to 198 characters to fit \" 2\""]
);
let mark = s.notice_mark();
s.run("model.new", &json!({"name": "Long", "steps": [step.clone()]})).unwrap();
assert!(said(&s, mark, "ModelBuilder").is_empty(), "a short name only gains the suffix");
assert!(said(&s, mark, "Model Designer").is_empty(), "a short name only gains the suffix");
// A cut that lands on a space keeps no space before the suffix: the name's 197 letters, then " 2".
let spaced = format!("{} bc", "a".repeat(197));
s.run("model.new", &json!({"name": spaced, "steps": [step.clone()]})).unwrap();
let mark = s.notice_mark();
let r = s.run("model.new", &json!({"name": spaced, "steps": [step.clone()]})).unwrap();
assert_eq!(r["model"], format!("{} 2", "a".repeat(197)), "{r}");
assert_eq!(said(&s, mark, "ModelBuilder").len(), 1, "the cut to 197 is said");
assert_eq!(said(&s, mark, "Model Designer").len(), 1, "the cut to 197 is said");
// From the history: 2,006 runs, five with a tool that isn't available. The model replays the
// first 2,000 of the 2,001 it can, in their order, and says both.
let run = |i: usize| crate::GpRecord {
Expand Down Expand Up @@ -47517,7 +47517,7 @@ fn unreadable_model_nodes_do_not_redirect_their_connections() {
assert_eq!(graph.edges.len(), 1);
}

/// ModelBuilder graphs: validated, run in flow order, intermediate results dropped, outputs named.
/// Model Designer graphs: validated, run in flow order, intermediate results dropped, outputs named.
fn model_graphs(s: &mut Session) {
let graph = json!({
"nodes": [
Expand Down
12 changes: 6 additions & 6 deletions crates/ui-egui/src/analysispane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ pub const SECTIONS: &[(&str, &str)] = &[
("similar", "Embeddings"),
("interop", "Data Interop"),
("environments", "Environments"),
("models", "ModelBuilder"),
("models", "Model Designer"),
("georeference", "Georeference"),
("change", "Change Detection"),
("trend", "Trend Analysis"),
Expand Down Expand Up @@ -1600,17 +1600,17 @@ pub fn workflows(app: &mut RustGisApp, ui: &mut Ui, t: &Tokens) {
heading(ui, "Models");
let models: Vec<(String, usize)> = app.session.project.models.iter().map(|m| (m.name.clone(), m.steps.len())).collect();
if ui
.button(tl!("Open ModelBuilder"))
.button(tl!("Open Model Designer"))
.on_hover_text(tl!("Draw a model: chain tools from input layers to the results to keep"))
.clicked()
{
let _ = app.run("ui.modelBuilder", Value::Null);
let _ = app.run("ui.modelDesigner", Value::Null);
}
for (n, steps) in models {
ui.horizontal(|ui| {
ui.label(crate::i18n::fmt("{name} ({n} steps)", &[("name", &n), ("n", &steps.to_string())]));
if ui.small_button(tl!("Open")).on_hover_text(tl!("Open in ModelBuilder")).clicked() {
let _ = app.run("ui.modelBuilder", json!({"name": n}));
if ui.small_button(tl!("Open")).on_hover_text(tl!("Open in Model Designer")).clicked() {
let _ = app.run("ui.modelDesigner", json!({"name": n}));
}
// On the desktop its tools run on a thread of their own, the status bar
// showing it and Cancel; its result shows here once it lands.
Expand All @@ -1634,7 +1634,7 @@ pub fn workflows(app: &mut RustGisApp, ui: &mut Ui, t: &Tokens) {
match app.run("model.new", json!({"name": "Model", "fromHistory": true})) {
Ok(v) => {
let name = v["model"].as_str().unwrap_or_default().to_string();
let _ = app.run("ui.modelBuilder", json!({"name": name}));
let _ = app.run("ui.modelDesigner", json!({"name": name}));
}
Err(e) => app.workflow.error = Some(e),
}
Expand Down
Loading
Loading