# NOT RUN {
simulated_data <- data.frame(id = seq(1, 100, 1),
lat = runif(100, 44.04905, 44.17609),
lng = runif(100, -74.01188, -73.83493))
simulated_data <- sf::st_as_sf(simulated_data, coords = c("lng", "lat"))
simulated_data <- sf::st_set_crs(simulated_data, 4326)
output_tiles <- get_tiles(simulated_data,
services = c("ortho"),
resolution = 120)
merged_ortho <- tempfile(fileext = ".tif")
merge_rasters(output_tiles[["ortho"]], merged_ortho)
merged_stack <- raster::stack(merged_ortho)
library(ggplot2)
ggplot() +
geom_spatial_rgb(data = merged_ortho,
mapping = aes(x = x,
y = y,
r = red,
g = green,
b = blue)) +
geom_sf(data = simulated_data) +
coord_sf(crs = 4326)
ggplot() +
geom_spatial_rgb(data = merged_stack,
mapping = aes(x = x,
y = y,
r = red,
g = green,
b = blue)) +
geom_sf(data = simulated_data) +
coord_sf(crs = 4326)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab