Like other geo types, geo_wkt() doesn't convert its input but does validate it using validate_geovctrs_wkt(). To skip validation, use new_geovctrs_wkt().

geo_wkt(x = character())

parse_wkt(x)

as_geo_wkt(x, ..., trim = TRUE, precision = 16, dimensions = 3)

Arguments

x

A character vector containing well-known text

...

Unused

trim

Trim unnecessary zeroes in the output?

precision

The rounding precision to use when writing (number of decimal places).

dimensions

The maximum number of dimensions to consider when generating text.

Value

A new_geovctrs_wkt()

Examples

# use geo_wkt() to "mark" a vector as well-known text geo_wkt("POINT (30 10)")
#> <geovctrs_wkt[1]> #> [1] POINT (30 10)
# use as_geo_wkt() to use conversion options as_geo_wkt("POINT (30 10)", trim = FALSE, precision = 2)
#> <geovctrs_wkt[1]> #> [1] POINT (30.00 10.00)
# use parse_wkt() to identify parsing failures parse_wkt("POINT EMTPY")
#> Warning: 1 parsing failure. #> row col expected actual error #> 1 -- geovctrs_wkt POINT EMTPY Expected 'Z', 'M', 'ZM', 'EMPTY' or '(' but encountered EMTPY #> See attr(result, 'problems') for more details.
#> <geovctrs_wkt[1]> #> [1] NA_wkt_