From acc4e68a93b16832d397ff75bf5328a32094f525 Mon Sep 17 00:00:00 2001 From: mdroe Date: Tue, 5 Jun 2012 20:37:07 +0000 Subject: Fix bug with serial intersection where the intersection is null. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@17203 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 18f248eb618623cad24c535ad787f818f5c76a09 --- lib/polygon.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/polygon.py b/lib/polygon.py index 689e272..4270ce6 100644 --- a/lib/polygon.py +++ b/lib/polygon.py @@ -631,6 +631,10 @@ class SphericalPolygon(object): result = copy(polygons[0]) for polygon in polygons[1:]: result = result.intersection(polygon) + # If we have a null intersection already, we don't + # need to go any further. + if len(result._points) < 3: + return result return result else: raise ValueError("method must be 'parallel' or 'serial'") -- cgit