Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

geometry-methods

Methods for retrieving the geometry from a composite (geometry + attributes) object


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

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)

Examples

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

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.