Repository navigation
Description
Problem
A user report from v0.4: Kriging defaulted to degrees, which is odd for a raster. Their data was in Web Mercator, so they switched to a State Plane system in metres. RustGIS recognised the new EPSG code, but Kriging still ran in degrees.
This still happens on main. Vector geometry is held in WGS 84 longitude/latitude whatever the source file used (Dataset.crs only records the source system). Most tools handle that well:
- Distance tools (Buffer, Near, Spatial Join, Select By Location, Points Along Lines) measure geodesically, with a
unitschoice. - Overlay tools work in an internal plane and return longitude/latitude, so no unit is ever shown.
- Raster-making tools need a grid whose cells mean something on the ground. Kernel Density, Project Raster and Polygons to Raster take a projected
crsand work in its units.
A few raster-making tools have no projected option. They grid longitude/latitude directly, take the cell size (and Kriging's range) in degrees, and always write a LonLat raster. They ignore both the source layer's system and the map's projection, and nothing tells the user:
| Tool or command | Where | Degrees in |
|---|---|---|
Ordinary Kriging (kriging) |
crates/analysis/src/kriging.rs, tools.rs |
extent, pixelSize, range |
IDW Interpolation (idwInterpolation) |
crates/analysis/src/rasterops.rs, tools.rs |
extent, pixelSize |
Geostatistical Wizard (analysis.interpolate) |
crates/engine/src/cmd/workflows.rs |
cellSize (and the environment's) |
Environments cell size (gp.env) |
crates/engine/src/cmd/workflows.rs |
cellSize ("degrees, above 0", under 10) |
Ortho/reality mapping mosaic (imagery.workspace) |
crates/engine/src/cmd/imagery.rs |
cellSize; output fixed to LonLat |
All other analysis tools and commands checked are fine. Raster-input tools work on the input raster's own grid, and STAC/COG windows take sizes in the files' own units.
Plan
- Kriging and IDW Interpolation: optional
crs(I'm taking this; pull request to follow). These two share the grid code, so they go together. Given a projectedcrs, the points are projected into it,extent,pixelSizeand Kriging'srangeare in its units, and the rasters are written in it. Leavingcrsempty keeps today's degree results exactly, so saved scripts and models are unaffected. When the layer was read from a projected file andcrsis empty, the run reports that it worked in degrees and names the layer's system. A geographiccrsis refused, and points the system can't hold are counted and reported. This is an optional parameter whose default keeps today's behaviour, so it's the kind any maintainer can approve (docs/maintaining.md). - Geostatistical Wizard and the environment's cell size. Add the same optional
crstoanalysis.interpolate. The environment would need a coordinate system next tocellSize, which is an optional field in the project file (its absence keeps degrees). This is also the additive kind. Not claimed yet. - Ortho/reality mapping mosaic. The same optional
crsfor the workspace output. Not claimed. It can wait until someone mosaics projected imagery.
Questions for maintainers
-
Should raster-making tools default to the layer's projected source system? Kernel Density already does this: with
crsempty it uses the layer's system when that is projected. Polygons to Raster and Project Raster default to the layer's system too. Doing the same for Kriging, IDW and the wizard would give users like the reporter the right result without touching any setting. But it changes what an existing run returns, so under docs/maintaining.md it needs two maintainers. Options:- (a) Keep degrees as the default, with the notice (what the step 1 PR does). No result changes, but users have to find the setting.
- (b) Default to the layer's projected system when it has one, degrees otherwise. Consistent with Kernel Density, but existing scripts on projected layers get a different grid.
- (c) (b), but only for new runs from the dialog, with scripts keeping degrees unless they pass
crs. No script changes, but the dialog and scripts behave differently.
I recommend (b), in a separate pull request after step 1, so step 1 can land on its own.
-
Should the dialog fill
crsfrom the map's projection? The reporter changed the map's system and expected the tool to follow. Today no analysis tool reads the map's projection, and keeping it that way means a run doesn't depend on how the map is drawn. I'd keep tools independent of the map and rely on question 1, but it's worth a decision. -
Is step 2's project-file field acceptable, or should the wizard take
crsonly as a parameter and leave the environment in degrees?
Activity
Add kriging-crs-before screenshot (opengeos/RustGIS#1743)
Add kriging-crs-after screenshot (opengeos/RustGIS#1743)
feat(analysis): Kriging and IDW Interpolation make their raster in a …
Mavrick-F commentedon Nov 10, 2026
Step 1 landed in #1747: Kriging and IDW Interpolation take an optional projected
crs, and an empty one keeps today's degree results. Steps 2 and 3 and the three questions above are still open.Add wizard-crs-before-interpolate screenshot (opengeos/RustGIS#1743)
Add wizard-crs-after-interpolate screenshot (opengeos/RustGIS#1743)
Add wizard-crs-before-environments screenshot (opengeos/RustGIS#1743)
Add wizard-crs-after-environments screenshot (opengeos/RustGIS#1743)
fix(engine): the environment's system is cleared only on purpose, and…
fix(engine): the environment keeps its own boxes, and every name for …
fix(engine): degrees by name, no geocentric grid, and a system code t…
fix(engine): a project's environment holds only what gp.env takes, an…
fix(engine): an empty crs keeps the environment's system, and the pan…
fix(ui): the Wizard's cell size follows the system it will use, and E…
feat(engine): the Geostatistical Wizard and the environment take a pr…
Mavrick-F commentedon Nov 12, 2026
A follow-up question from the review of #1813 (raised by @flight1973): with interpolations now defaulting to the layer's projected system, the environment (
gp.env) can set a projected system but cannot ask for degrees for every run. Today only a run's owncrs: "EPSG:4326"does that. Supporting it would mean a new value in the project file's environment, which is the kind of change docs/maintaining.md asks to agree first. Is an environment-wide "degrees" worth adding, or is the per-runcrsenough?feat(analysis): Kriging, IDW and the Geostatistical Wizard default to…
Mavrick-F commentedon Nov 12, 2026
Status: question 1 is settled as option (b) and landed in #1813. Kriging, IDW Interpolation and the Geostatistical Wizard now default to the projected system the layer was read in. They say so, and also name any extent, pixel size, range or cell size given in that system's units.
crs: "EPSG:4326"keeps degrees. Question 2 stands as proposed (tools stay independent of the map), and question 3 landed in #1773. Still open: step 3 (the ortho mosaic), unclaimed, and the environment-wide degrees question above.Mavrick-F commentedon Nov 12, 2026
I'm taking step 3 (the ortho/reality mosaic). Workspaces get an optional projected
crs, stored next to today's degree cell size so older versions still read degrees. Withcrsempty, the mosaic is made in the projected system all its images share, following question 1's answer. It stays in degrees when the images' systems differ or the workspace already has a cell size in degrees, and the run says so.crs: "EPSG:4326"keeps degrees. Pull request to follow.feat(imagery): workspace mosaics are made in their images' projected …
Mavrick-F commentedon Nov 12, 2026
Step 3 landed in #1848: an ortho or reality workspace's mosaic is now made in the projected system its images share, on the finest image's grid, and says so. A workspace can set
crs(a projected system, orEPSG:4326for degrees). Without one, it stays in degrees when its images' systems differ or it has a cell size in degrees, and says why. That completes the plan's three steps. Still open here: whether the environment should be able to ask for degrees for every run (comment above).