Closed edzer closed 7 years ago
I'll raise it with the boost::geometry folks, although validation is mostly to check that the contents can be parsed out.
Then maybe you should call it is_parseable
rather than is_valid
- valid has a different meaning in the context of the simple feature standard.
Hence why I've opened an upstream ticket to see why this is parsing as an acceptable polygon.
Still waiting on a response; will bump it.
Okay, after some back and forth with the geometry devs we have a solution, and even one that produces a nice output message!
validate_wkt("POLYGON((2 1.3,2.4 1.7))") is_valid comments 1 FALSE The WKT object has too few points for its type
validate_wkt("POLYGON((2 1.3,2.4 1.7, 3 4.4, 1 2.2))") is_valid comments 1 FALSE The WKT object is closed but does not have matching start/end points
`
?wkt_centroid
givesPOLYGON((2 1.3,2.4 1.7))
as an example, andI don't believe that this is a valid polygon, though. WKT polygons need to be closed, and span an area.
With
sf
: