[postgis-users] function to check if a polygon is convex

B H hemantbist at gmail.com
Wed Mar 2 13:15:52 PST 2022


Hi,
How do I check if the polygon is convex in postgis?

Things I have tried before sending this email
 I could not find any function  like st_is_convex.
I searched in google but  I could not find any user defined postgres
function to check for convexity of polygon either.
select st_convexhull(wkb_geometry) = wkb_geometry  -- this returns false
for convex polygons also.

Other libraries e.g. CGAL seem to have it. So I am hoping that something is
already available in postgis that I am missing.
https://doc.cgal.org/Manual/3.1/doc_html/cgal_manual/Partition_2_ref/Function_convex_partition_is_valid_2.html
Best,
HB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20220302/f2fd0ad3/attachment.html>


More information about the postgis-users mailing list