A collection of geoscience based sampling tools.
R 3.4 (later versions should be fine)
Required packages will be installed automatically, if not found. Nevertheless, run this command in R to install prerequisites:
install.packages(c("raster","clhs","rgdal","moments","rgeos","BalancedSampling"))
Also, see Run_NCI.sh for NCI support.
Configurations are stored in "Run_Scripts.R" file. So, first make your changes (e.g. change the input pathes to your choice).
Currently the following functionalities are supported:
To see a demo of extracting raster cells that are touched by a road, run
source("WHERE YOU HAVE STORED THIS REPOSITORY/geo-sampling/Extract_demo_ex1.R", chdir = TRUE)
To see a demo of extracting raster cells that are located within a margin around roads, run
source("WHERE YOU HAVE STORED THIS REPOSITORY/geo-sampling/Extract_demo_ex2.R", chdir = TRUE)
conditioned Latin Hypercube Sampling (cLHS)
- To extract a handful of points at the target locations, or
- To first extract points around given a buffer size and then extract a handful of points,
source("WHERE YOU HAVE STORED THIS REPOSITORY/geo-sampling/Run_Scripts.R", chdir = TRUE)
Check the output folder for results (new shapefile, statistics, etc).