overlay-methods {sp}R Documentation

Methods for spatially overlay-ing points (grids) and polygons layers

Description

overlay combines points (or grids) and polygons by performing point-in-polygon operation on all point-polygons combinations.

Methods

x = "SpatialPoints", y = "SpatialPolygons"

returns a numeric vector of length equal to the number of points; the number is the index (number) of the polygon of y in which a point falls; NA denotes the point does not fall in a polygon; if a point falls in multiple polygons, the last polygon is recorded.

x = "SpatialPointsDataFrame", y = "SpatialPolygons"

equal to the previous method, except that an argument fn=xxx is allowed, e.g. fn = mean which will then report a data.frame with the mean values of the x points falling in each polygon (set) of y

x = "SpatialPoints", y = "SpatialPolygonsDataFrame"

returns a data.frame of the second argument with row entries corresponding to the first argument

x = "SpatialPolygons", y = "SpatialPoints"

returns the polygon index of points in y; if x is a SpatialPolygonsDataFrame, a data.frame with rows from x corresponding to points in y is returned.

x = "SpatialGridDataFrame", y = "SpatialPoints"

returns object of class SpatialPointsDataFrame with grid attribute values x at spatial point locations y; NA for NA grid cells or points outside grid, and NA values on NA grid cells.

x = "SpatialGrid", y = "SpatialPoints"

returns grid values x at spatial point locations y; NA for NA grid cells or points outside the grid

x = "SpatialPixelsDataFrame", y = "SpatialPoints"

returns grid values x at spatial point locations y; NA for NA grid cells or points outside the grid

x = "SpatialPixels", y = "SpatialPoints"

returns grid values x at spatial point locations y; NA for NA grid cells or points outside the grid

Note

points on a polygon boundary and points corresponding to a polygon vertex are considered to be inside the polygon

Author(s)

Edzer Pebesma, edzer.pebesma@uni-muenster.de

See Also

overlay, point.in.polygon


[Package sp version 0.9-95 Index]