aRTlayer-getSetOperation {aRT} | R Documentation

## Set Operations

### Description

Return the result of an operation involving sets (union, intersection, difference and xor). The result has "" as ID.

### Usage

    ## S4 method for signature 'aRTlayer':
    getSetOperation(object, operation= c("union", "intersection", "difference", "xor"), ID = NULL, as.sp = TRUE)

### Arguments

`object` | Object of class `aRTlayer`.
`operation` | One of: union intersection difference xor (does not work yet)
`ID` | The ids which to be used in the operation. `difference` and `xor` use only two ids. `union` and `intersection` have as default all objects of the layer.
`as.sp` | Return Spatial data or an object of class `aRTgeometry`

### Note

If one polygon has two consecultive and equal points, these algorithms may not work, therefore you need to remove this unwanted data before.

### Author(s)

Pedro Ribeiro de Andrade

### See Also

See `aRTlayer-class` to the description of this class.

### Examples

    ## Not run:
    ## difference between two geometries
    getSetMetric(layer, "difference", ids=c("1", "2"))

    ## union of all geometries of the layer
    getSetMetric(layer, "union")
    ## End(Not run)

[Package aRT version 1.7-1 Index]