Skip to contents

Reports without changing anything, the shape rfp_project_audit() uses. A provider subset is the SQL WHERE clause the OGR provider applies to a layer - what makes one layer show only the coho where another over the same table shows everything.

Usage

rfp_qgs_subset_get(qgs, layer = NULL)

Arguments

qgs

Character. Path to the project .qgs.

layer

Character. A single layer's display name, or NULL (default) for every layer in the project.

Value

With layer, the subset as a string, or NA_character_ when the layer has none. Without, a data frame of layer, id, subset and agrees - one row per <maplayer>, filtered to those carrying a subset.

Details

Reading is deliberately permissive: it returns whatever the project has, including the double-quoted-literal form that rfp_qgs_subset_set() refuses. A reader that refused what the fleet contains could not report on it.

agrees answers whether the layer's two datasource surfaces carry the same filter. They routinely differ in the path - a tree entry keeps the authoring machine's absolute path where the maplayer has a project-relative one, in 48 of 54 layers in one shipped template - so only the subset= option is compared, and only that is meaningful.

Examples

qgs <- file.path(tempdir(), "subset_get.qgs")
file.copy(system.file("testdata", "raster_add_fixture.qgs", package = "rfp"),
          qgs, overwrite = TRUE)
#> [1] TRUE
rfp_qgs_subset_get(qgs)
#> [1] layer  id     subset agrees
#> <0 rows> (or 0-length row.names)