This function allows to add to an 'sf' object its spatial coincidence with one or more administrative units in Uruguay, generating the corresponding variables.

which_uy(x, c = c("Localidades pg", "Departamentos"), d = c("cod", "name"))

Arguments

x

An 'sf' object with the same crs as the homonym parameter

c

Define the geometries to download: may be: "Departamentos", "Secciones", "Zonas", etc. View(metadata) for details.

d

A vector who determines the variables to be added, with three options: "cod", "name", or "full". Default c("cod", "name").

Value

sf object with the x geometries, with d variables requested from c added

See also

Examples

# \donttest{
x <- load_geouy("Peajes")
#> Reading layer `peajes' from data source 
#>   `https://geoservicios.mtop.gub.uy/geoserver/inf_tte_ttelog_terrestre/peajes/ows?service=WFS&request=GetFeature&typeName=peajes' 
#>   using driver `GML'
#> Simple feature collection with 18 features and 4 fields
#> Geometry type: MULTIPOINT
#> Dimension:     XY
#> Bounding box:  xmin: -58.24649 ymin: -34.78446 xmax: -54.42373 ymax: -31.54664
#> Geodetic CRS:  WGS 84
x1 <- which_uy(x, c = "Deptos")
#> Reading layer `ine_depto' from data source 
#>   `C:\Users\Usuario\AppData\Local\Temp\RtmponKV2U\ine_depto.shp' 
#>   using driver `ESRI Shapefile'
#> Simple feature collection with 20 features and 6 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 366582.2 ymin: 6127919 xmax: 858252.1 ymax: 6671738
#> Projected CRS: WGS 84 / UTM zone 21S
# }