EVOLUTION-MANAGER
Edit File: recenter-methods.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: Methods for Function recenter in Package 'sp'</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 recenter-methods {sp}"><tr><td>recenter-methods {sp}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Methods for Function recenter in Package ‘sp’</h2> <h3>Description</h3> <p>Methods for function <code>recenter</code> in package <span class="pkg">sp</span> to shift or re-center geographical coordinates for a Pacific view. All longitudes < 0 are added to 360, to avoid for instance parts of Alaska being represented on the far left and right of a plot because they have values straddling 180 degrees. In general, using a projected coordinate reference system is to be preferred, but this method permits a geographical coordinate reference system to be used. This idea was suggested by Greg Snow, and corresponds to the two world representations in the <span class="pkg">maps</span> package. </p> <h3>Methods</h3> <dl> <dt>obj = "SpatialPolygons"</dt><dd><p>recenter a SpatialPolygons object</p> </dd> <dt>obj = "Polygons"</dt><dd><p>recenter a Polygons object </p> </dd> <dt>obj = "Polygon"</dt><dd><p>recenter an Polygon object </p> </dd> <dt>obj = "SpatialLines"</dt><dd><p>recenter a SpatialLines object </p> </dd> <dt>obj = "Lines"</dt><dd><p>recenter a Lines object </p> </dd> <dt>obj = "Line"</dt><dd><p>recenter an Line object </p> </dd> </dl> <h3>Examples</h3> <pre> crds <- matrix(c(179, -179, -179, 179, 50, 50, 52, 52), ncol=2) SL <- SpatialLines(list(Lines(list(Line(crds)), "1")), CRS("+proj=longlat +ellps=WGS84")) bbox(SL) SLr <- recenter(SL) bbox(SLr) rcrds <- rbind(crds, crds[1,]) SpP <- SpatialPolygons(list(Polygons(list(Polygon(rcrds)), ID="r1")), proj4string=CRS("+proj=longlat +ellps=WGS84")) bbox(SpP) SpPr <- recenter(SpP) bbox(SpPr) opar <- par(mfrow=c(1,2)) plot(SpP) plot(SpPr) par(opar) crds <- matrix(c(-1, 1, 1, -1, 50, 50, 52, 52), ncol=2) SL <- SpatialLines(list(Lines(list(Line(crds)), "1")), CRS("+proj=longlat +ellps=WGS84")) bbox(SL) SLr <- recenter(SL) bbox(SLr) rcrds <- rbind(crds, crds[1,]) SpP <- SpatialPolygons(list(Polygons(list(Polygon(rcrds)), ID="r1")), proj4string=CRS("+proj=longlat +ellps=WGS84")) bbox(SpP) SpPr <- recenter(SpP) bbox(SpPr) opar <- par(mfrow=c(1,2)) plot(SpP) plot(SpPr) par(opar) </pre> <hr /><div style="text-align: center;">[Package <em>sp</em> version 1.4-2 <a href="00Index.html">Index</a>]</div> </body></html>