[postgis-users] order of points in ST_ConvexHull

Armin Burger armin.burger at gmx.net
Thu Feb 26 11:57:02 PST 2009


Hello

I need to find a possibility to identify upper-left, upper-right, etc. 
corners of +/- rectangular polygons. I.e. polygons with guranteed just 4 
corners, but with a shape that is typically between a rectangle and a 
rhomb. The polygons define the geometry of image boundaries ("image 
footprints"). But it cannot be guaranteed which point in the polygon 
corresponds to which corner since the order of points during geometry 
creation is unknown.

One idea was to use ST_ConvexHull(geometry) since for this very simple 
polygons the convex hull seems to be identical with the geometry. It 
looked to me that the order in this convex hull was:
   lower-right, lower-left, upper-left, upper-right
Does anybody know if this order is always like that or can this order 
change? Would anybody know another method to identify which point of the 
polygon corresponds to which corner?

Regards

Armin



More information about the postgis-users mailing list