Learn R Programming

soilassessment (version 0.3.0)

DataAvailabilityIndex: A function for showing sampling point density map in a geographic area

Description

An index map of density of sampling points in a geographic area

Usage

DataAvailabilityIndex(Boundary, Scale, CP, Data)

Value

A spatial raster map of density of sample locations per unit (specified) area

Arguments

Boundary

a spatial polygon or data frame of coordinates of vertices of a bounding geographic area where data search is intended

Scale

unit area to show spatial density of available sampled points

CP

coordinate projection of the Boundary spatial polygon

Data

input spatial spreadsheet database containing all possible point samples

Author

Christian Thine Omuto

Details

The input spreadsheet database should contain spatial coordinates of available samples. Example input spatial spreadsheet database is the global soil database.The Scale should be provided in area units e.g., 0.5, 1, 20, 30 (square km). Large areas cover more data than small areas. Hence, they take time to process. Coordinate projection (CP) for Boundary polygon should be of formal class crs (coordinate reference system). It's preferrable to provide CP for Boundary area similar to CP for input data

Examples

Run this code
# \donttest{
library(sp)
library(raster)
library(terra)
library(sf)
x <- c(20.02,25.69,25.69,20.02)
y <- c(-28.40,-32.76,-32.76,-34.84)
yx=data.frame(cbind(x, y))
CRs="+proj=longlat +datum=WGS84 +no_defs"
Data=SASglobeData("ph","ZAF")
coordinates(Data)=~Longitude+Latitude
crs(Data)=CRs
Index=DataAvailabilityIndex(yx,60,CRs,Data)
plot(Index)
# }

Run the code above in your browser using DataLab