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
2 changes: 1 addition & 1 deletion ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ of use.
| Sample data (`countries`, `cities`, `rivers`, `lakes` GeoJSON), embedded at build time from [rustgis-assets](https://github.com/opengeos/rustgis-assets/tree/main/data) | Natural Earth 1:110m, attributes trimmed | Public domain |
| Worldviews (`countries_<code>.geojson` and `original/countries_<code>.geojson.gz` on [source.coop](https://source.coop/opengeos/data/rustgis/worldviews)), downloaded by the app when one is chosen, not part of it | Natural Earth's Admin 0 Countries (1:10m) and its points of view, with the sample countries' attributes by `scripts/worldviews.py` in [rustgis-assets](https://github.com/opengeos/rustgis-assets): simplified to 1:110m density, or at their original detail | Public domain |
| QGIS screenshot (`qgis-world-atlas.webp` in [rustgis-assets](https://github.com/opengeos/rustgis-assets/tree/main/images)), on the [RustGIS and QGIS](docs/comparison/qgis.md) page | Taken by the RustGIS project: [QGIS](https://qgis.org) 4.2 showing the Natural Earth sample data above | QGIS is GPL-2.0-or-later; the data is public domain |
| QGIS test corpus (`crates/map/testdata/qgis/generated/`: styles, projects and their sample data) | Dominik Strebel ([@pick2510](https://github.com/pick2510)) for the RustGIS project: written by [QGIS](https://qgis.org) 4.2.3 through its API, from `generate.py` there; the raster image marker styles and their two images (`marker.png`, `marker.jpg`) added the same way by the RustGIS project; the data is made up | Apache-2.0 |
| QGIS test corpus (`crates/map/testdata/qgis/generated/`: styles, projects and their sample data) | Dominik Strebel ([@pick2510](https://github.com/pick2510)) for the RustGIS project: written by [QGIS](https://qgis.org) 4.2.3 through its API, from `generate.py` there; the raster image marker styles and their two images (`marker.png`, `marker.jpg`) added the same way by the RustGIS project, as were the SVG marker styles and project (QGIS 4.4.0) and their two SVGs (`icon.svg`, `marker.svg`, written by `generate.py` itself); the data is made up | Apache-2.0 |
| CFF test font (`crates/render/testdata/test-cff.otf`), read only by the PDF font tests | The RustGIS project: generated for this test with [fontTools](https://github.com/fonttools/fonttools) by the script in `crates/render/testdata/README.md`; its glyphs are made up | Apache-2.0 |
| Script-only and fallback test fonts (`crates/render/testdata/test-script-only.otf`, `crates/render/testdata/test-fallback.otf`, `crates/render/testdata/test-latin-catalog.otf`) | The RustGIS project: original square outlines and script cmap variants ([generation](crates/render/testdata/README.md)) | Apache-2.0 |
| JAXA Earth catalog test copy (`crates/tiles/tests/data/jaxa_catalog.v2.md`), read only by tests | JAXA: the [JAXA Earth API](https://data.earth.jaxa.jp/) dataset catalog ([catalog.v2.md](https://data.earth.jaxa.jp/app/mcp/catalog.v2.md)), copied on 2026-11-08 | JAXA's [terms of use](https://earth.jaxa.jp/en/data/policy/): free to use and redistribute, with credit to JAXA |
Expand Down
17 changes: 14 additions & 3 deletions crates/map/src/qgis/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ fn every_corpus_file_reads() {
};
// Pin the corpus sizes so a regeneration cannot silently drop fixtures.
let styles = files("generated/qml", &["qml"]);
assert_eq!(styles.len(), 110, "style corpus changed: {styles:?}");
assert_eq!(styles.len(), 126, "style corpus changed: {styles:?}");
// Raster image markers' files are found from the style's folder and the project's.
let mut read = |source: &str| {
use base64::Engine;
Expand All @@ -1126,17 +1126,28 @@ fn every_corpus_file_reads() {
let dir = path.parent().unwrap().to_string_lossy().to_string();
let mut report = Report::default();
super::read_style(&text, "layer", &dir, &mut read, &mut report).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
if path.to_string_lossy().contains("symbol-raster-marker-") {
// By the file's name: the checkout's own folders may contain anything.
let name = path.file_name().unwrap().to_string_lossy();
if name.starts_with("symbol-raster-marker-") {
assert!(
!report.notes.iter().any(|n| n.text.starts_with("raster image markers whose")),
"{}: {:?}",
path.display(),
report.notes
);
}
// Until the importer reads SVG markers (#2266 part E2a), which changes this on purpose.
if name.starts_with("symbol-svg-marker-") {
assert!(
report.notes.iter().any(|n| n.text.starts_with("SVG markers, drawn as circles")),
"{}: {:?}",
path.display(),
report.notes
);
}
}
let projects = files("generated/qgs", &["qgs", "qgz"]);
assert_eq!(projects.len(), 37, "project corpus changed: {projects:?}");
assert_eq!(projects.len(), 38, "project corpus changed: {projects:?}");
for path in &projects {
let bytes = std::fs::read(path).unwrap();
let text = if path.extension().is_some_and(|e| e == "qgz") {
Expand Down
17 changes: 10 additions & 7 deletions crates/map/testdata/qgis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ no specification of these formats, so the corpus stands in for one: `every_corpu

| Folder | What | Licence |
|---|---|---|
| `generated/qml/` | 110 styles written by QGIS 4.2.3 through its API, each varying one thing: every symbol layer type with its defaults, raster image markers (a PNG and a JPEG, in a file and embedded; sizes in each unit, rotation, an offset, anchor points, a fixed aspect ratio, opacity, and along a line), every renderer (categorized and graduated by expression, rule-based with nested and else rules), every paint effect, data-defined size, angle and colour, labels (every placement, buffer, background, shadow, font, wrap, expression text, offsets, data-defined settings, scale ranges, curved labels, each callout, rule-based labels), layer settings (opacity, blend mode, scale range, reference scale, subset), diagrams (pie, by fields and expressions, a histogram, a stacked bar and a text diagram, two of them sized between two values) and raster renderers (grey, pseudocolour interpolated, discrete and exact, multiband, paletted, hillshade, contour) | Apache-2.0, like RustGIS: made by Dominik Strebel ([@pick2510](https://github.com/pick2510)) for the RustGIS project |
| `generated/qgs/` | 37 projects: one per provider (OGR, GDAL, memory, delimited text by x/y and WKT, SpatiaLite, virtual (on a file, on another layer, and grouping), WMS, WMTS, XYZ, raster MBTiles, WFS (also with a filter), OGC API Features, WCS, ArcGIS feature, map, image and vector tile services, vector tiles by address, with a MapLibre style, from MBTiles and from PMTiles, PostGIS, SQL Server, GPX waypoints and tracks); project structure (groups, a mutually exclusive group, a map theme, a bookmark, a variable, a relation, a join, a virtual field, time from a field, two styles on a layer); groups nested, hidden, collapsed, empty and drawn as one (a group layer with its opacity and blending); bookmarks (turned, in a group, in degrees), relations (on one pair of fields, on two, a composition, a polymorphic one) and time settings (a span of months; time from a field, from a field for a duration, a fixed range); a layout with every item and an atlas; the annotation layer with every item; annotations with their settings (styled marks, lines and a polygon with a hole, text aligned, turned, in HTML and with a buffer, rectangle text with a background and frame or of a fixed size, a picture file and an SVG, text along a line, one switched off, z order, the main annotation layer); `all-styles.qgz`, every style above on its own layer (written before the diagrams were added); `raster-markers.qgs`, each raster image marker style on its own layer, its image files named relative to it | Apache-2.0 |
| `generated/data/` | The data those files use: `sample.gpkg` (layers `points`, `lines` and `polygons`, 9 made-up features each, fields `id`, `name`, `kind`, `value`, `angle`, `day`), `dem.tif` (3 bands of a linear surface), two CSVs, a GPX file, `picture.png` (a red 40 × 20 picture), `marker.png` (32 × 16, a red square and a blue bar) and `marker.jpg` (24 × 24, green with a yellow corner), the raster image markers' images | Apache-2.0 |
| `generated/qml/` | 126 styles written through QGIS's API (4.2.3; the SVG marker ones 4.4.0), each varying one thing: every symbol layer type with its defaults, raster image markers (a PNG and a JPEG, in a file and embedded; sizes in each unit, rotation, an offset, anchor points, a fixed aspect ratio, opacity, and along a line), SVG markers (an SVG with `param(…)` colours and outline width and one without, in a file and embedded, one from QGIS's own library, which isn't copied here; colours with alpha; sizes in each unit, rotation, an offset, anchor points, a fixed aspect ratio, opacity, and along a line), every renderer (categorized and graduated by expression, rule-based with nested and else rules), every paint effect, data-defined size, angle and colour, labels (every placement, buffer, background, shadow, font, wrap, expression text, offsets, data-defined settings, scale ranges, curved labels, each callout, rule-based labels), layer settings (opacity, blend mode, scale range, reference scale, subset), diagrams (pie, by fields and expressions, a histogram, a stacked bar and a text diagram, two of them sized between two values) and raster renderers (grey, pseudocolour interpolated, discrete and exact, multiband, paletted, hillshade, contour) | Apache-2.0, like RustGIS: made by Dominik Strebel ([@pick2510](https://github.com/pick2510)) for the RustGIS project |
| `generated/qgs/` | 38 projects: one per provider (OGR, GDAL, memory, delimited text by x/y and WKT, SpatiaLite, virtual (on a file, on another layer, and grouping), WMS, WMTS, XYZ, raster MBTiles, WFS (also with a filter), OGC API Features, WCS, ArcGIS feature, map, image and vector tile services, vector tiles by address, with a MapLibre style, from MBTiles and from PMTiles, PostGIS, SQL Server, GPX waypoints and tracks); project structure (groups, a mutually exclusive group, a map theme, a bookmark, a variable, a relation, a join, a virtual field, time from a field, two styles on a layer); groups nested, hidden, collapsed, empty and drawn as one (a group layer with its opacity and blending); bookmarks (turned, in a group, in degrees), relations (on one pair of fields, on two, a composition, a polymorphic one) and time settings (a span of months; time from a field, from a field for a duration, a fixed range); a layout with every item and an atlas; the annotation layer with every item; annotations with their settings (styled marks, lines and a polygon with a hole, text aligned, turned, in HTML and with a buffer, rectangle text with a background and frame or of a fixed size, a picture file and an SVG, text along a line, one switched off, z order, the main annotation layer); `all-styles.qgz`, every style above on its own layer (written before the diagrams were added); `raster-markers.qgs`, each raster image marker style on its own layer, its image files named relative to it; `svg-markers.qgs`, the same for each SVG marker style, written by QGIS 4.4.0 | Apache-2.0 |
| `generated/data/` | The data those files use: `sample.gpkg` (layers `points`, `lines` and `polygons`, 9 made-up features each, fields `id`, `name`, `kind`, `value`, `angle`, `day`), `dem.tif` (3 bands of a linear surface), two CSVs, a GPX file, `picture.png` (a red 40 × 20 picture), `marker.png` (32 × 16, a red square and a blue bar) and `marker.jpg` (24 × 24, green with a yellow corner), the raster image markers' images; `icon.svg` (the same square and bar) and `marker.svg` (a triangle and a rectangle in `param(…)` colours), the SVG markers' images | Apache-2.0 |
| `generated/generate.py`, `scrub.py` | The generator, and the step that removes the user's name and absolute paths from what QGIS writes | Apache-2.0 |
| `generated/types.txt` | The element types QGIS 4.2.3 knows (symbol layers, renderers, providers, label placements, callouts, annotation and layout items, paint effects): the checklist the corpus was made from. A few have no file yet: the single-colour raster renderer, and the text table, fixed table, elevation profile and chart layout items | Apache-2.0 |

Expand All @@ -36,7 +36,10 @@ no specification of these formats, so the corpus stands in for one: `every_corpu

## Regenerating

QGIS 4.2.3 (here the Flathub Flatpak, whose `/tmp` is private, so it writes under `~/.cache`):
QGIS 4.2.3 wrote the corpus, and 4.4.0 the SVG marker files. The command runs whichever QGIS is
installed (here the Flathub Flatpak, whose `/tmp` is private, so it writes under `~/.cache`) and
writes the whole corpus again, so copy only the files you mean to replace: for the SVG markers,
`data/icon.svg`, `data/marker.svg`, `qml/symbol-svg-marker-*.qml` and `qgs/svg-markers.qgs`.

```sh
mkdir -p ~/.cache/qgis-corpus
Expand All @@ -46,6 +49,6 @@ flatpak run --env=PYTHONPATH=/app/share/qgis/python --env=QT_QPA_PLATFORM=offscr

It writes `data/`, `qml/`, `qgs/`, `types.txt` and `log.txt` (what was written, and what this
QGIS couldn't write) into the output folder, then runs `scrub.py` on the projects. QGIS may crash
on exit, after writing everything. Copy the files here without `log.txt`, `sample.sqlite`,
`dem.tif.aux.xml`, `all-styles.qgs` (the `.qgz` holds it) and the `_attachments.zip` files QGIS
writes beside each project.
on exit, after writing everything. When replacing the whole corpus, copy the files here without
`log.txt`, `sample.sqlite`, `dem.tif.aux.xml`, `all-styles.qgs` (the `.qgz` holds it) and the
`_attachments.zip` files QGIS writes beside each project.
4 changes: 4 additions & 0 deletions crates/map/testdata/qgis/generated/data/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions crates/map/testdata/qgis/generated/data/marker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading