Returns "inside", "outside", or "boundary" for each pair.
Details
This is the three way form of a point in polygon test, distinguishing a
point that lies exactly on an edge from one strictly inside.
ga_coordinate_position() recycles point against geometry and returns
NA for a null geometry or a null point.
Examples
ring <- rbind(c(0, 0), c(4, 0), c(4, 4), c(0, 4), c(0, 0))
square <- sf::st_polygon(list(ring))
g <- geoarrow::as_geoarrow_array(sf::st_sfc(square, square, square))
# inside, on the edge, and outside
p <- ga_point(c(2, 0, 9), c(2, 2, 9))
as.vector(ga_coordinate_position(g, p))
#> [1] "inside" "boundary" "outside"