# NOT RUN {
library(raster)
library(sf)
library(slga)
# concept demo
plot(sf::st_buffer(sf::st_point(c(0,0)), 5), axes = TRUE, reset = FALSE)
plot(raster::raster(slga:::make_circ_mask(5),
xmn = -5, xmx = 5, ymn = -5, ymx = 5), add = TRUE, legend = FALSE)
# test with real data
poi <- c(152, -27)
aoi <- slga:::validate_poi(poi = poi, product = 'SLPPC', buff = 5)
slope <- get_lscape_data('SLPPC', aoi)
plot(slope)
masker <- raster(slope)
masker[] <- slga:::make_circ_mask(5)
slope <- slope + masker
plot(slope)
plot(sf::st_point(poi), add = TRUE, pch = 19, col = 'red')
# note: if sf_use_s2 = TRUE, this buffer distance will be Small.
plot(sf::st_buffer(sf::st_centroid(sf::st_as_sfc(aoi)),
0.000833 * 5), add = TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab