Returns the raster style registry. Each row names a .qml shipped under
inst/extdata/styles/raster/, and style is the key
rfp_qgs_raster_add() takes.
Value
A tibble with columns:
stylestyle key, used by
rfp_qgs_raster_add()descriptionhuman-readable name
labelshort name used to build a companion layer's name
rendererQGIS renderer the
.qmlcarriescompanionstyle applied as a second layer over the same raster
stretchfrom_data,from_data_p2_98, ornone- howrfp_qgs_raster_add()sets the renderer's range when the caller does not. Which elements that range is written to depends on the renderer, not on this columnsourcepath to the
.qml, relative to the installed package
Details
Adding a style, or restyling one, is a row and a file - never an edit to a
function. That is the same test rfp_form_types() holds itself to.
What is a column and what is not
Only the knobs that vary per project live in the registry or in arguments:
the renderer, whether a companion layer is wanted, how the stretch is
obtained. Everything that decides the look - the ramp, its stops, class
breaks, labels - stays inside the .qml.
The boundary matters because it was crossed once already: gq's registry
models around 20 symbology properties against the 73 a QGIS layer can carry,
and #17 records that patching that gap field-by-field chases a ghost. A
.qml is QGIS's own serialisation and loses nothing.
Pairs are project-only
companion names a second style applied to the same raster as a second
layer - turbo elevation under its hillshade. QGIS reads one foo.qml per
foo.tif, so a pair cannot be delivered as a sidecar; it exists only when a
project is written - rfp_qgs_raster_add(companion = TRUE).
label is the short name that pair is built from: the companion layer is
called "<label> - <name>", so dem_turbo on a layer named Elevation
brings a Hillshade - Elevation. Only a style that appears in some row's
companion needs one; nothing else reads the column, and
name_companion = overrides it.
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_qwc_config_create(),
rfp_raster_style_path()
Examples
rfp_raster_styles()
#> # A tibble: 4 × 7
#> style description label renderer companion stretch source
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 dem_turbo Elevation - turbo ramp Elev… singleb… "dem_hil… from_d… inst/…
#> 2 dem_hillshade Hillshade relief Hill… hillsha… "" none inst/…
#> 3 habitat_lateral Lateral habitat class… Habi… paletted "" none inst/…
#> 4 airphoto_gray Airphoto - greyscale … Airp… singleb… "" from_d… inst/…
rfp_raster_styles("dem_turbo")
#> # A tibble: 1 × 7
#> style description label renderer companion stretch source
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 dem_turbo Elevation - turbo ramp Elevation singleban… dem_hill… from_d… inst/…
# the path to hand to rfp_qgs_raster_add(qml = )
rfp_raster_style_path("dem_hillshade")
#> [1] "/home/runner/work/_temp/Library/rfp/extdata/styles/raster/dem_hillshade.qml"
