Description Usage Arguments Value Examples
wkt_correct
does precisely what it says on the tin,
correcting the orientation of WKT objects that are improperly oriented
(say, back to front). It can be applied to WKT objects that,
when validated with validate_wkt
, fail for that reason.
1 | wkt_correct(x)
|
x |
a character vector of WKT objects to correct |
a character vector, the same length as x
, containing
either the original value (if there was no correction to make, or if
the object was invalid for other reasons) or the corrected WKT
value.
1 2 3 4 5 6 7 8 | # A WKT object
wkt <- "POLYGON((30 20, 10 40, 45 40, 30 20), (15 5, 5 10, 10 20, 40 10, 15 5))"
# That's invalid due to a non-default orientation
validate_wkt(wkt)
# And suddenly isn't!
wkt_correct(wkt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.