Learn R Programming

velox (version 0.2.0)

bg_intersects: Test whether two BoostObjects intersect

Description

Tests whether two BoostObjects intersect (element-wise).

Usage

bg_intersects(obj1, obj2)

# S4 method for BoostMultiPolygons,BoostBoxGrid bg_intersects(obj1, obj2)

# S4 method for BoostMultiLines,BoostBoxGrid bg_intersects(obj1, obj2)

# S4 method for BoostMultiPolygons,BoostPointGrid bg_intersects(obj1, obj2)

# S4 method for BoostMultiPolygons,BoostGeometries bg_intersects(obj1, obj2)

# S4 method for BoostMultiLines,BoostGeometries bg_intersects(obj1, obj2)

# S4 method for BoostMultiPoints,BoostGeometries bg_intersects(obj1, obj2)

Arguments

obj1

A BoostObject.

obj2

A BoostObject.

Value

A list, with list element i an integer vector with the indices j for which intersects(x[i],y[j]) is TRUE.

Examples

Run this code
# NOT RUN {
pts = boost(sf::st_sfc(sf::st_point(c(.5,.5)),
sf::st_point(c(1.5, 1.5)),
sf::st_point(c(2.5, 2.5))))
pol = boost(sf::st_sfc(sf::st_polygon(
list(rbind(c(0,0), c(2,0), c(2,2), c(0,2), c(0,0))))))
bg_intersects(pol, pts)

# }

Run the code above in your browser using DataLab