Add two buffers on a map to assess the area of same land cover type.
Arguments
- g
A ggplot objects on which to add the buffer
- box
A SpatExtent to get the box extent and centre point
- buf1
A distance in metre representing the inner buffer radius
- buf2
A distance in metre representing the outer buffer radius
- nx
A number defining the grid interval in metre for x and y
- n
A number to set the border of the grid from the edge of the plot
Examples
# Get station metadata
stn <- get_metadata_frost(stationid = 18700)
# Get coordinates and define boundary box
centre <- terra::crds(stn)
box <- make_bbox(centre, 1600)
# Plot map tile
g <- plot_tile_station(stn, box, tile_name = "ortofoto")
#> Error in png::readPNG(resp): libpng error: Not a PNG file
# Add grid and buffer
nx <- 200
n <- 2
g <- add_grid(g, box, nx, n)
#> Error: object 'g' not found
g <- add_buffer(g, centre, 300, 1000, nx, n)
#> Error: object 'g' not found
g
#> Error: object 'g' not found