EVOLUTION-MANAGER
Edit File: s2.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: functions for spherical geometry, using s2 package</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 s2 {sf}"><tr><td>s2 {sf}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>functions for spherical geometry, using s2 package</h2> <h3>Description</h3> <p>functions for spherical geometry, using the s2 package based on the google s2geometry.io library </p> <h3>Usage</h3> <pre> sf_use_s2(use_s2) ## S3 method for class 'wk_wkb' st_as_sfc(x, ..., crs = st_crs(4326)) ## S3 method for class 's2_geography' st_as_sfc( x, ..., crs = st_crs(4326), endian = match(.Platform$endian, c("big", "little")) - 1L ) st_as_s2(x, ...) ## S3 method for class 'sf' st_as_s2(x, ...) ## S3 method for class 'sfc' st_as_s2(x, ..., oriented = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>use_s2</code></td> <td> <p>logical; if <code>TRUE</code>, use the s2 spherical geometry package for geographical coordinate operations</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>object of class <code>sf</code>, <code>sfc</code> or <code>sfg</code></p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>passed on</p> </td></tr> <tr valign="top"><td><code>crs</code></td> <td> <p>coordinate reference system; object of class <code>crs</code></p> </td></tr> <tr valign="top"><td><code>endian</code></td> <td> <p>integer; 0 or 1: defaults to the endian of the native machine</p> </td></tr> <tr valign="top"><td><code>oriented</code></td> <td> <p>logical; if <code>FALSE</code>, polygons that cover more than half of the globe are inverted; if <code>TRUE</code>, no reversal takes place and it is assumed that the inside of the polygon is to the left of the polygon's path.</p> </td></tr> </table> <h3>Details</h3> <p><code>st_as_s2</code> converts an <code>sf</code> POLYGON object into a form readable by <code>s2</code>. </p> <h3>Value</h3> <p><code>sf_use_s2</code> returns the value of this variable before (re)setting it, invisibly if <code>use_s2</code> is not missing. </p> <h3>Examples</h3> <pre> m = rbind(c(-1,-1), c(1,-1), c(1,1), c(-1,1), c(-1,-1)) m1 = rbind(c(-1,-1), c(1,-1), c(1,1), c(-1,1), c(-1,0), c(-1,-1)) m0 = m[5:1,] mp = st_multipolygon(list( list(m, 0.8 * m0, 0.01 * m1 + 0.9), list(0.7* m, 0.6*m0), list(0.5 * m0), list(m+2), list(m+4,(.9*m0)+4) )) sf = st_sfc(mp, mp, crs = 'EPSG:4326') s2 = st_as_s2(sf) </pre> <hr /><div style="text-align: center;">[Package <em>sf</em> version 0.9-5 <a href="00Index.html">Index</a>]</div> </body></html>