stratified_packager.processing.virtual

Virtual-layer routing: materialize into the stratum gpkg vs. keep live (SPEC §4/§13).

A virtual provider layer is either materialized into its own packaged table (behaving like any packaged vector) or kept live in the embedded project — re-pointed at this stratum’s gpkg tables — when every source it queries is already packaged. Runs on the algorithm thread during Phase A layer classification.

Functions

route_virtual_layers(virtuals, vectors, ...)

Route virtual layers to packaged vectors (materialize) or embedded-only (live) (§4/§13).

stratified_packager.processing.virtual._virtual_should_materialize(layer, packaged_ids, packaged_keys, feedback)[source]

Decide whether a virtual layer is materialized vs. kept live (SPEC §4/§13).

The materialize_virtual_layer variable forces materialization when true. Otherwise the layer is kept live only when every source it queries is already packaged into the stratum gpkg (referenced by id to a packaged layer, or an embedded source normalizing to a packaged layer’s source); any uncovered source would require adding new data, so the layer is materialized and an info message is pushed.

Parameters:
Return type:

bool

Returns:

True to materialize (route to packaged vectors), False to keep the layer live (route to embedded-only).

Raises:

qgis.core.QgsProcessingException – If the materialize_virtual_layer value cannot be coerced to bool (the §6 strict regime).

stratified_packager.processing.virtual.route_virtual_layers(virtuals, vectors, payloads, embedded, feedback)[source]

Route virtual layers to packaged vectors (materialize) or embedded-only (live) (§4/§13).

Mutates vectors / embedded in place; the coverage set is the already-classified packaged layers.

Parameters:
Return type:

None