st_astext: Return Well-known Text representation of simple feature...

View source: R/wkt.R

st_astextR Documentation

Return Well-known Text representation of simple feature geometry

Description

Return Well-known Text representation of simple feature geometry or coordinate reference system

Usage

st_astext(x, digits = getOption("digits"), ..., EWKT = FALSE)

st_asewkt(x, digits = options("digits"))

Arguments

x

object of class sfg, sfc, or sf

digits

integer; number of decimal digits to print

...

ignored

EWKT

logical; use PostGIS Enhanced WKT (includes srid)

Details

The returned WKT representation of simple feature geometry conforms to the simple features access specification and extensions (if EWKT = TRUE), known as EWKT, supported by PostGIS and other simple features implementations for addition of SRID to a WKT string.

st_asewkt() returns the Well-Known Text (WKT) representation of the geometry with SRID meta data.

Examples

library(sf)
pt <- st_sfc(st_point(c(1.0002,2.3030303)), crs = 4326)
st_astext(pt, 3)
st_asewkt(pt, 3)

r-spatial/lwgeom documentation built on April 30, 2024, 9:11 p.m.