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

validate_wkt

Validate WKT objects


Description

validate_wkt takes a vector of WKT objects and validates them, returning a data.frame containing the status of each entry and (in the case it cannot be parsed) any comments as to what, in particular, may be wrong with it. It does not, unfortunately, check whether the object meets the WKT spec - merely that it is formatted correctly.

Usage

validate_wkt(x)

Arguments

x

a character vector of WKT objects.

Value

a data.frame of two columns, is_valid (containing TRUE or FALSE values for whether the WKT object is parseable and valid) and comments (containing any error messages in the case that the WKT object is not). If the objects are simply NA, both fields will contain NA.

See Also

wkt_correct() for correcting WKT objects that fail validity checks due to having a non-default orientation.

Examples

wkt <- c("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))",
 "ARGHLEFLARFDFG",
 "LINESTRING (30 10, 10 90, 40 some string)")
validate_wkt(wkt)

wellknown

Convert Between 'WKT' and 'GeoJSON'

v0.7.2
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>), Os Keyes [aut] (author of code in src/)
Initial release

We don't support your browser anymore

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