This option, from GME, the will allow you to:
Determines the longest line that can be position within the bounds of a polygon, crossing no edges
geom.polygonfetch (Calculate Fetch In Polygons)
This tool estimates the longest straight line that can be positioned within a polygon, without crossing any edges. It corresponds to the 'fetch' of a lake: the longest stretch of water over which waves can build up as a function of wind action. The calculation is based on evaluating the lines created by connecting all pairs of non-neighbouring vertices and retaining the longest line that does not cross any interior or exterior boundaries of the polygons. This is a brute force algorithm that can take a long time for very complex polygons (e.g. polygons with more than 1000 vertices).
The 'where' clause can be used to define a subset of polygons to process. See the 'where' section for further details on how to formulate a where clause.
Here is the syntax:
geom.polygonfetch(in, uidfield, out, [where]);
in the input polygon data source
uidfield the unique ID field of the input feature data source
out the output line data source
[where] the selection statement that will be applied to the line feature data source to identify a subset of lines to process (see full Help documentation for further details)
Here is an example input:
geom.polygonfetch(in="C:\data\lakes.shp", out="C:\data\fetch.shp", uidfield="LAKEID");
geom.polygonfetch(in="C:\data\lakes.shp", out="C:\data\fetch.shp", uidfield="LAKEID", where="AREA > 10000");