This function allows to Download .jpg or .tif files from the IDEuy tiles repository, according to a 'sf' object bbox.

tiles_geouy(x, d = NA, format = "rgb", folder = tempdir(), urban = FALSE)

Arguments

x

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

d

numeric; buffer distance for all, or for each of the elements in x; in case dist is a units object, it should be convertible to arc_degree if x has geographic coordinates, and to st_crs(x)$units otherwise. Default NA, but if x is a only one point buffer default is 100.

format

Format of the archives to download (avaiable: "rgb" and "rgbi") Default "rgb"

folder

Folder where are the files or be download

urban

logical; If FALSE take orthophotos of national flight with 32cm per pixel, if TRUE take urban flight with 10cm per pixel (avaible only Montevideo at the moment)

Value

raster::stack object with th cropped tif corresponding to x bbox

Examples

# \donttest{ x <- data.frame(x = 577968, y = 6147753, id = 1) x <- sf::st_as_sf(x, coords = c("x", "y"), crs = 32721) x_tiles <- tiles_geouy(x, urban = T)
#> Reading layer `grilla_urbana' from data source `https://mapas.ide.uy/geoserver-raster/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ortofotos:grilla_urbana' using driver `GML' #> Simple feature collection with 2753 features and 5 fields #> geometry type: MULTIPOLYGON #> dimension: XY #> bbox: xmin: -58.43 ymin: -34.98 xmax: -53.36 ymax: -30.24 #> geographic CRS: SIRGAS-ROU98
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> Trying to download...
# }