EVOLUTION-MANAGER
Edit File: st_precision.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: Get precision</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_precision {sf}"><tr><td>st_precision {sf}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Get precision</h2> <h3>Description</h3> <p>Get precision </p> <p>Set precision </p> <h3>Usage</h3> <pre> st_precision(x) st_set_precision(x, precision) st_precision(x) <- value </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>object of class <code>sfc</code> or <code>sf</code></p> </td></tr> <tr valign="top"><td><code>precision</code></td> <td> <p>numeric, or object of class <code>units</code> with distance units (but see details); see <a href="st_as_binary.html">st_as_binary</a> for how to do this.</p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>precision value</p> </td></tr> </table> <h3>Details</h3> <p>If <code>precision</code> is a <code>units</code> object, the object on which we set precision must have a coordinate reference system with compatible distance units. </p> <p>Setting a <code>precision</code> has no direct effect on coordinates of geometries, but merely set an attribute tag to an <code>sfc</code> object. The effect takes place in <a href="st_as_binary.html">st_as_binary</a> or, more precise, in the C++ function <code>CPL_write_wkb</code>, where simple feature geometries are being serialized to well-known-binary (WKB). This happens always when routines are called in GEOS library (geometrical operations or predicates), for writing geometries using <a href="st_write.html">st_write</a> or <a href="st_write.html">write_sf</a>, <code>st_make_valid</code> in package <code>lwgeom</code>; also <a href="aggregate.sf.html">aggregate</a> and <a href="tidyverse.html">summarise</a> by default union geometries, which calls a GEOS library function. Routines in these libraries receive rounded coordinates, and possibly return results based on them. <a href="st_as_binary.html">st_as_binary</a> contains an example of a roundtrip of <code>sfc</code> geometries through WKB, in order to see the rounding happening to R data. </p> <p>The reason to support precision is that geometrical operations in GEOS or liblwgeom may work better at reduced precision. For writing data from R to external resources it is harder to think of a good reason to limiting precision. </p> <h3>See Also</h3> <p><a href="st_as_binary.html">st_as_binary</a> for an explanation of what setting precision does, and the examples therein. </p> <h3>Examples</h3> <pre> x <- st_sfc(st_point(c(pi, pi))) st_precision(x) st_precision(x) <- 0.01 st_precision(x) </pre> <hr /><div style="text-align: center;">[Package <em>sf</em> version 0.9-5 <a href="00Index.html">Index</a>]</div> </body></html>