I have a series of points (ObservationPoints.shp) along a line (Centreline.shp). I am looking to find the longest line from these ObservationPoints to the Centreline without crossing the boundary of a polygon (PolygonBoundary.shp).
The image below shows 3 examples, the first two are correct examples (cyan - polygon, magenta - points and dark blue - centreline) where the longest lines (LongestLines.shp) do not cross the polygon boundary. The third example is incorrect as the longest line crosses the polygon boundary.
The only thing I can think of is to write a bit of code so that:
- for every point, draw radial lines at a given bearing spacing and length then,
- clip those lines to the polygon boundary then,
- remove all but the longest of those radial lines then,
- clip this longest line to the centreline.
Am I over-complicating this? Is there an easier way? Or a tool out there that already exists?