geometry-methods: Methods for retrieving the geometry from a composite...

Description Usage Arguments Methods Author(s) Examples

Description

geometry retrieves the SpatialXxx object from a SpatialXxxDataFrame object, with Xxx Lines, Points, Polygons, Grid, or Pixels. geometry<- converts a data.frame into a Spatial object.

Usage

1
2
3
 
geometry(obj) 
geometry(obj) <- value 

Arguments

obj

in case of assignment, a data.frame, else an object of class Spatial

value

object of class Spatial

Methods

obj = "Spatial"
obj = "SpatialPointsDataFrame"
obj = "SpatialMultiPointsDataFrame"
obj = "SpatialPolygonsDataFrame"
obj = "SpatialPixelsDataFrame"
obj = "SpatialGridDataFrame"
obj = "SpatialLinesDataFrame"

Author(s)

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

Examples

1
2
3
4
5
6
7
8
data(meuse)
m = meuse
coordinates(m) = meuse[, c("x", "y")]
pts = geometry(m)
class(pts)
geometry(meuse) = pts
class(meuse)
identical(m, meuse) # TRUE

sp documentation built on July 4, 2017, 9:02 a.m.