sf (version 0.5-2)

geos_binary_ops: Geometric binary operations on pairs of simple feature geometry sets

Description

Geometric binary operations on pairs of simple feature geometry sets

Usage

st_intersection(x, y)

st_difference(x, y)

st_sym_difference(x, y)

Arguments

x

object of class sf, sfc or sfg

y

object of class sf, sfc or sfg

Value

an object of the same class as that of the first argument (x) with the non-empty geometries resulting from applying the operation to all geometry pairs in x and y. In case x is of class sf, the matching attributes of the original object(s) are added. The sfc geometry list-column returned carries an attribute idx, which is an n x 2 matrix with every row the index of the corresponding entries of x and y, respectively.

Details

a spatial index is built on argument x; see http://r-spatial.org/r/2017/06/22/spatial-index.html ; the referenece for the STR tree algorithm is: Leutenegger, Scott T., Mario A. Lopez, and Jeffrey Edgington. "STR: A simple and efficient algorithm for R-tree packing." Data Engineering, 1997. Proceedings. 13th international conference on. IEEE, 1997; for the pdf, search google scholar.

See Also

st_union

Examples

Run this code
# NOT RUN {
# a helper function that erases all of y from x:
st_erase = function(x, y) st_difference(x, st_union(st_combine(y)))
# }

Run the code above in your browser using DataLab