EVOLUTION-MANAGER
Edit File: SpatialPolygons.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 objects of class SpatialPolygons or...</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 SpatialPolygons {sp}"><tr><td>SpatialPolygons {sp}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> create objects of class SpatialPolygons or SpatialPolygonsDataFrame</h2> <h3>Description</h3> <p> create objects of class <code>SpatialPolygons</code> or <code>SpatialPolygonsDataFrame</code> from lists of <code>Polygons</code> objects and <code>data.frame</code>s</p> <h3>Usage</h3> <pre> Polygon(coords, hole=as.logical(NA)) Polygons(srl, ID) SpatialPolygons(Srl, pO, proj4string=CRS(as.character(NA))) SpatialPolygonsDataFrame(Sr, data, match.ID = TRUE) getSpatialPolygonsLabelPoints(SP) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>coords</code></td> <td> <p>2-column numeric matrix with coordinates; first point (row) should equal last coordinates (row); if the hole argument is not given, the status of the polygon as a hole or an island will be taken from the ring direction, with clockwise meaning island, and counter-clockwise meaning hole</p> </td></tr> <tr valign="top"><td><code>hole</code></td> <td> <p>logical value for setting polygon as hole or not; if the hole argument is not given, the status of the polygon as a hole or an island will be taken from the ring direction, with clockwise meaning island, and counter-clockwise meaning hole</p> </td></tr> <tr valign="top"><td><code>proj4string</code></td> <td> <p> projection string of class <a href="CRS-class.html">CRS-class</a></p> </td></tr> <tr valign="top"><td><code>srl</code></td> <td> <p>list with <a href="Polygon-class.html">Polygon-class</a> objects</p> </td></tr> <tr valign="top"><td><code>ID</code></td> <td> <p>character vector of length one with identifier</p> </td></tr> <tr valign="top"><td><code>Srl</code></td> <td> <p> list with objects of class <a href="Polygons-class.html">Polygons-class</a></p> </td></tr> <tr valign="top"><td><code>pO</code></td> <td> <p> integer vector; plotting order; if missing in reverse order of Polygons area </p> </td></tr> <tr valign="top"><td><code>Sr</code></td> <td> <p> object of class <a href="SpatialPolygons-class.html">SpatialPolygons-class</a></p> </td></tr> <tr valign="top"><td><code>data</code></td> <td> <p> object of class <code>data.frame</code>; the number of rows in <code>data</code> should equal the number of <a href="Polygons-class.html">Polygons-class</a> objects in <code>Sr</code></p> </td></tr> <tr valign="top"><td><code>match.ID</code></td> <td> <p>logical: (default TRUE): match SpatialPolygons member Polygons ID slot values with data frame row names, and re-order the data frame rows if necessary. If character: indicates the column in <code>data</code> with Polygons IDs to match</p> </td></tr> <tr valign="top"><td><code>SP</code></td> <td> <p>object of class <a href="SpatialPolygons-class.html">SpatialPolygons-class</a></p> </td></tr> </table> <h3>Details</h3> <p>In <code>Polygon</code>, if the hole argument is not given, the status of the polygon as a hole or an island will be taken from the ring direction, with clockwise meaning island, and counter-clockwise meaning hole. In <code>Polygons</code>, if all of the member Polygon objects are holes, the largest by area will be converted to island status. Until 2010-04-17, version 0.9-61, the area of this converted object was erroneously left at its hole value of zero. Thanks to Patrick Giraudoux for spotting the bug. </p> <p>The class definitions used for polygons in <span class="pkg">sp</span> do not accord with those of the simple features specification of the Open Geospatial Consortium. The <span class="pkg">rgeos</span> package, an interface to Geometry Engine – Open Source (GEOS), uses this specification, in which each hole (interior ring) must be associated with its containing exterior ring. In order to avoid introducing incompatible changes into the class definition of Polygons objects, a comment has been added as a single character string to each such object. Here we can trust the data source to assign the hole status correctly, and use the simple function <code><a href="../../rgeos/html/createSPComment.html">createSPComment</a></code> to add such comments to each Polygons member of the polygons slot of this SpatialPolygons object. Exterior rings are coded zero, while interior rings are coded with the 1-based index of the exterior ring to which they belong. SpatialPolygons objects created by reading using <code><a href="../../rgdal/html/readOGR.html">readOGR</a></code> from <span class="pkg">rgdal</span> have the comments set on input, as OGR also uses SFS. </p> <p>Refer to Bivand et al. (2013), pages 47-48 and 132-133 for a further discussion. </p> <h3>Value</h3> <p><code>Polygon</code> returns an object of class <code>Polygon</code>; <code>Polygons</code> returns an object of class <code>Polygons</code>; <code>SpatialPolygons</code> returns object of class <code>SpatialPolygons</code>; <code>SpatialPolygonsDataFrame</code> returns object of class <code>SpatialPolygonsDataFrame</code> <code>getSpatialPolygonsLabelPoints</code> returns an object of class <code>SpatialPoints</code> with label points. </p> <h3>References</h3> <p>Roger Bivand, Edzer Pebesma and Virgilio Gomez-Rubio, 2013. Applied spatial data analysis with R, Second edition. Springer, NY. <a href="https://asdar-book.org/">https://asdar-book.org/</a></p> <h3>See Also</h3> <p><a href="SpatialPolygons-class.html">SpatialPolygons-class</a>, <a href="SpatialPolygonsDataFrame-class.html">SpatialPolygonsDataFrame-class</a> </p> <hr /><div style="text-align: center;">[Package <em>sp</em> version 1.4-2 <a href="00Index.html">Index</a>]</div> </body></html>