…eos#882, second part)
A QGIS layout's atlas becomes a map series on each page with a map
following it: that page's first such map steps through the coverage
layer as it came in, at the atlas map's margin, its pages named by the
field the page name expression names. Atlas tokens print the series'
page there. Filters, sorts, a hidden coverage layer, file name patterns,
fixed or predefined scales, points, margins a series can't take,
clipping and further maps are noted; an atlas a series can't be made of
is left out, noted, with the texts printing its page.
A map series' page now pads a feature by its margin alone; the 0.01°
floor stays for a lone point (small features were lost in a kilometre
around them). A 44th generated project in the corpus.
Summary
Piece 12c of #882, second part, which completes piece 12.
project.importQgisnow brings in a QGIS print layout's atlas as a map series. Until now an atlas was only noted.AtlasMap atlasDriven="1"), the first such map in QGIS's drawing order becomes the frame of that page's map series. Each page of a QGIS layout is a RustGIS layout, so an atlas over several pages gives each of them a series.layout.seriesPageshows it.FIT_MARGIN), so the margin is converted: QGIS's default 10% becomes a series margin of 0.@atlas_pagename,@atlas_featurenumberand@atlas_totalfeaturesbecome{pageName},{page}and{pages}on a page with the series.@layout_pageand@layout_numpagesthere print the layout's own page, as QGIS does (1 of 1 on a one-page layout), since{page}counts the series' features.A change to map series
layout.seriesPage(and the series' pages in an export) padded every feature by at least 0.01° on each side, about 1 km. Any feature much smaller than that, such as a parcel or the corpus's 150 m polygons, was lost in the middle of its frame. The floor now applies only to a lone point, which has no size to take a margin of. Every other feature is padded by its margin alone (rustgis_map::layout::series_extent, used by both paths). Saved frames don't move until a page is stepped or exported, but a re-exported series of small features is framed more tightly. The user guide's map series section says so.Reach
project.importQgis. Its parameters and answer are unchanged. The series commands are unchanged apart from the padding above.layout.serieslike any other.No code from other projects was followed. QGIS's file format was read from files QGIS wrote, and its behaviour from its exports and from PyQGIS probes, not from its source.
Known, not handled
Testing
crates/map/src/qgis/layout_atlas_tests.rs, 8 tests, both ways: the corpus atlas with nothing said; an unnamed atlas and the layout's own page; every setting a series has no place for, said once; atlases left out (unknown layer, no map following, switched off); atlas tokens on a page without its map; the margin conversion; a margin that doesn't read; the first page of an atlas over two pages.crates/engine/src/tests/qgis_atlas.rs, 6 tests:layout.seriesPageframes it, stepping and exporting;layout.seriesPageframing a small polygon by its margin alone and a point with 0.01°.crates/map/src/layout/tests.rs:series_extent, both cases.layout-atlas.qgs, written by QGIS 4.4.0 fromgenerate.py.cargo fmt;-D warningson map and engine;cog_windows_stand_in_the_level_kept_until_their_tiles_arrive, which is flaky and fails without this change too;test-hygiene,rows;UI evidence
New UI (after only). The corpus's atlas layout as RustGIS exports it after the import, page 1:
Page 5, after
layout.seriesPage:QGIS 4.4.0's own export of page 1, for comparison:
Related issue
Part of #882 (piece 12c, second part; completes piece 12).
Summary by CodeRabbit