Skip to contents

Retrieve the legend graphic for a WMS layer

Usage

argentum_wms_legend(x, layer, style = NULL, format = "image/png")

Arguments

x

An organization name from argentum_organizations(), or a WMS URL.

layer

A single layer name.

style

Optional named style, or one per layer.

format

MIME type to request. NULL (default) negotiates one from the formats the service advertises for GetMap, preferring PNG, which keeps transparency. Pass a value such as "image/jpeg" to force it.

Value

A terra::SpatRaster holding the legend image (no CRS: it is a picture, not a map).

Examples

# \donttest{
argentum_wms_legend("https://wms.ign.gob.ar/geoserver/ows", "ign:provincia")
#> Warning: [rast] unknown extent
#> class       : SpatRaster
#> size        : 20, 20, 3  (nrow, ncol, nlyr)
#> resolution  : 1, 1  (x, y)
#> extent      : 0, 20, 0, 20  (xmin, xmax, ymin, ymax)
#> coord. ref. : 
#> source      : argentum_legend_1da52f248541.png
#> colors rgb  : 1, 2, 3
#> names       : argentum_l~2f248541_1, argentum_l~2f248541_2, argentum_l~2f248541_3
# }