# NOT RUN {
library(sf)
##################################
# Example - gisco_get_coastallines
##################################
coastlines <- gisco_get_coastallines()
plot(st_geometry(coastlines), col = "palegreen", border = "lightblue3")
title(
main = "Coastal Lines",
sub = gisco_attributions(),
line = 1
)
###############################
# Example - gisco_get_countries
###############################
sf_world <- gisco_get_countries()
plot(st_geometry(sf_world), col = "seagreen2")
title(sub = gisco_attributions(), line = 1)
sf_africa <- gisco_get_countries(region = "Africa")
plot(st_geometry(sf_africa),
col = c("springgreen4", "darkgoldenrod1", "red2")
)
title(sub = gisco_attributions(), line = 1)
sf_benelux <-
gisco_get_countries(country = c("Belgium", "Netherlands", "Luxembourg"))
plot(st_geometry(sf_benelux),
col = c("grey10", "orange", "deepskyblue2")
)
title(sub = gisco_attributions(), line = 1)
##########################
# Example - gisco_get_nuts
##########################
nuts1 <- gisco_get_nuts(
resolution = "20",
year = "2016",
epsg = "4326",
nuts_level = "1",
country = "ITA"
)
nuts2 <- gisco_get_nuts(
resolution = "20",
year = "2016",
epsg = "4326",
nuts_level = "2",
country = "ITA"
)
nuts3 <- gisco_get_nuts(
resolution = "20",
year = "2016",
epsg = "4326",
nuts_level = "3",
country = "ITA"
)
plot(st_geometry(nuts3),
border = "grey60",
lty = 3
)
plot(st_geometry(nuts2),
lwd = 2,
border = "red2",
add = TRUE
)
plot(st_geometry(nuts1),
lwd = 3,
border = "springgreen4",
add = TRUE
)
box()
title(
main = "NUTS Levels on Italy",
sub = gisco_attributions(),
cex.sub = 0.7,
line = 1
)
legend(
"topright",
legend = c("NUTS 1", "NUTS 2", "NUTS 3"),
col = c("springgreen4", "red2", "grey60"),
lty = c(1, 1, 3),
lwd = c(3, 2, 1),
bty = "n",
y.intersp = 2
)
# }
Run the code above in your browser using DataLab