[postgis-users] Find out if polygon is circle
Martijn Meijers
b.m.meijers at tudelft.nl
Wed Feb 4 12:41:18 PST 2015
> I have many different polygons in my database and would like to know
> if there's any way to find out if a polygon has the shape of a circle.
You could try to compute compactness for the shapes.
See e.g.
http://gis.stackexchange.com/questions/85812/easily-calculate-roundness-compactness-of-a-polygon
The first answer there mentions:
"""
The compactness of an object is often defined as the area divided by the
SQUARE of the perimeter. If you multiply this by 4*PI, it will be equal
to 1 for the circle and this will be the maximum value of your index.
Any other geometric shape has a smaller ratio.
"""
I think not available in PostGIS, but this seems to be relevant:
http://www.h2gis.org/docs/dev/ST_CompactnessRatio/
Martijn
More information about the postgis-users
mailing list