| 1 |
\name{geometry-methods} |
| 2 |
\docType{methods} |
| 3 |
\alias{geometry} |
| 4 |
\alias{geometry-methods} |
| 5 |
\alias{geometry,Spatial-method} |
| 6 |
\alias{geometry,SpatialPointsDataFrame-method} |
| 7 |
\alias{geometry,SpatialMultiPointsDataFrame-method} |
| 8 |
\alias{geometry,SpatialGridDataFrame-method} |
| 9 |
\alias{geometry,SpatialPixelsDataFrame-method} |
| 10 |
\alias{geometry,SpatialLinesDataFrame-method} |
| 11 |
\alias{geometry,SpatialPolygonsDataFrame-method} |
| 12 |
\alias{geometry<-} |
| 13 |
\alias{geometry<-,data.frame,Spatial-method} |
| 14 |
\title{ Methods for retrieving the geometry from a composite (geometry + attributes) object } |
| 15 |
\usage{ |
| 16 |
geometry(obj) |
| 17 |
geometry(obj) <- value |
| 18 |
} |
| 19 |
\arguments{ |
| 20 |
\item{obj}{in case of assignment, a data.frame, else an object of class Spatial} |
| 21 |
\item{value}{object of class Spatial} |
| 22 |
} |
| 23 |
\description{ |
| 24 |
geometry retrieves the SpatialXxx object from a SpatialXxxDataFrame object, |
| 25 |
with Xxx Lines, Points, Polygons, Grid, or Pixels. geometry<- converts a |
| 26 |
data.frame into a Spatial object. |
| 27 |
} |
| 28 |
\section{Methods}{ |
| 29 |
\describe{ |
| 30 |
\item{obj = "Spatial"}{ } |
| 31 |
\item{obj = "SpatialPointsDataFrame"}{ } |
| 32 |
\item{obj = "SpatialMultiPointsDataFrame"}{ } |
| 33 |
\item{obj = "SpatialPolygonsDataFrame"}{ } |
| 34 |
\item{obj = "SpatialPixelsDataFrame"}{ } |
| 35 |
\item{obj = "SpatialGridDataFrame"}{ } |
| 36 |
\item{obj = "SpatialLinesDataFrame"}{ } |
| 37 |
} |
| 38 |
} |
| 39 |
\author{Edzer Pebesma, \email{[email protected]}} |
| 40 |
\examples{ |
| 41 |
data(meuse) |
| 42 |
m = meuse |
| 43 |
coordinates(m) = meuse[, c("x", "y")] |
| 44 |
pts = geometry(m) |
| 45 |
class(pts) |
| 46 |
geometry(meuse) = pts |
| 47 |
class(meuse) |
| 48 |
identical(m, meuse) # TRUE |
| 49 |
} |
| 50 |
\keyword{methods} |