EVOLUTION-MANAGER
Edit File: st_shift_longitude.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: Shift or re-center geographical coordinates for a Pacific...</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 st_shift_longitude {sf}"><tr><td>st_shift_longitude {sf}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Shift or re-center geographical coordinates for a Pacific view</h2> <h3>Description</h3> <p>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 is the sf equivalent of <code><a href="../../sp/html/recenter-methods.html">recenter</a></code> in the sp package and ST_ShiftLongitude in PostGIS. </p> <h3>Usage</h3> <pre> st_shift_longitude(x) ## S3 method for class 'sfc' st_shift_longitude(x, ...) ## S3 method for class 'sf' st_shift_longitude(x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>object of class sf or sfc</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>ignored</p> </td></tr> </table> <h3>Examples</h3> <pre> ## sfc pt1 = st_point(c(-170, 50)) pt2 = st_point(c(170, 50)) (sfc = st_sfc(pt1, pt2)) sfc = st_set_crs(sfc, 4326) st_shift_longitude(sfc) ## sf d = st_as_sf(data.frame(id = 1:2, geometry = sfc)) st_shift_longitude(d) </pre> <hr /><div style="text-align: center;">[Package <em>sf</em> version 0.9-5 <a href="00Index.html">Index</a>]</div> </body></html>