
Generate QWC2 Config CSV for a QGIS Project
Source:R/rfp_qwc_config_create.R
rfp_qwc_config_create.RdWrite 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_qwc_config_create(
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_form_add(),
rfp_qgs_layer_rm(),
rfp_qgs_preview_set(),
rfp_qgs_raster_add(),
rfp_qgs_service_add(),
rfp_qgs_service_rm(),
rfp_qgs_services(),
rfp_qgs_style_export(),
rfp_qgs_style_set(),
rfp_qgs_subset_get(),
rfp_qgs_subset_set(),
rfp_qgs_theme_add(),
rfp_qgs_theme_lookup(),
rfp_qgs_theme_names(),
rfp_qgs_theme_rm(),
rfp_qgs_theme_set(),
rfp_qgs_theme_unbury(),
rfp_qgs_themes(),
rfp_qgs_vector_add(),
rfp_raster_style_path(),
rfp_raster_styles()
Examples
if (FALSE) { # \dontrun{
# Generate config with defaults
rfp_qwc_config_create("~/Projects/gis/restoration_wedzin_kwa/restoration_wedzin_kwa.qgs")
# Expose only specific themes, lock one, override bbox
rfp_qwc_config_create(
"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"
)
} # }