# NOT RUN {
if (
requireNamespace("png", quietly = TRUE) &&
requireNamespace("raster", quietly = TRUE)
) {
x <- map_fetch(taxonKey = 2480498, year = 2007:2011)
x
# gives a RasterLayer object
class(x)
# visualize
library(raster)
plot(x)
# different srs
## 3857
y <- map_fetch(taxonKey = 2480498, year = 2010, srs = "EPSG:3857")
plot(y)
## 3031
z <- map_fetch(taxonKey = 2480498, year = 2010, srs = "EPSG:3031", verbose = TRUE)
plot(z)
# 3575
z <- map_fetch(taxonKey = 2480498, year = 2010, srs = "EPSG:3575")
plot(z)
# bin
plot(map_fetch(taxonKey = 212, year = 1998, bin = "hex",
hexPerTile = 30, style = "classic-noborder.poly"))
# styles
plot(map_fetch(taxonKey = 2480498, style = "purpleYellow.point"))
# map vector tile, gives back raw bytes
x <- map_fetch(taxonKey = 2480498, year = 2010,
format = ".mvt")
x[1:10]
is.raw(x)
# query with basisOfRecord
map_fetch(taxonKey = 2480498, year = 2010,
basisOfRecord = "HUMAN_OBSERVATION")
map_fetch(taxonKey = 2480498, year = 2010,
basisOfRecord = c("HUMAN_OBSERVATION", "LIVING_SPECIMEN"))
}
# }
Run the code above in your browser using DataLab