st_as_text_2: Return WKT or WKT2 basing on the installed rgdal version

View source: R/st_as_text_2.R

st_as_text_2R Documentation

Return WKT or WKT2 basing on the installed rgdal version

Description

This is a convenience temporary function which returns the WKT representation of a CRS, using sf::st_as_text() in case PROJ < 3, rgdal::CRS() otherwise. This has the advantage to perform precise transformations with PROJ >=3, and to avoid conversion errors (see here). This function will be deleted whenever sf will manage WKT2.

Usage

st_as_text_2(x, pretty = FALSE)

Arguments

x

object of class sfg, sfc or crs

pretty

logical; if TRUE, print human-readable well-known-text representation of a coordinate reference system

Value

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

Author(s)

Luigi Ranghetti, phD (2019)

Examples

sen2r:::st_as_text_2(sf::st_crs(32632))

sen2r documentation built on Nov. 10, 2023, 9:08 a.m.