Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

st_astext

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 = options("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)

lwgeom

Bindings to Selected 'liblwgeom' Functions for Simple Features

v0.2-6
GPL-2
Authors
Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Colin Rundel [ctb], Andy Teucher [ctb], liblwgeom developers [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.