Title: | 3D Reconstruction of Archaeological Excavations |
---|---|
Description: | A toolset for 3D reconstruction and analysis of excavations. It provides methods to reconstruct natural and artificial surfaces based on field measurements. This allows to spatially contextualize documented subunits and features. Intended to be part of a 3D visualization workflow. |
Authors: | Clemens Schmid [cre, cph, aut], Benjamin Serbe [aut] |
Maintainer: | Clemens Schmid <[email protected]> |
License: | GPL-2 |
Version: | 0.3.0.9000 |
Built: | 2024-11-02 04:13:38 UTC |
Source: | https://github.com/isaakiel/recexcavaar |
This function transforms local metric coordinates to absolute coordinates of referenced systems by use of a two dimensional four parameter Helmert transformation. This function does not cover the transformation of three dimensional points or transformation between two different datums.
cootrans(pair_matrix, pm_column, data_matrix, dm_column, checking = FALSE, checkplot = TRUE)
cootrans(pair_matrix, pm_column, data_matrix, dm_column, checking = FALSE, checkplot = TRUE)
pair_matrix |
data.frame or matrix with pairs of local and corresponding absolute coordinates (Minimum two!) |
pm_column |
vector with numerical index of the columns in order: local x-value, local y-value, absolute x-value, absolute y-value |
data_matrix |
data.frame with local x- and y-values which schould be transformed. |
dm_column |
vector with numerical index of the columns in order: local x-value, local y-value. |
checking |
boolean switch to turn on the checking ability. Default: FALSE. If TRUE showes combined coordinate plots with indexed points and alters return of function. |
checkplot |
boolean switch to turn off the checking plot. Default: TRUE. Only matters if checking == TRUE. |
Original data.frame with additional columns containing the absolute x- and y-coordinates. In case of 'checking = TRUE' returns pair_matrix data.frame with additional columns of scale and rotation arc in degrees.
coord_data <- data.frame( loc_x = c(1,3,1,3), loc_y = c(1,1,3,3), abs_x = c(107.1,107,104.9,105), abs_y = c(105.1,107,105.1,106.9) ) data_table <- data.frame( x = c(1.5,1.2,1.6,2), y = c(1,5,2.1,2), type = c("flint","flint","pottery","bone") ) new_frame <- cootrans(coord_data, c(1,2,3,4), data_table, c(1,2)) check_data <- cootrans(coord_data, c(1,2,3,4), data_table, c(1,2), checking = TRUE)
coord_data <- data.frame( loc_x = c(1,3,1,3), loc_y = c(1,1,3,3), abs_x = c(107.1,107,104.9,105), abs_y = c(105.1,107,105.1,106.9) ) data_table <- data.frame( x = c(1.5,1.2,1.6,2), y = c(1,5,2.1,2), type = c("flint","flint","pottery","bone") ) new_frame <- cootrans(coord_data, c(1,2,3,4), data_table, c(1,2)) check_data <- cootrans(coord_data, c(1,2,3,4), data_table, c(1,2), checking = TRUE)
Draws a 2D circle on x- and y-plane around a center point in 3D space.
draw_circle(centerx, centery, centerz, radius, resolution = 30L)
draw_circle(centerx, centery, centerz, radius, resolution = 30L)
centerx |
x axis value of circle center point |
centery |
y axis value of circle center point |
centerz |
z axis value of circle center point |
radius |
circle radius |
resolution |
amount of circle points (default = 30) |
data.frame with the spatial coordinates of the resulting points
draw_circle( centerx = 4, centery = 5, centerz = 1, radius = 3, resolution = 20 ) circ <- draw_circle(1,2,3,2) plot(circ$x, circ$y)
draw_circle( centerx = 4, centery = 5, centerz = 1, radius = 3, resolution = 20 ) circ <- draw_circle(1,2,3,2) plot(circ$x, circ$y)
Draws a sphere around a center point in 3D space.
draw_sphere(centerx, centery, centerz, radius, phires = 10L, thetares = 10L)
draw_sphere(centerx, centery, centerz, radius, phires = 10L, thetares = 10L)
centerx |
x axis value of sphere center point |
centery |
y axis value of sphere center point |
centerz |
z axis value of sphere center point |
radius |
sphere radius |
phires |
phi resolution (default = 10) |
thetares |
theta resolution (default = 10) |
data.frame with the spatial coordinates of the resulting points
sphere <- draw_sphere( centerx = 4, centery = 5, centerz = 1, radius = 3, phires = 20, thetares = 20 ) #library(rgl) #plot3d(sphere)
sphere <- draw_sphere( centerx = 4, centery = 5, centerz = 1, radius = 3, phires = 20, thetares = 20 ) #library(rgl) #plot3d(sphere)
A hexahedron is a three dimensional shape that is defined by 6 faces and 8 corner points.
fillhexa
allows to fill such a shape with a regular point raster.
fillhexa(hex, res)
fillhexa(hex, res)
hex |
dataframe with three columns and eight rows to define a hexahedron by its corner point coordinates x, y and z |
res |
numeric value > 0 and <= 1 for the resolution of the point raster |
See https://stackoverflow.com/questions/36115215/filling-a-3d-body-with-a-systematic-point-raster for a description of the function and how it was developed.
data.frame with the spatial coordinates of the resulting points of the grid
hexatestdf <- data.frame( x = c(0,1,0,4,5,5,5,5), y = c(1,1,4,4,1,1,4,4), z = c(4,8,4,9,4,8,4,6) ) cx = fillhexa(hexatestdf, 0.1) #library(rgl) #plot3d( # cx[,1], cx[,2], cx[,3], # type = "p", # xlab = "x", ylab = "y", zlab = "z" #)
hexatestdf <- data.frame( x = c(0,1,0,4,5,5,5,5), y = c(1,1,4,4,1,1,4,4), z = c(4,8,4,9,4,8,4,6) ) cx = fillhexa(hexatestdf, 0.1) #library(rgl) #plot3d( # cx[,1], cx[,2], cx[,3], # type = "p", # xlab = "x", ylab = "y", zlab = "z" #)
kriging
{kriging} is a simple and highly optimized ordinary kriging algorithm to plot
geographical data. This interface to the method allows to not just apply it to one data.frame but
to a list of data.frames. The result is reduced to the data.frame with the predicted values.
For a more detailed output kriging
{kriging} has to be called for the individual input
data.frames.
kriglist(plist, x = 1, y = 2, z = 3, rdup = TRUE, ...)
kriglist(plist, x = 1, y = 2, z = 3, rdup = TRUE, ...)
plist |
List of data.frames with point coordinates |
x |
index of data.frame column with x-axis spatial points. Defaults to 1 |
y |
index of data.frame column with y-axis spatial points. Defaults to 2 |
z |
index of data.frame column with z-axis spatial points. Defaults to 3 |
rdup |
switch to activate removal of double values for single horizontal positions in the input data.frames. Defaults to TRUE |
... |
Arguments to be passed to method |
list with data.frames which contains the predicted values along with the coordinate covariates
df1 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) - 5 ) df2 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) + 5 ) lpoints <- list(df1, df2) surfacelist <- kriglist(lpoints, lags = 3, model = "spherical")
df1 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) - 5 ) df2 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) + 5 ) lpoints <- list(df1, df2) surfacelist <- kriglist(lpoints, lags = 3, model = "spherical")
A dataset containing coordinates of niveau measurements of a fictional excavation KT with 4 spits.
A data frame with 304 rows and 4 variables:
id: IDs of individual measurements with the information about to which level they belong
x: x axis coordinates of measurements
y: y axis coordinates of measurements
z: z axis coordinates of measurements
Other KT_data: KT_squarecorners
,
KT_vessel
A dataset containing horizontal coordinates of corner points of a 1m*1m raster within the rectangular trench (corner points of squares).
A data frame with 63 rows and 2 variables:
x: x axis coordinates of corner points
y: y axis coordinates of corner points
Other KT_data: KT_spits
,
KT_vessel
A dataset containing spatial and contextual information for individual sherds of a single vessel. Some sherds were documented in the field with single find measurements. For the others only spit and square attribution is possible.
A data frame with 7 rows and 7 variables:
inv: Inventory numbers of sherds. KTF means single find with individual measurement, KTM means mass find without this precise information.
spit: spits where the sherds were found
square: squares where the sherds were found
feature: features where the sherds were found
x: x axis coordinates of sherds
y: y axis coordinates of sherds
z: z axis coordinates of sherds
Other KT_data: KT_spits
,
KT_squarecorners
pnp
is able to determine if a point is within a polygon in 2D space.
The polygon is described by its corner points. The points must be in a correct
drawing order.
Based on this solution: Copyright (c) 1970-2003, Wm. Randolph Franklin http://wrf.ecse.rpi.edu/pmwiki/pmwiki.php/Main/Software#toc24
pnp(vertx, verty, testx, testy)
pnp(vertx, verty, testx, testy)
vertx |
vector of x axis values of polygon corner points |
verty |
vector of y axis values of polygon corner points |
testx |
x axis value of point of interest |
testy |
y axis value of point of interest |
For discussion see: http://stackoverflow.com/questions/217578/how-can-i-determine-whether-a-2d-point-is-within-a-polygon/2922778#2922778
boolean value - TRUE, if the point is within the polygon. Otherwise FALSE.
Other pnpfuncs: pnpmulti
df <- data.frame( x = c(1,1,2,2), y = c(1,2,1,2) ) pnp(df$x, df$y, 1.5, 1.5) pnp(df$x, df$y, 2.5, 2.5) # caution: false-negatives in edge-cases: pnp(df$x, df$y, 2, 1.5)
df <- data.frame( x = c(1,1,2,2), y = c(1,2,1,2) ) pnp(df$x, df$y, 1.5, 1.5) pnp(df$x, df$y, 2.5, 2.5) # caution: false-negatives in edge-cases: pnp(df$x, df$y, 2, 1.5)
pnpmulti
works as pnp
but for multiple points.
pnpmulti(vertx, verty, testx, testy)
pnpmulti(vertx, verty, testx, testy)
vertx |
vector of x axis values of polygon corner points |
verty |
vector of y axis values of polygon corner points |
testx |
vector of x axis values of points of interest |
testy |
vector of y axis values of points of interest |
vector with boolean values - TRUE, if the respective point is within the polygon. Otherwise FALSE.
Other pnpfuncs: pnp
polydf <- data.frame( x = c(1,1,2,2), y = c(1,2,1,2) ) testdf <- data.frame( x = c(1.5, 2.5), y = c(1.5, 2.5) ) pnpmulti(polydf$x, polydf$y, testdf$x, testdf$y)
polydf <- data.frame( x = c(1,1,2,2), y = c(1,2,1,2) ) testdf <- data.frame( x = c(1.5, 2.5), y = c(1.5, 2.5) ) pnpmulti(polydf$x, polydf$y, testdf$x, testdf$y)
posdec
has the purpose to make a decision about the position of individual points in relation
to a set of stacked surfaces in 3D space. The decision is made by comparing the mean z axis value of
the four horizontally closest points of a surface to the z axis value of the point in question.
posdec(crdf, maplist)
posdec(crdf, maplist)
crdf |
data.frame with the spatial coordinates of the points of interest. Must contain three columns with the x axis values, y axis values and z axis values of the points in the order x, y, z |
maplist |
list of data.frames which contain the points that make up the surfaces. The individual
data.frames must have the same structure as |
data.frame with the spatial coordinates of the points of interest and the respective position information
Other posdecfuncs: posdeclist
df1 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) - 5 ) df2 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) + 5 ) lpoints <- list(df1, df2) maps <- kriglist(lpoints, lags = 3, model = "spherical") finds <- data.frame( x = c(0, 1, 0.5, 0.7), y = c(0.5, 0, 1, 0.7), z = c(-10, 10, 0, 2) ) posdec(finds, maps)
df1 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) - 5 ) df2 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) + 5 ) lpoints <- list(df1, df2) maps <- kriglist(lpoints, lags = 3, model = "spherical") finds <- data.frame( x = c(0, 1, 0.5, 0.7), y = c(0.5, 0, 1, 0.7), z = c(-10, 10, 0, 2) ) posdec(finds, maps)
posdeclist
works as posdec
but not just for a single data.frame
with individual points but for a list of data.frames
posdeclist(crdflist, maplist)
posdeclist(crdflist, maplist)
crdflist |
list of data.frames with the spatial coordinates of the points of
interest (for details see |
maplist |
list of data.frames which contain the points that make up the surfaces |
list of data.frames with the spatial coordinates of the points of interest and the respective position information
Other posdecfuncs: posdec
df1 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) - 5 ) df2 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) + 5 ) lpoints <- list(df1, df2) maps <- kriglist(lpoints, lags = 3, model = "spherical") hexadf1 <- data.frame( x = c(0, 1, 0, 4, 5, 5, 5, 5), y = c(1, 1, 4, 4, 1, 1, 4, 4), z = c(1, 5, 1, 6, 1, 5, 1, 3) ) hexadf2 <- data.frame( x = c(0, 1, 0, 4, 5, 5, 5, 5), y = c(1, 1, 4, 4, 1, 1, 4, 4), z = c(-1, -5, -1, -6, -1, -5, -1, -3) ) cx1 <- fillhexa(hexadf1, 0.1) cx2 <- fillhexa(hexadf2, 0.1) cubelist <- list(cx1, cx2) posdeclist(cubelist, maps)
df1 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) - 5 ) df2 <- data.frame( x = rnorm(50), y = rnorm(50), z = rnorm(50) + 5 ) lpoints <- list(df1, df2) maps <- kriglist(lpoints, lags = 3, model = "spherical") hexadf1 <- data.frame( x = c(0, 1, 0, 4, 5, 5, 5, 5), y = c(1, 1, 4, 4, 1, 1, 4, 4), z = c(1, 5, 1, 6, 1, 5, 1, 3) ) hexadf2 <- data.frame( x = c(0, 1, 0, 4, 5, 5, 5, 5), y = c(1, 1, 4, 4, 1, 1, 4, 4), z = c(-1, -5, -1, -6, -1, -5, -1, -3) ) cx1 <- fillhexa(hexadf1, 0.1) cx2 <- fillhexa(hexadf2, 0.1) cubelist <- list(cx1, cx2) posdeclist(cubelist, maps)
Scales a 3D point cloud on every axis.
rescale(x, y, z, scalex = 1, scaley = 1, scalez = 1)
rescale(x, y, z, scalex = 1, scaley = 1, scalez = 1)
x |
vector of x axis values of scale point cloud |
y |
vector of y axis values of scale point cloud |
z |
vector of z axis values of scale point cloud |
scalex |
scaling factor on x axis (default = 1) |
scaley |
scaling factor on y axis (default = 1) |
scalez |
scaling factor on z axis (default = 1) |
data.frame with the spatial coordinates of the resulting points
s <- draw_sphere(1,1,1,3) #library(rgl) #plot3d(s) s2 <- rescale(s$x, s$y, s$z, scalex = 4, scalez = 5) #library(rgl) #plot3d(s2)
s <- draw_sphere(1,1,1,3) #library(rgl) #plot3d(s) s2 <- rescale(s$x, s$y, s$z, scalex = 4, scalez = 5) #library(rgl) #plot3d(s2)
Rotate a point cloud around a defined pivot point by defined angles. The default rotation angle around each axis is zero and the default pivot point is the center point of the point cloud (defined by mean())
rotate(x, y, z, degrx = 0, degry = 0, degrz = 0, pivotx = NA_real_, pivoty = NA_real_, pivotz = NA_real_)
rotate(x, y, z, degrx = 0, degry = 0, degrz = 0, pivotx = NA_real_, pivoty = NA_real_, pivotz = NA_real_)
x |
vector of x axis values of rotation point cloud |
y |
vector of y axis values of rotation point cloud |
z |
vector of z axis values of rotation point cloud |
degrx |
rotation angle around x axis in degree (default = 0) |
degry |
rotation angle around y axis in degree (default = 0) |
degrz |
rotation angle around z axis in degree (default = 0) |
pivotx |
x axis value of pivot point (default = mean(x)) |
pivoty |
y axis value of pivot point (default = mean(y)) |
pivotz |
z axis value of pivot point (default = mean(z)) |
data.frame with the spatial coordinates of the resulting points
circ <- draw_circle(0,0,0,5) #library(rgl) #plot3d( # circ, # xlim = c(-6,6), # ylim = c(-6,6), # zlim = c(-6,6) #) rotcirc <- rotate(circ$x, circ$y, circ$z, degrx = 45) #plot3d( # rotcirc, # xlim = c(-6,6), # ylim = c(-6,6), # zlim = c(-6,6) #)
circ <- draw_circle(0,0,0,5) #library(rgl) #plot3d( # circ, # xlim = c(-6,6), # ylim = c(-6,6), # zlim = c(-6,6) #) rotcirc <- rotate(circ$x, circ$y, circ$z, degrx = 45) #plot3d( # rotcirc, # xlim = c(-6,6), # ylim = c(-6,6), # zlim = c(-6,6) #)
spatiallong
transforms a set of two independent variables in vectors and a
dependent variable in a wide matrix to a long matrix that combines the information.
The result is exported as a data.frame.
spatiallong(x, y, z)
spatiallong(x, y, z)
x |
vector of first independent variable. e.g. vector with x axis spatial points |
y |
vector of second independent variable. e.g. vector with y axis spatial points |
z |
matrix of dependent variable. e.g. matrix with z axis spatial points |
data.frame with three columns x, y and z
Other transfuncs: spatialwide
x <- c(1, 1, 1, 2, 2, 2, 3, 3, 4) y <- c(1, 2, 3, 1, 2, 3, 1, 2, 3) z <- c(3, 4, 2, 3, NA, 5, 6, 3, 1) sw <- spatialwide(x, y, z, digits = 3) spatiallong(sw$x, sw$y, sw$z)
x <- c(1, 1, 1, 2, 2, 2, 3, 3, 4) y <- c(1, 2, 3, 1, 2, 3, 1, 2, 3) z <- c(3, 4, 2, 3, NA, 5, 6, 3, 1) sw <- spatialwide(x, y, z, digits = 3) spatiallong(sw$x, sw$y, sw$z)
Transforms a set of two independent and one dependent variables in vectors from a long to a wide format and exports this result as a list
spatialwide(x, y, z, digits)
spatialwide(x, y, z, digits)
x |
vector of first independent variable. e.g. vector with x-axis spatial points |
y |
vector of second independent variable. e.g. vector with y-axis spatial points |
z |
vector of dependent variable. e.g. vector with z-axis spatial points |
digits |
integer indicating the number of decimal places to be used for rounding
the dependent variables |
List with three elements:
$x: vector with ascendingly sorted, unique values of the first independent variable x
$y: vector with ascendingly sorted, unique values of the second independent variable y
$z: matrix with the values of z for the defined combinations of x
(columns) and
y
(rows)
Other transfuncs: spatiallong
x <- c(1, 1, 1, 2, 2, 2, 3, 3, 4) y <- c(1, 2, 3, 1, 2, 3, 1, 2, 3) z <- c(3, 4, 2, 3, NA, 5, 6, 3, 1) spatialwide(x, y, z, digits = 3)
x <- c(1, 1, 1, 2, 2, 2, 3, 3, 4) y <- c(1, 2, 3, 1, 2, 3, 1, 2, 3) z <- c(3, 4, 2, 3, NA, 5, 6, 3, 1) spatialwide(x, y, z, digits = 3)
A hexahedron is a three dimensional shape that is defined by 6 faces and 8 corner points.
spitcenter
determines a center point for an input hexahedron by calculating the mean
of the maximal extent on all three axis.
spitcenter(hex)
spitcenter(hex)
hex |
dataframe with three columns and eight rows to define a hexahedron by its corner point coordinates x, y and z |
vector with the spatial coordinates of the center point of the input hexahedron
Other centerdetfuncs: spitcenternatlist
,
spitcenternat
hexatestdf <- data.frame( x = c(0,1,0,4,5,5,5,5), y = c(1,1,4,4,1,1,4,4), z = c(4,8,4,9,4,8,4,6) ) center <- spitcenter(hexatestdf) #library(rgl) #plot3d( # hexatestdf$x, hexatestdf$y, hexatestdf$z, # type = "p", # xlab = "x", ylab = "y", zlab = "z" #) #plot3d( # center[1], center[2], center[3], # type = "p", # col = "red", # add = TRUE #)
hexatestdf <- data.frame( x = c(0,1,0,4,5,5,5,5), y = c(1,1,4,4,1,1,4,4), z = c(4,8,4,9,4,8,4,6) ) center <- spitcenter(hexatestdf) #library(rgl) #plot3d( # hexatestdf$x, hexatestdf$y, hexatestdf$z, # type = "p", # xlab = "x", ylab = "y", zlab = "z" #) #plot3d( # center[1], center[2], center[3], # type = "p", # col = "red", # add = TRUE #)
spitcenternat
first of all calculates the horizontal center of an input rectangle.
Then it determines the vertical positions of the center points in relation to a surface stack.
spitcenternat(hex, maplist)
spitcenternat(hex, maplist)
hex |
data.frame with the 2D corners of the rectangle defined by four points |
maplist |
list of data.frames which contain the points that make up the surfaces |
data.frame with the spatial coordinates of the center points
Other centerdetfuncs: spitcenternatlist
,
spitcenter
df1 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.9+0.05*rnorm(6), 0.9+0.05*rnorm(14), 1.3+0.05*rnorm(14), 1.2+0.05*rnorm(6)) ) df2 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.6+0.05*rnorm(6), 0.6+0.05*rnorm(14), 1.0+0.05*rnorm(14), 0.9+0.05*rnorm(6)) ) df3 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.3+0.05*rnorm(6), 0.3+0.05*rnorm(14), 0.7+0.05*rnorm(14), 0.6+0.05*rnorm(6)) ) lpoints <- list(df1, df2, df3) maps <- kriglist(lpoints, lags = 3, model = "spherical") hexatestdf <- data.frame( x = c(1, 1, 1, 1, 2, 2, 2, 2), y = c(0, 1, 0, 1, 0, 1, 0, 1) ) spitcenternat(hexatestdf, maps)
df1 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.9+0.05*rnorm(6), 0.9+0.05*rnorm(14), 1.3+0.05*rnorm(14), 1.2+0.05*rnorm(6)) ) df2 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.6+0.05*rnorm(6), 0.6+0.05*rnorm(14), 1.0+0.05*rnorm(14), 0.9+0.05*rnorm(6)) ) df3 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.3+0.05*rnorm(6), 0.3+0.05*rnorm(14), 0.7+0.05*rnorm(14), 0.6+0.05*rnorm(6)) ) lpoints <- list(df1, df2, df3) maps <- kriglist(lpoints, lags = 3, model = "spherical") hexatestdf <- data.frame( x = c(1, 1, 1, 1, 2, 2, 2, 2), y = c(0, 1, 0, 1, 0, 1, 0, 1) ) spitcenternat(hexatestdf, maps)
spitcenternatlist
works as spitcenternat
but not just for a
single data.frame but for a list of data.frames
spitcenternatlist(hexlist, maplist)
spitcenternatlist(hexlist, maplist)
hexlist |
list of data.frames with the 2D corners of the rectangles |
maplist |
list of data.frames which contain the points that make up the surfaces |
list of data.frames with the spatial coordinates of the center points
Other centerdetfuncs: spitcenternat
,
spitcenter
df1 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.9+0.05*rnorm(6), 0.9+0.05*rnorm(14), 1.3+0.05*rnorm(14), 1.2+0.05*rnorm(6)) ) df2 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.6+0.05*rnorm(6), 0.6+0.05*rnorm(14), 1.0+0.05*rnorm(14), 0.9+0.05*rnorm(6)) ) df3 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.3+0.05*rnorm(6), 0.3+0.05*rnorm(14), 0.7+0.05*rnorm(14), 0.6+0.05*rnorm(6)) ) lpoints <- list(df1, df2, df3) maps <- kriglist(lpoints, lags = 3, model = "spherical") hexatestdf1 <- data.frame( x = c(1, 1, 1, 1, 2, 2, 2, 2), y = c(0, 1, 0, 1, 0, 1, 0, 1) ) hexatestdf2 <- data.frame( x = c(0, 0, 0, 0, 1, 1, 1, 1), y = c(0, 1, 0, 1, 0, 1, 0, 1) ) hexs <- list(hexatestdf1, hexatestdf2) spitcenternatlist(hexs, maps)
df1 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.9+0.05*rnorm(6), 0.9+0.05*rnorm(14), 1.3+0.05*rnorm(14), 1.2+0.05*rnorm(6)) ) df2 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.6+0.05*rnorm(6), 0.6+0.05*rnorm(14), 1.0+0.05*rnorm(14), 0.9+0.05*rnorm(6)) ) df3 <- data.frame( x = c(rep(0, 6), seq(0.2, 2.8, 0.2), seq(0.2, 2.8, 0.2), rep(3,6)), y = c(seq(0, 1, 0.2), rep(0, 14), rep(1, 14), seq(0, 1, 0.2)), z = c(0.3+0.05*rnorm(6), 0.3+0.05*rnorm(14), 0.7+0.05*rnorm(14), 0.6+0.05*rnorm(6)) ) lpoints <- list(df1, df2, df3) maps <- kriglist(lpoints, lags = 3, model = "spherical") hexatestdf1 <- data.frame( x = c(1, 1, 1, 1, 2, 2, 2, 2), y = c(0, 1, 0, 1, 0, 1, 0, 1) ) hexatestdf2 <- data.frame( x = c(0, 0, 0, 0, 1, 1, 1, 1), y = c(0, 1, 0, 1, 0, 1, 0, 1) ) hexs <- list(hexatestdf1, hexatestdf2) spitcenternatlist(hexs, maps)