Repository navigation
Description
Problem
GeoLibre tools that take a field name show it as a free text box. The form gives no hint of which fields the input layer has, so users guess, and a wrong guess only shows up once the runner rejects it.
Reported in #1061: on Kernel Density Ratio, the run failed with the message below. Nothing in RustGIS or the runner fills in OID, so the reporter most likely typed it into Weight field, taking it from the attribute table. OID is the table's first column, but it's the row number the table draws, not a field.
Kernel Density Ratio: validation error: weight field 'OID' not found
The reporter's shapefile (attached to #1061) has only name and notes text fields. Left blank, the field works as documented: with the GeoLibre 1.7.1 runner, rustgis-cli run --data "FOCOS QUEIMADAS.shp" --cmd 'gp.run={"tool":"geolibre:kernel_density_ratio","params":{"input":"FOCOS QUEIMADAS","denominator":"FOCOS QUEIMADAS"}}' gives a 200×148 raster (every point counts 1, ratio 1 everywhere, as expected for one layer over itself). So the pipeline is fine. The form is what invited the wrong value.
Scope
In the 1.7.1 runner's manifests, 227 of 1,062 tools have parameters that name fields (field, value_field, class_field, weight_field, id_field, *_fields, …). All of them come out as ParamKind::Text in crates/geolibre/src/lib.rs (spec_of): the manifests give them data_kind: "string" and no hint that they're fields.
59 of those tools have more than one vector input, and the field can belong to either one. For example, Kernel Density Ratio's denominator_weight_field belongs to denominator, not input. Today ParamKind::Field and NumericField always refer to the first layer parameter, so they can't express this.
Proposed solution
- Field pickers for GeoLibre field parameters. Show the input layer's fields as a dropdown (or as suggestions on the text box, so a name the layer doesn't have yet can still be typed). This needs a way to say which input a field belongs to. Either a naming rule (
<input>_field/target_*→ that input, otherwise the first) or, better, a field in the GeoLibre manifest that names the source input, asked for upstream in geolibre-rust. - Clearer error message: when the runner reports a field "not found", RustGIS could add the input layer's field names to the message.
The attribute table's OID header is a separate, smaller question: it looks like a field name. Calling it # or Row would stop people trying it as one.
Related
- [Feature]: Merge (append) tool for vector layers #1061 (the report)
- feat(analysis): add native Kernel Density analysis tool #1063 (native Kernel Density, whose weight is a
NumericFieldpicker)
Activity
feat(geolibre): provide field pickers for GeoLibre field parameters a…
style(analysis): lib.rs with Unix line endings, as every other file
feat(analysis): a running tool can be cancelled and reports its progr…