[postgis-users] Longest axis of a polygon

Michael Fuhr mike at fuhr.org
Thu Jan 26 12:33:58 PST 2006


On Thu, Jan 26, 2006 at 10:14:37AM +0000, Christian Heine wrote:
> is there a way to retrieve the longest axis of a given polygon in PostGIS? 
> I need to construct cross sections (profiles) of 300+ polygons and this 
> would be the best way to automatise the workflow and save (precious PhD-) 
> time.
> 
> Ideally, one would take the longest possible straight line within a given 
> polygon.

Entirely within, or is partially within acceptable?

I'm not familiar with solving this problem so maybe this isn't
correct or what you need, but could you look for the pair of points
on the polygon's (simplified) exterior ring or convex hull separated
by the most distance?  It would be easy to iterate through the
points in a function.

-- 
Michael Fuhr



More information about the postgis-users mailing list