View source: R/relationalClassFunction.R
relationalClassFunction | R Documentation |
This function calculates statistics from neighbors of a given class to the given class (input is SpatialPolygonsDataFrame). Moreover, it is possible to calculate statistics for neighbors in a specific direction of a class object by setting the parameter for the getBoundingBox in the function call. In addition, if the neighbors are attributed to another second class, also a class-to-class relationship can be performed. Furthermore, attributing the first and the second class must not been necessarily hard coded, instead it is also possible to use expressions for the class-to-class relationship. However, here it can happen that some objects are assigned to both classes. As default, these objects are excluded from the statistic, but they can be included by setting the specific argument (class.as.neighbors). Moreover, the function is also capable to compute statistics on angle inputs by setting the function argument of var.is.angle to TRUE
relationalClassFunction(spdf, nb, class.var, class.var2 = NULL, var, var2 = NULL, var.is.angle = FALSE, class.as.neighbors = FALSE, only.neighbors = TRUE, centroid.for.distance = TRUE, calc.nb.flow = FALSE, col.flow = NULL, bb.intersection = "rgeos", return.bb.flow = FALSE, scale.factor.flow = c(1, 1), bb = NULL, centroid.flow = FALSE, set.centroid.flow = "inverse", k.centroid.flow = 2, k.flow = 2, scale.side.flow = "small", quiet = TRUE)
spdf |
SpatialPolygonsDataFrame, or full path of a shapefile |
nb |
object neighborhood based on |
class.var |
defination of class. Can be string or integer, or an expression in form of a list. For examples: class = as.integer(1), class = list("> 2.5", "expression"), class = list(c("> 2", "&", "< 7"), "expression") |
class.var2 |
defination of a second class, see class.var. Enables class-to-class relationship. Default: NULL |
var |
vector with number or name defining 1. field of evaluation (i.e. slope) and 2. field of weights (i.e. area). For example: c("Slope", "Area") or c(1,2) |
var.is.angle |
variable for statistc represents angles. Other mathematical computation. Default: FALSE |
class.as.neighbors |
class object is also neighbor object. Default: FALSE |
only.neighbors |
object statistics are computed only for neighbors. Default: TRUE (FALSE means computation for the entiry data) |
calc.nb.flow |
include statistics for neighbors in flow direction. Default: FALSE |
col.flow |
column specifying direction. Default: NULL |
bb.intersection |
method for intersection with bounding box. Default: "rgeos" (alternative: "sp") |
return.bb.flow |
return geoemtry of counding box. Default: FALSE |
bb |
input of bounding box geometry. Default: NULL |
quiet |
no outputs in console. Default: TRUE |
other... |
see |
data.frame containing object statistics, and optional the created geometry of getBoundingBox
object statistics to class according to ECOGNITION DEVELOPER (2014: 253-255, 375-381):
see relationalObjectFunction
ang_m_cl - mean angle of an object in relation to its surrounding class objects
ang_d_cl - mean difference angle of an object in relation to its surrounding class objects
ang_d_cl_a - absolute mean difference angle
bor_cl_a - absolute border of an object shared with neighboring objects of a defined class
bor_cl_rel - relative border of an object shared with neighboring objects of a defined class
dist_cl - distance of a not-neighbor object of a defined class to a defined class object
flow_nb_cl - object is located in flow direction (TRUE/FALSE)
ECOGNITION DEVELOPER (2014) Reference Book. Trimble Documentation, München, Germany
see getBoundingBox
SpatialPolygonsDataFrame objects with NA values are ignored
SpatialPolygonsDataFrame objects without neighbors are ignored
SpatialPolygonsDataFrame input must have a valid Class and ID field. ID field must be contained of unique numbers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.