[postgis-users] order of points in ST_ConvexHull

Sufficool, Stanley ssufficool at rov.sbcounty.gov
Thu Feb 26 12:51:22 PST 2009


Pull the centroid of the geometry and use generate_series() / pointn()
to "explode" the points and test each point for above & right of
centroid, above and left of centroid, etc...

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Armin Burger
> Sent: Thursday, February 26, 2009 11:57 AM
> To: PostGIS Users Discussion
> Subject: [postgis-users] order of points in ST_ConvexHull
> 
> 
> 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
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list