EVOLUTION-MANAGER
Edit File: spEasy.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Create SpatialLines* or SpatialPolygons*</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for sp {raster}"><tr><td>sp {raster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create SpatialLines* or SpatialPolygons*</h2> <h3>Description</h3> <p>Helper functions to simplify the creation of SpatialLines* or SpatialPolygons* objects from coordinates. </p> <h3>Usage</h3> <pre> spLines(x, ..., attr=NULL, crs="") spPolygons(x, ..., attr=NULL, crs="") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>matrix of list with matrices. Each matrix must have two columns with x and y coordinates (or longitude and latitude, in that order). Multi-line or multi-polygon objects can be formed by combining matrices in a list</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional matrices and/or lists with matrices</p> </td></tr> <tr valign="top"><td><code>attr</code></td> <td> <p>data.frame with the attributes to create a *DataFrame object. The number of rows must match the number of lines/polgyons</p> </td></tr> <tr valign="top"><td><code>crs</code></td> <td> <p>the coordinate reference system (PROJ4 or WKT notation)</p> </td></tr> </table> <h3>Value</h3> <p>SpatialLines* or SpatialPolygons* </p> <h3>Examples</h3> <pre> x1 <- rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60)) x2 <- rbind(c(-10,0), c(140,60), c(160,0), c(140,-55)) x3 <- rbind(c(-125,0), c(0,60), c(40,5), c(15,-45)) x4 <- rbind(c(41,-41.5), c(51,-35), c(62,-41), c(51,-50)) a <- spLines(x1, x2, x3) b <- spLines(x1, list(x2, x3), attr=data.frame(id=1:2), crs='+proj=longlat +datum=WGS84') b hole <- rbind(c(-150,-20), c(-100,-10), c(-110,20), c(-130,10)) d <- spPolygons(list(x1,hole), x2, list(x3, x4)) att <- data.frame(ID=1:3, name=c('a', 'b', 'c')) e <- spPolygons(list(x1,hole), x2, list(x3, x4), attr=att, crs='+proj=longlat +datum=WGS84') e </pre> <hr /><div style="text-align: center;">[Package <em>raster</em> version 3.3-13 <a href="00Index.html">Index</a>]</div> </body></html>