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. point is
recycled against geometry. A null geometry or a null point gives NA.
See also
Other topology:
ga_contains(),
ga_dimension(),
ga_filter(),
ga_is_empty(),
ga_join(),
ga_relate(),
ga_sparse_intersects(),
ga_sparse_pairs()
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_xy(c(2, 0, 9), c(2, 2, 9))
as.vector(ga_coordinate_position(g, p))
#> [1] "inside" "boundary" "outside"