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

tiles_ide_uy(x, format = "jpg", folder = tempdir(), urban = FALSE)

Arguments

x

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

format

Format of the archives to download (avaiable: "jpg" and "tif") Default "jpg"

folder

Folder where are the files or be download

urban

If format is "tif", and urban default 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

terra::SpatRaster object of the cropped .tif corresponding to x bbox or a raster::RasterBrick of the cropped .jpg corresponding to x bbox

Examples

# \donttest{ hom <- data.frame(x = c(-56.14449, -56.14267), y = c(-34.805237, -34.80653)) hom2 <- sf::st_as_sf(hom, coords = c("x","y"), crs = 4326) x_tiles <- tiles_ide_uy(x = hom2, format = "jpg", urban = TRUE)
#> Warning: 'C:\Users\Usuario\AppData\Local\Temp\Rtmpyio2yM' already exists
#> 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...
#> Warning: cannot open URL 'https://visualizador.ide.uy/descargas/CU_Remesa_01/02_Ortoimagenes/01_Ciudad_MVD/03_RGB_8bits/J29A4M8_RGB_8_Remesa_01_MVD.jpg': HTTP status was '403 Forbidden'
#> Warning: cannot open URL 'https://visualizador.ide.uy/descargas/CU_Remesa_01/02_Ortoimagenes/01_Ciudad_MVD/03_RGB_8bits/J29A4M8_RGB_8_Remesa_01_MVD.jgw': HTTP status was '403 Forbidden'
#> Error in utils::download.file(glue::glue("{a[i]}{c('.jpg','.jgw')}"), : #> cannot download any files
#> Error in if (x == "" | x == ".") { stop("provide a valid filename")}: valor ausente donde TRUE/FALSE es necesario
# }