Skip to contents

Extract one or more visibility presets (map themes) from a .qgs file as a portable XML document. Layer references — which in QGIS are mangled UUID-suffixed ids that differ between projects — are rewritten to the human-readable layer names, so the exported file can be applied to a destination project where the same layer names exist with different ids.

Usage

rfp_qgs_theme_export(path, themes = NULL, path_out = NULL)

Arguments

path

Character. Path to a source .qgs project file.

themes

Character vector of theme names to export. If NULL (default), all themes in the project are exported.

path_out

Character. Output XML path. Default writes <path>_themes.xml alongside the source.

Value

Invisible character — the path to the written XML.

Details

Pairs with rfp_qgs_theme_apply(). See rfp_qgs_themes() to list the themes available in a project.

Examples

if (FALSE) { # \dontrun{
# Export every theme
rfp_qgs_theme_export("~/Projects/gis/restoration_wedzin_kwa.qgs")

# Export only specific themes
rfp_qgs_theme_export(
  "restoration_wedzin_kwa.qgs",
  themes = c("Floodplain", "Overview")
)
} # }