raster (version 2.6-7)

geom: Get the coordinates of a vector type Spatial* object

Description

Extract the coordinates of a Spatial object

Usage

# S4 method for SpatialPolygons
geom(x, sepNA=FALSE, ...)

Arguments

x

SpatialPolygons*, SpatialLines*, or SpatialPoints* object

sepNA

logical. If TRUE, geometries are separated by a row with NA values

...

additional arguments, none implemented

Value

Matrix with 6, (5 SpatialLines), or 3 (SpatialPoints) columns. object (sequential object number) part (sequential part number within the object; not for SpatialPoints), cump (cumulative part number; not for SpatialPoints), hole (is this a hole or not; only for SpatialPolygons), x (x coordinate or longitude), y (y coordinate or latitude)

See Also

coordinates, geometry

Examples

Run this code
# NOT RUN {
if (require(rgdal) & require(rgeos)) {
	p <- shapefile(system.file("external/lux.shp", package="raster"))
	x <- geom(p)
}
# }

Run the code above in your browser using DataCamp Workspace