Write a qwc_config.csv file for QWC2 web map viewer deployment. The CSV
is consumed by rtj's qwc_project-add.sh to build the themesConfig entry.
Usage
rfp_qgs_themes_config(
path,
theme_keep = NULL,
theme_initial = NULL,
theme_locked = NULL,
bbox_file = "background_layers.gpkg",
bbox_layer = "whse_basemapping.fwa_watershed_groups_poly",
bbox_override = NULL,
url_suffix = NULL,
project_title = NULL,
path_out = NULL
)Arguments
- path
Character. Path to a
.qgsproject file.- theme_keep
Character vector. Theme names to expose in QWC2 (others are blacklisted). If
NULL(default), all themes are exposed.- theme_initial
Character. Default theme to show on open. If
NULL, QWC2 uses default layer visibility.- theme_locked
Character. Single theme name to lock as the active visibility preset on deployment. If
NULL(default), no lock applied. Applied by the VM-side patcher, not written back to the.qgs.- bbox_file
Character. File for bounding box computation. Default
"background_layers.gpkg".- bbox_layer
Character. Layer in
bbox_filefor extent. Default"whse_basemapping.fwa_watershed_groups_poly".- bbox_override
Character. Explicit bbox in the form
"xmin,ymin,xmax,ymax,EPSG:code". When non-NULL, wins overbbox_file/bbox_layeron the VM side. Always emitted as a CSV row (empty value when NULL) so the schema is stable across projects.- url_suffix
Character. URL path segment for the project. Default derived from project name (underscores to hyphens).
- project_title
Character. Display title. Default derived from project name.
- path_out
Character. Output CSV path. Default writes
qwc_config.csvin the same directory as the.qgsfile.
Details
Parameters are grouped into families: theme_* (keep/initial/locked),
bbox_* (file/layer/override), and project-level (project_title,
url_suffix). All except path are optional — sensible defaults are
derived from the project name.
See also
Other qgs:
rfp_qgs_theme_apply(),
rfp_qgs_theme_export(),
rfp_qgs_themes()
Examples
if (FALSE) { # \dontrun{
# Generate config with defaults
rfp_qgs_themes_config("~/Projects/gis/restoration_wedzin_kwa/restoration_wedzin_kwa.qgs")
# Expose only specific themes, lock one, override bbox
rfp_qgs_themes_config(
"restoration_wedzin_kwa.qgs",
theme_keep = c("Overview", "Floodplain"),
theme_initial = "Overview",
theme_locked = "Floodplain",
bbox_override = "941471,1041241,998356,1061896,EPSG:3005",
project_title = "Wedzin Kwa Restoration"
)
} # }
