[Feature]: A credit on every layer, listed as a publication layout's sources when none are given
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with crates/engine/src/cmd/layout.rs around line 1223 and ribbon.rs around line 1108, then trace rustgis_map::Layer and how layer data and project state are saved. The issue also calls out layer.addData, layer.credit, Layer Properties, file metadata, and layer-producing tools as entry points. Done means credits survive those paths and Publication Layout uses visible layer credits by default, with the specified overrides and warning; the listed tests should cover these cases.
Written by the indexing model from the issue text.
Description
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
What problem does this solve?
A map sheet must say where its data came from. layout.publication has a sources parameter, but when it isn't given the sheet has no sources at all (crates/engine/src/cmd/layout.rs:1223, texts_of(p, "sources")?.unwrap_or_default()). The footer then shows only the cartographic reference. The New Layout menu runs layout.publication with no sources (ribbon.rs ~1108), and nothing could fill them in, because RustGIS has nowhere to keep them:
- Tile layers have an
attribution, which the map draws as a credit. - A cube catalog entry has a
credit(JAXA Earth datasets: "JAXA, "), and it is passed tostac.addCubeas the cube layer's attribution. - A raster or vector layer (
rustgis_map::Layer) has no such field. So the layer thatcube.reducemakes from a JAXA cube, a GeoTIFF or a shapefile opened withlayer.addData, and a layer made by a tool or a plugin all lose where they came from.
The user has to retype the sources for every layout, and a sheet made in one click goes out without them.
Proposed solution
A credit on every layer: one line of text saying where its data came from. Publication Layout lists the credits of the visible layers as the sheet's sources when none are given.
Choices in this proposal
- Field:
credit: StringonLayer, empty by default, saved in the project. An older project opens with all credits empty. - Setting it:
- a
"credit"parameter onlayer.addData; - a new
layer.credit {"layer", "credit"}command, which plugins and scripts can call; - a Credit field in Layer Properties (General or Source tab).
- a
- Filled in automatically:
- A tile layer's credit is its attribution, so nothing new is stored for it.
- A file whose metadata names its source (a GeoTIFF's
TIFFTAG_COPYRIGHT, a GeoPackage's or a STAC item's attribution) gets that as its credit. - A layer made from another one (clip, reproject, resample,
cube.reduce, raster calculator, vector tools) gets its input's credit. With several inputs, it gets their distinct credits joined with "; ".
- Publication Layout:
- When
"sources"isn't given, the sources are the distinct credits of the visible layers, top to bottom, with basemap attributions last. "sources": []still gives none, and given sources are used as they are.- When a visible data layer has no credit, a warning names it, so the user knows the sheet doesn't say where it came from.
- The New Layout menu gets the same sources this way. The sources stay an ordinary text element on the sheet, which the user can edit.
- When
- Tests:
layer.addDatawith a credit, thenlayout.publicationwithout sources, lists it;cube.reducefrom a catalog cube keeps the entry's credit;- a layer with no credit gives the warning;
"sources": []gives no sources.
Alternatives considered
- Sources in the layer's name: this makes long names, which the legend and the colorbar then show.
- Leaving it to plugins: the BrasilData plugin keeps its own sources table and passes
sourcestolayout.publicationitself. Every plugin and script would have to do the same, and data opened by hand would still have none.
Additional context
This came up when a user ran Publication Layout on monthly rainfall from JAXA Earth: the sheet came out with no sources. JAXA's terms ask for a credit on maps using their data, and the cube catalog already knows it.
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 268
- Avg merge
- 11h 1m
- Merged PRs (30d)
- 942
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opengeos/RustGIS
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepPossibly taken @jgregoriorincon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opengeos/RustGIS#2621 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
opengeos/RustGIS#1446 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in opengeos/RustGIS
Similar issues
-
postgresql-rules / queue-rules: implicit KEY SHARE before a parent key update, and job self-overlapOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jonathanong/no-mistakes#3879 ·
Maintainers usually reply within 1 day
-
area:index v0.35.0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
nautechsystems/nautilus_trader#5741 ·
Maintainers usually reply within 1 day
-
RunPlugin derives Hash over all fields while PartialEq compares only location and configurationOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
zellij-org/zellij#5969 ·
Maintainers usually reply within 1 day
-
eth_get_proof reports another account's fields for an absent accountPossibly taken @Indian-boult claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day