% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geom-transformers.R
\name{geos_binary_ops}
\alias{geos_binary_ops}
\alias{st_intersection.sftime}
\alias{st_difference.sftime}
\alias{st_sym_difference.sftime}
\title{Geometric operations on pairs of simple feature geometry sets (including \code{sftime} objects)}
\usage{
\method{st_intersection}{sftime}(x, y, ...)

\method{st_difference}{sftime}(x, y, ...)

\method{st_sym_difference}{sftime}(x, y, ...)
}
\arguments{
\item{x}{object of class \code{sftime}, \code{sf}, \code{sfc} or \code{sfg}.}

\item{y}{object of class \code{sftime}, \code{sf}, \code{sfc} or \code{sfg}.}

\item{...}{See \code{\link[sf:geos_binary_ops]{geos_binary_ops}}.}
}
\value{
The intersection, difference or symmetric difference between two sets 
of geometries.
The returned object has the same class as that of the first argument 
(\code{x}) with the non-empty geometries resulting from applying the 
operation to all geometry pairs in \code{x} and \code{y}. In case \code{x} 
is of class \code{sf} or \code{sftime}, the matching attributes of the 
original object(s) are added. The \code{sfc} geometry list-column returned 
carries an attribute \code{idx}, which is an \code{n}-by-2 matrix with every 
row the index of the corresponding entries of \code{x} and \code{y}, 
respectively.
}
\description{
Geometric operations on pairs of simple feature geometry sets (including \code{sftime} objects)

Intersection

Difference
}
\details{
\code{st_intersection}: When called with a missing \code{y}, the 
\code{sftime} method for \code{st_intersection} returns an \code{sftime} 
object with attributes taken from the contributing feature with lowest index; 
two fields are added: 
\describe{
  \item{\code{n.overlaps}}{The number of overlapping features in \code{x}.}
  \item{\code{origins}}{A list-column with indexes of all overlapping 
  features.}
}

\code{st_difference}: When \code{st_difference} is called with a 
single argument, overlapping areas are erased from geometries that are 
indexed at greater numbers in the argument to \code{x}; geometries that are 
empty or contained fully inside geometries with higher priority are removed 
entirely.
}
\examples{
g <- st_sfc(st_point(c(1, 2)), st_point(c(1, 3)), st_point(c(2, 3)), 
     st_point(c(2, 1)), st_point(c(3, 1)))
tc <- Sys.time() + 1:5
x1 <- st_sftime(a = 1:5, g, time = tc)
x2 <- st_buffer(x1, dist = 1)

## intersection

# only x provided (no y)
plot(st_intersection(x2))

# with arguments x and y provided
plot(st_intersection(x2, x1))

## difference

# only x provided (no y)
plot(st_difference(x2))

# with arguments x and y provided
plot(st_difference(x2, x1))

## symmetric difference
plot(st_sym_difference(x1, x2))

}
