It depends on the classes of the x and y what is returned.
If x is a Raster* object the extent of y is used, irrespective of the class of y, and a Raster* is returned. This is equivalent to crop.
If x is a Spatial* object, a new Spatial* object is returned. If x or y has a data.frame, these are also returned (after merging if necessary) as part of a Spatial*DataFrame.
Intersecting SpatialPoints* with SpatialPoints* uses the extent (bounding box) of y to get the intersection. Intersecting of SpatialPoints* and SpatialLines* is not supported because of numerical inaccuracies with that. You can use buffer, to create SpatialPoygons* from SpatialLines* and use that in intersect.
methods
## S4 method for signature 'Extent,ANY'intersect(x, y)## S4 method for signature 'Raster,ANY'intersect(x, y)## S4 method for signature 'SpatialPoints,ANY'intersect(x, y)## S4 method for signature 'SpatialPolygons,SpatialPolygons'intersect(x, y)## S4 method for signature 'SpatialPolygons,SpatialLines'intersect(x, y)## S4 method for signature 'SpatialPolygons,SpatialPoints'intersect(x, y)## S4 method for signature 'SpatialLines,SpatialPolygons'intersect(x, y)## S4 method for signature 'SpatialLines,SpatialLines'intersect(x, y)
Arguments
x: Extent, Raster*, SpatialPolygons*, SpatialLines* or SpatialPoints* object
y: same as for x
Returns
if x is an Extent object: Extent
if x is a Raster* object: Raster*
if x is a SpatialPoints* object: SpatialPoints*
if x is a SpatialPolygons* object: SpatialPolygons*
if x is a SpatialLines* object and if y is a SpatialLines* object: SpatialPoints*
if x is a SpatialLines* object and if y is a SpatialPolygons* object: SpatialLines*