st_as_binary: Convert sfc object to an WKB object

Description Usage Arguments Details

Description

Convert sfc object to an WKB object

Usage

1
2
3
4
5
6
7
8
9
st_as_binary(x, ...)

## S3 method for class 'sfc'
st_as_binary(x, ..., EWKB = FALSE, endian = .Platform$endian,
  pureR = FALSE, precision = attr(x, "precision"), hex = FALSE)

## S3 method for class 'sfg'
st_as_binary(x, ..., endian = .Platform$endian, EWKB = FALSE,
  pureR = FALSE, hex = FALSE)

Arguments

x

object to convert

...

ignored

EWKB

logical; use EWKB (PostGIS), or (default) ISO-WKB?

endian

character; either "big" or "little"; default: use that of platform

pureR

logical; use pure R solution, or C++?

precision

numeric; if zero, do not modify; to reduce precision: negative values convert to float (4-byte real); positive values convert to round(x*precision)/precision. See details.

hex

logical; return hexadecimal encoded (character)?

Details

for the precion model, see also http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/PrecisionModel.html. There, it is written that: “... to specify 3 decimal places of precision, use a scale factor of 1000. To specify -3 decimal places of precision (i.e. rounding to the nearest 1000), use a scale factor of 0.001.”. Note that ALL coordinates, so also Z or M values (if present) are affected.


mdsumner/gv documentation built on May 22, 2019, 4:44 p.m.