stations: Numeric matrix of length two, x- and y-coordinates of the seismic stations to be processed (column-wise orgnaised).The coordinates must be in metric units, such as the UTM system and match with the reference system of the dem.
dem: SpatRaster object, the digital elevation model (DEM) to be processed. The DEM must be in metric units, such as the UTM system and match with the reference system of the coordinates of stations. See terra for supported types and how to read these to R.
topography: Logical scalar, option to enable topography correction, default is TRUE.
maps: Logical scalar, option to enable/disable calculation of distance maps. Default is TRUE.
matrix: Logical scalar, option to enable/disable calculation of interstation distances. Default is TRUE.
aoi: Numeric vector of length four, bounding coordinates of the area of interest to process, in the form c(x0, x1, y0, y1).
verbose: Logical value, option to show extended function information as the function is running. Default is FALSE.
Returns
List object with distance maps (list of SpatRaster objects from terra package) and station distance matrix (data.frame).
Details
Topography correction is necessary because seismic waves can only travel on the direct path as long as they are within solid matter. When the direct path is through air, the wave can only travel along the surface of the landscape. The function accounts for this effect and returns the corrected travel distance data set.
Examples
## Not run:data("volcano")dem <- terra::rast(volcano)dem <- dem *10terra::ext(dem)<- terra::ext(dem)*10terra::ext(dem)<-terra::ext(dem)+ c(510,510,510,510)## define example stationsstations <- cbind(c(200,700), c(220,700))## plot example dataterra::plot(dem)points(stations[,1], stations[,2])## calculate distance matrices and stations distancesD <- spatial_distance(stations = stations, dem = dem)D_map_1 <- terra::rast(crs = D$maps[[1]]$crs, ext = D$maps[[1]]$ext, res = D$maps[[1]]$res, val = D$maps[[1]]$val)## plot distance mapterra::plot(D_map_1)## show station distance matrixprint(D$matrix)## calculate with AOI and in verbose modeD <- spatial_distance(stations = stations, dem = dem, verbose =TRUE, aoi = c(0,200,0,200))## plot distance map for station 2terra::plot(D$maps[[1]])## End(Not run)